summaryrefslogtreecommitdiff
path: root/fs/io-wq.h
diff options
context:
space:
mode:
authorDennis Zhou <dennis@kernel.org>2020-09-16 13:41:05 -0700
committerJens Axboe <axboe@kernel.dk>2020-09-30 20:32:34 -0600
commit91d8f5191e8fe6fc6a87aa5353b36f5a7409fbec (patch)
tree89231bbe87d3ef3a5b773c346d3780bbcc1059ec /fs/io-wq.h
parentde2939388be564836b06f0f06b3787bdedaed822 (diff)
downloadlinux-rpi-91d8f5191e8fe6fc6a87aa5353b36f5a7409fbec.tar.gz
linux-rpi-91d8f5191e8fe6fc6a87aa5353b36f5a7409fbec.tar.bz2
linux-rpi-91d8f5191e8fe6fc6a87aa5353b36f5a7409fbec.zip
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>
Diffstat (limited to 'fs/io-wq.h')
-rw-r--r--fs/io-wq.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/fs/io-wq.h b/fs/io-wq.h
index 2519830c8c55..84bcf6a85523 100644
--- a/fs/io-wq.h
+++ b/fs/io-wq.h
@@ -87,6 +87,9 @@ struct io_wq_work {
struct io_wq_work_node list;
struct files_struct *files;
struct mm_struct *mm;
+#ifdef CONFIG_BLK_CGROUP
+ struct cgroup_subsys_state *blkcg_css;
+#endif
const struct cred *creds;
struct nsproxy *nsproxy;
struct fs_struct *fs;