Date: Wed, 11 Jul 2018 14:22:07 -0400 From: Andrew Gallatin <gallatin@cs.duke.edu> To: Steevan Rodrigues <steevanxperia@gmail.com> Cc: freebsd-hackers@freebsd.org Subject: Re: high CPU usage in FreeBSD for a PCIe card driver Message-ID: <03274bb2-87b1-ab32-ee15-81e83b6f6bdd@cs.duke.edu> In-Reply-To: <CAKsGTHQ_5jVPfu-4ZdaswZSb3-=NX_%2Bskow6ZW44YuWAhtWf3w@mail.gmail.com> 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>
next in thread | previous in thread | raw e-mail | index | archive | help
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?03274bb2-87b1-ab32-ee15-81e83b6f6bdd>