Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 27 Jun 2018 08:11:13 -0600
From:      Warner Losh <imp@bsdimp.com>
To:        Steevan Rodrigues <steevanxperia@gmail.com>
Cc:        "freebsd-hackers@freebsd.org" <freebsd-hackers@freebsd.org>
Subject:   Re: high CPU usage in FreeBSD for a PCIe card driver
Message-ID:  <CANCZdfoO6HsxiCt_SC8n1Jb3GhmbMewAQ2F4Y5OvfWymjcwDLw@mail.gmail.com>
In-Reply-To: <CAKsGTHR9AzX2v%2B%2BDbNCdt7RwxEfw8jKwndXzH9oxQEHvPszo%2Bw@mail.gmail.com>
References:  <CAKsGTHR9AzX2v%2B%2BDbNCdt7RwxEfw8jKwndXzH9oxQEHvPszo%2Bw@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
No. It's not from mtx_lock. It's likely from lock contention. Since the
list ate the attachment, I can't check for sure, but high CPU usage in
locking primitives is a classic sign of poor lock design leading to
contention.

Warner

On Wed, Jun 27, 2018 at 6:28 AM, Steevan Rodrigues <steevanxperia@gmail.com>
wrote:

> Hi
>
> I  come from Linux background and new to FreeBSD.
>
> I am investigating a high CPU usage issue on FreeBSD for PCIe driver of a
> card . The card can process data at a rate of 30 to 50 Gbps . However, I
> see very high CPU usage even when I run a single threaded user side
> application which uses this card .
>
> I ran hotkernel script from Dtrace toolkit.   A portion of the output is
> given in the attached file  dtraceDiff.txt. Here I see that lock_delay
> seems to be the reason for high CPU usage. Looks like it comes from mutex
> locks
>
> This driver uses  mutex locks ( mtx_lock).
>
> The CPU usage is very high  on a multicore (Xeon CPU) server node than a
> dual core (Intel i3) Desktop .
>
> It shows 30 to 40 % CPU usage on a Intel i3 ( 2 core 4 threads) and 60 to
> 70% CPU usage  on a Xeon  CPU with 12 core (24 threads) for same output
> data rate .
>
> I wonder whether usage of mtx_lock is the cause of high CPU usage ? Any
> pointers or suggestions welcome.
>
> Using  FreeBSD 11.1 Release
>
> Thanks
>
> Steev
>
> _______________________________________________
> freebsd-hackers@freebsd.org mailing list
> https://lists.freebsd.org/mailman/listinfo/freebsd-hackers
> To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org"
>
>



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CANCZdfoO6HsxiCt_SC8n1Jb3GhmbMewAQ2F4Y5OvfWymjcwDLw>