io_uring: add blkcg accounting to offloaded operations
authorDennis Zhou <dennis@kernel.org>
Wed, 16 Sep 2020 20:41:05 +0000 (13:41 -0700)
committerJens Axboe <axboe@kernel.dk>
Thu, 1 Oct 2020 02:32:34 +0000 (20:32 -0600)
commit91d8f5191e8fe6fc6a87aa5353b36f5a7409fbec
tree89231bbe87d3ef3a5b773c346d3780bbcc1059ec
parentde2939388be564836b06f0f06b3787bdedaed822
io_uring: add blkcg accounting to offloaded operations

There are a few operations that are offloaded to the worker threads. In
this case, we lose process context and end up in kthread context. This
results in ios to be not accounted to the issuing cgroup and
consequently end up as issued by root. Just like others, adopt the
personality of the blkcg too when issuing via the workqueues.

For the SQPOLL thread, it will live and attach in the inited cgroup's
context.

Signed-off-by: Dennis Zhou <dennis@kernel.org>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
fs/io-wq.c
fs/io-wq.h
fs/io_uring.c