linux-block.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* buffered io_uring vs task io accounting
@ 2019-09-13 23:41 Andres Freund
  0 siblings, 0 replies; only message in thread
From: Andres Freund @ 2019-09-13 23:41 UTC (permalink / raw)
  To: Jens Axboe; +Cc: linux-block

Hi,

It appears that task io accounting doesn't currently work when io_uring
defers work to workqueues.

E.g. while I get system wide "iostats -xm 1 /dev/sda" stats like:

Device            r/s     w/s     rMB/s     wMB/s   rrqm/s   wrqm/s  %rrqm  %wrqm r_await w_await aqu-sz rareq-sz wareq-sz  svctm  %util
sda              0.00 36475.00      0.00    250.52     0.00   660.00   0.00   1.78    0.00    0.14   0.00     0.00     7.03   0.03  99.70

"pidstat -d 1" as the user execution fio just shows

03:15:37 PM   UID       PID   kB_rd/s   kB_wr/s kB_ccwr/s iodelay  Command
03:15:38 PM     0     13626     -1.00     -1.00     -1.00      53  kworker/u16:2-io_ring-wq
03:15:38 PM     0     13734     -1.00     -1.00     -1.00      51  kworker/u16:3+io_ring-write-wq
03:15:38 PM     0     13735     -1.00     -1.00     -1.00      53  kworker/u16:4+io_ring-wq
03:15:38 PM     0     13736     -1.00     -1.00     -1.00      50  kworker/u16:5-io_ring-wq
03:15:38 PM     0     13766     -1.00     -1.00     -1.00      52  kworker/u16:7-io_ring-wq
03:15:38 PM     0     13767     -1.00     -1.00     -1.00      51  kworker/u16:8-io_ring-write-wq
03:15:38 PM     0     13769     -1.00     -1.00     -1.00      51  kworker/u16:10+io_ring-wq

and as root I get:

03:20:05 PM   UID       PID   kB_rd/s   kB_wr/s kB_ccwr/s iodelay  Command
03:20:06 PM     0     13735      0.00  34344.00      0.00      49  kworker/u16:4+io_ring-wq
03:20:06 PM     0     13736      0.00  36080.00      0.00      47  kworker/u16:5+io_ring-wq
03:20:06 PM     0     13737      0.00  36624.00      0.00      43  kworker/u16:6+io_ring-wq
03:20:06 PM     0     13766      0.00  30616.00      0.00      50  kworker/u16:7+io_ring-wq
03:20:06 PM     0     13768      0.00  38728.00      0.00      47  kworker/u16:9+io_ring-wq
03:20:06 PM     0     13769      0.00  37792.00      0.00      51  kworker/u16:10+io_ring-wq
03:20:06 PM     0     13890      0.00  39176.00      0.00      47  kworker/u16:13+io_ring-wq

and nothing is attributed to fio itself.  For DIO I do get working task
stats however.

That is not all that surprising because tasks deferred to the workqueue
won't properly be accounted for, because the page is dirtied from within
the workqueue, rather than the normal process context.


I suspect this doesn't just affect task io stats, but also means that
io_uring writes will be able to escape writeback throttling, because
presumably the workqueue kthreads are going to be throttled as
individual tasks, rather than using causing the issuing process to be
throttled.

I assume this is a problem that needs to be fixed?

Greetings,

Andres Freund

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2019-09-13 23:41 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-13 23:41 buffered io_uring vs task io accounting Andres Freund

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).