Date: Wed, 27 Jun 2018 17:58:20 +0530 From: Steevan Rodrigues <steevanxperia@gmail.com> To: freebsd-hackers@freebsd.org Subject: high CPU usage in FreeBSD for a PCIe card driver Message-ID: <CAKsGTHR9AzX2v%2B%2BDbNCdt7RwxEfw8jKwndXzH9oxQEHvPszo%2Bw@mail.gmail.com>
next in thread | raw e-mail | index | archive | help
--00000000000004f1b9056f9ec054 Content-Type: text/plain; charset="UTF-8" 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 --00000000000004f1b9056f9ec054 Content-Type: text/plain; charset="US-ASCII"; name="dtraceDiff.txt" Content-Disposition: attachment; filename="dtraceDiff.txt" Content-Transfer-Encoding: base64 X-Attachment-Id: f_jix3g9dk0 LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCgpDUFUg dXNhZ2UgZGV0YWlscyBvbiBhICAxMiBjb3JlIDI0IHRocmVhZCBzZXJ2ZXIgUEMuIAoKcGFydCBv ZiB0aGUgcGVybCBob3RrZXJuZWwgIG91dHB1dCAKCmtlcm5lbGBmcmVlICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDEzMTQgICAwLjIlCmtlcm5lbGBfc3hfc2xv Y2sgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDE0MTUgICAwLjMlCmtl cm5lbGBkZXZfcmVsdGhyZWFkICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDE0 MzUgICAwLjMlCmtlcm5lbGBkZXZ2bl9yZWZ0aHJlYWQgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgIDE4NDIgICAwLjMlCmtlcm5lbGBfbXR4X2xvY2tfc3Bpbl9jb29raWUgICAgICAg ICAgICAgICAgICAgICAgICAgICAgIDIwNTkgICAwLjQlCmtlcm5lbGBjb3B5aW4gICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDIxNjQgICAwLjQlCmtlcm5lbGBhbWQ2 NF9zeXNjYWxsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDIyMzUgICAwLjQl Cmtlcm5lbGBfX210eF9sb2NrX3NwaW5fZmxhZ3MgICAgICAgICAgICAgICAgICAgICAgICAgICAg IDM1NjYgICAwLjYlCmtlcm5lbGBiemVybyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgIDQ4ODkgICAwLjklCmtlcm5lbGBfX210eF9sb2NrX3NsZWVwICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgIDkzMjMgICAxLjclCmtlcm5lbGBhY3BpX2NwdV9pZGxl ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMTExNjYgICAyLjAlCmtlcm5lbGBw bWFwX2V4dHJhY3QgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMTc0OTEgICAz LjElCmtlcm5lbGBzcGlubG9ja19leGl0ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgNjQ4NTAgIDExLjUlCmtlcm5lbGBjcHVfaWRsZSAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAxMzQ2MTcgIDIzLjklCmtlcm5lbGBsb2NrX2RlbGF5ICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAyNjMzMzAgIDQ2LjglCgotLS0tLS0tLS0tLS0tLS0t LS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tCgpDUFUgdXNhZ2UgZGV0YWlscyBvbiBh ICAyIGNvcmUgNCB0aHJlYWQgSW50ZWwgaTMgYmFzZWQgRGVza3RvcCBQQy4gCgpwYXJ0IG9mIHRo ZSBwZXJsIGhvdGtlcm5lbCAgb3V0cHV0IAoKCmtlcm5lbGAweGZmZmZmZmZmODAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICA1NTggICAwLjYlCmtlcm5lbGBjb3B5b3V0ICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA1OTIgICAwLjYlCjB4ZmZm ZmZmZmY4MjIzNjhhMyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICA2Mzkg ICAwLjclCmtlcm5lbGBhbWQ2NF9zeXNjYWxsICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICA2ODMgICAwLjclCmtlcm5lbGBfX210eF91bmxvY2tfZmxhZ3MgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICA3MjggICAwLjglCmtlcm5lbGBjb3B5aW4gICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDEzMTEgICAxLjQlCmtlcm5lbGBiemVybyAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDE0MzQgICAxLjUlCmtl cm5lbGBwbWFwX2V4dHJhY3QgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIDE2 MTUgICAxLjclCmtlcm5lbGBsb2NrX2RlbGF5ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgIDIzMjkgICAyLjQlCjB4ZmZmZmZmZmY4MjJiMGI1ZSAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgIDI1MjggICAyLjYlCmtlcm5lbGBzcGlubG9ja19leGl0ICAg ICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgMjA5NTAgIDIxLjglCmtlcm5lbGBjcHVf aWRsZSAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgNDgxMjQgIDUwLjIl CgotLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0K --00000000000004f1b9056f9ec054--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAKsGTHR9AzX2v%2B%2BDbNCdt7RwxEfw8jKwndXzH9oxQEHvPszo%2Bw>