Skip to content

Fix crazy CPU accounting usage for SQPOLL

Jens Axboe io-uring stable 2 versions – New

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest2 patches 0 repliesNew
  2. v12 patches 2 repliesSuperseded

Changes in v2 from the cover letter

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

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/2io_uring/sqpoll: switch away from getrusage() for CPU accountingio_uring/fdinfo.c io_uring/sqpoll.c io_uring/sqpoll.h+23 -180 replies
2/2io_uring/sqpoll: be smarter on when to update the stime usageio_uring/sqpoll.c+32 -110 replies

Reviews trailers per patch

1 of 2 patches has a Reviewed-by or Acked-by.

PatchGabriel Krisman Bertazi
1/2R-b
2/2

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v2 thread

Cover letter [PATCHSET v2 0/2] Fix crazy CPU accounting usage for SQPOLL

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(-)
Signature · 1 line
Jens Axboe