public inbox for io-uring@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCHSET v2 0/2] Fix crazy CPU accounting usage for SQPOLL
@ 2025-10-22 17:02 Jens Axboe
  2025-10-22 17:02 ` [PATCH 1/2] io_uring/sqpoll: switch away from getrusage() for CPU accounting Jens Axboe
  2025-10-22 17:02 ` [PATCH 2/2] io_uring/sqpoll: be smarter on when to update the stime usage Jens Axboe
  0 siblings, 2 replies; 4+ messages in thread
From: Jens Axboe @ 2025-10-22 17:02 UTC (permalink / raw)
  To: io-uring; +Cc: changfengnan, xiaobing.li, lidiangang, krisman

Hi,

Fengnan Chang reports [1] excessive CPU usage from the SQPOLL work vs
total time accounting, and that indeed does look like a problem. The
issue seems to be just eager time querying, and using essentially the
wrong interface. Patch 1 gets rid of getrusage() for this, and patch 2
attempts to be a bit smarter in how often the time needs to get
queried. Profile results in patch 2 as well.

Since v1:
- Store time in usec rather than convert between nsec and timespec64.

 io_uring/fdinfo.c |  8 +++----
 io_uring/sqpoll.c | 65 ++++++++++++++++++++++++++++++++++++++-----------------
 io_uring/sqpoll.h |  1 +
 3 files changed, 50 insertions(+), 24 deletions(-)

-- 
Jens Axboe


^ permalink raw reply	[flat|nested] 4+ messages in thread
* [PATCHSET 0/2] Fix crazy CPU accounting usage for SQPOLL
@ 2025-10-21 17:55 Jens Axboe
  2025-10-21 17:55 ` [PATCH 2/2] io_uring/sqpoll: be smarter on when to update the stime usage Jens Axboe
  0 siblings, 1 reply; 4+ messages in thread
From: Jens Axboe @ 2025-10-21 17:55 UTC (permalink / raw)
  To: io-uring; +Cc: changfengnan, xiaobing.li, lidiangang

Hi,

Fengnan Chang reports [1] excessive CPU usage from the SQPOLL work vs
total time accounting, and that indeed does look like a problem. The
issue seems to be just eager time querying, and using essentially the
wrong interface. Patch 1 gets rid of getrusage() for this, and patch 2
attempts to be a bit smarter in how often the time needs to get
queried. Profile results in patch 2 as well.

 io_uring/fdinfo.c |  9 ++++---
 io_uring/sqpoll.c | 67 +++++++++++++++++++++++++++++++++--------------
 io_uring/sqpoll.h |  1 +
 3 files changed, 53 insertions(+), 24 deletions(-)

[1] https://lore.kernel.org/io-uring/20251020113031.2135-1-changfengnan@bytedance.com/

-- 
Jens Axboe


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2025-10-22 17:04 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-10-22 17:02 [PATCHSET v2 0/2] Fix crazy CPU accounting usage for SQPOLL Jens Axboe
2025-10-22 17:02 ` [PATCH 1/2] io_uring/sqpoll: switch away from getrusage() for CPU accounting Jens Axboe
2025-10-22 17:02 ` [PATCH 2/2] io_uring/sqpoll: be smarter on when to update the stime usage Jens Axboe
  -- strict thread matches above, loose matches on Subject: below --
2025-10-21 17:55 [PATCHSET 0/2] Fix crazy CPU accounting usage for SQPOLL Jens Axboe
2025-10-21 17:55 ` [PATCH 2/2] io_uring/sqpoll: be smarter on when to update the stime usage Jens Axboe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox