Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 12 Jul 2018 05:15:41 +0530
From:      Steevan Rodrigues <steevanxperia@gmail.com>
To:        Andrew Gallatin <gallatin@cs.duke.edu>
Cc:        freebsd-hackers@freebsd.org
Subject:   Re: high CPU usage in FreeBSD for a PCIe card driver
Message-ID:  <CAKsGTHSj3cgQML1bEJ7UdQdFcF1hfbvq51yS2U2bBE8Vc8rR1Q@mail.gmail.com>
In-Reply-To: <03274bb2-87b1-ab32-ee15-81e83b6f6bdd@cs.duke.edu>
References:  <CAKsGTHR9AzX2v%2B%2BDbNCdt7RwxEfw8jKwndXzH9oxQEHvPszo%2Bw@mail.gmail.com> <a7caaecb-dd62-0c0f-e9ad-b83517bb3c7f@cs.duke.edu> <CAKsGTHRdArYrT33KR6Kx4CqwsTR5MRaC%2BTQfV7yTuQej4_eOXQ@mail.gmail.com> <2ae78782-6cca-452e-d004-3999885ae4e0@cs.duke.edu> <CAKsGTHQ_5jVPfu-4ZdaswZSb3-=NX_%2Bskow6ZW44YuWAhtWf3w@mail.gmail.com> <03274bb2-87b1-ab32-ee15-81e83b6f6bdd@cs.duke.edu>

next in thread | previous in thread | raw e-mail | index | archive | help
Thanks for confirming it.  Yes I do very frequent device ioctl calls .

Regards,
Steevan

On Wed, Jul 11, 2018 at 11:52 PM, Andrew Gallatin <gallatin@cs.duke.edu>
wrote:

> On 07/11/18 07:46, Steevan Rodrigues wrote:
>
>> Hello Andrew,
>>
>> Sorry to bother you.  I am working on this problem again after a break of
>> few days.
>> I ran following command  to get lock statistics  when I run my userspace
>> application on a 12 core 24 thread server PC.
>>  From this data below  to looks like my driver is causing a contention on
>> a kernel lock  (pmap ).  Am I right ?
>>
>>   lockstat -x aggsize=4m -D 20 sleep 10
>>
>> Adaptive mutex spin: 1122679 events in 10.013 seconds (112121 events/sec)
>>
>> Count indv cuml rcnt     nsec Lock                   Caller
>> ------------------------------------------------------------
>> -------------------
>> 1089662  97%  97% 0.00    65375 pmap                   pmap_extract+0x1d2
>> 31805   3% 100% 0.00    14881 cdev                   devvn_refthread+0x142
>>
>
>
> Yes.  You can get more information if you use the -s 10 argument to
> lockstat.  That way, you'll see what's calling pmap_extract.
>
> Are you doing frequent device ioctls?
>
>
> Drew
>



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