linux-block.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andres Freund <andres@anarazel.de>
To: Jens Axboe <axboe@kernel.dk>
Cc: linux-block@vger.kernel.org
Subject: buffered io_uring vs task io accounting
Date: Fri, 13 Sep 2019 16:41:08 -0700	[thread overview]
Message-ID: <20190913234108.gdux4v5xqckohfru@alap3.anarazel.de> (raw)

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

                 reply	other threads:[~2019-09-13 23:41 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190913234108.gdux4v5xqckohfru@alap3.anarazel.de \
    --to=andres@anarazel.de \
    --cc=axboe@kernel.dk \
    --cc=linux-block@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).