* [PATCH] block: Fix io statistics for cgroup in throttle path
@ 2023-02-16 3:22 Jinke Han
2023-02-16 6:08 ` Christoph Hellwig
` (3 more replies)
0 siblings, 4 replies; 5+ messages in thread
From: Jinke Han @ 2023-02-16 3:22 UTC (permalink / raw)
To: axboe, ming.lei; +Cc: linux-block, linux-kernel, muchun.song, Jinke Han
From: Jinke Han <hanjinke.666@bytedance.com>
In the current code, io statistics are missing for cgroup when bio
was throttled by blk-throttle. Fix it by moving the unreaching code
to submit_bio_noacct_nocheck.
Fixes: 3f98c753717c ("block: don't check bio in blk_throtl_dispatch_work_fn")
Signed-off-by: Jinke Han <hanjinke.666@bytedance.com>
---
block/blk-core.c | 23 ++++++++++++-----------
1 file changed, 12 insertions(+), 11 deletions(-)
diff --git a/block/blk-core.c b/block/blk-core.c
index 46d12b3344c9..82b5b2c53f1e 100644
--- a/block/blk-core.c
+++ b/block/blk-core.c
@@ -684,6 +684,18 @@ static void __submit_bio_noacct_mq(struct bio *bio)
void submit_bio_noacct_nocheck(struct bio *bio)
{
+ blk_cgroup_bio_start(bio);
+ blkcg_bio_issue_init(bio);
+
+ if (!bio_flagged(bio, BIO_TRACE_COMPLETION)) {
+ trace_block_bio_queue(bio);
+ /*
+ * Now that enqueuing has been traced, we need to trace
+ * completion as well.
+ */
+ bio_set_flag(bio, BIO_TRACE_COMPLETION);
+ }
+
/*
* We only want one ->submit_bio to be active at a time, else stack
* usage with stacked devices could be a problem. Use current->bio_list
@@ -792,17 +804,6 @@ void submit_bio_noacct(struct bio *bio)
if (blk_throtl_bio(bio))
return;
-
- blk_cgroup_bio_start(bio);
- blkcg_bio_issue_init(bio);
-
- if (!bio_flagged(bio, BIO_TRACE_COMPLETION)) {
- trace_block_bio_queue(bio);
- /* Now that enqueuing has been traced, we need to trace
- * completion as well.
- */
- bio_set_flag(bio, BIO_TRACE_COMPLETION);
- }
submit_bio_noacct_nocheck(bio);
return;
--
2.20.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] block: Fix io statistics for cgroup in throttle path
2023-02-16 3:22 [PATCH] block: Fix io statistics for cgroup in throttle path Jinke Han
@ 2023-02-16 6:08 ` Christoph Hellwig
2023-02-16 6:33 ` Ming Lei
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: Christoph Hellwig @ 2023-02-16 6:08 UTC (permalink / raw)
To: Jinke Han; +Cc: axboe, ming.lei, linux-block, linux-kernel, muchun.song
Looks good:
Reviewed-by: Christoph Hellwig <hch@lst.de>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] block: Fix io statistics for cgroup in throttle path
2023-02-16 3:22 [PATCH] block: Fix io statistics for cgroup in throttle path Jinke Han
2023-02-16 6:08 ` Christoph Hellwig
@ 2023-02-16 6:33 ` Ming Lei
2023-02-16 6:57 ` Muchun Song
2023-02-16 18:05 ` Jens Axboe
3 siblings, 0 replies; 5+ messages in thread
From: Ming Lei @ 2023-02-16 6:33 UTC (permalink / raw)
To: Jinke Han; +Cc: axboe, linux-block, linux-kernel, muchun.song
On Thu, Feb 16, 2023 at 11:22:50AM +0800, Jinke Han wrote:
> From: Jinke Han <hanjinke.666@bytedance.com>
>
> In the current code, io statistics are missing for cgroup when bio
> was throttled by blk-throttle. Fix it by moving the unreaching code
> to submit_bio_noacct_nocheck.
>
> Fixes: 3f98c753717c ("block: don't check bio in blk_throtl_dispatch_work_fn")
> Signed-off-by: Jinke Han <hanjinke.666@bytedance.com>
Looks fine,
Reviewed-by: Ming Lei <ming.lei@redhat.com>
Thanks,
Ming
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] block: Fix io statistics for cgroup in throttle path
2023-02-16 3:22 [PATCH] block: Fix io statistics for cgroup in throttle path Jinke Han
2023-02-16 6:08 ` Christoph Hellwig
2023-02-16 6:33 ` Ming Lei
@ 2023-02-16 6:57 ` Muchun Song
2023-02-16 18:05 ` Jens Axboe
3 siblings, 0 replies; 5+ messages in thread
From: Muchun Song @ 2023-02-16 6:57 UTC (permalink / raw)
To: Jinke Han; +Cc: axboe, ming.lei, linux-block, linux-kernel
> On Feb 16, 2023, at 11:22, Jinke Han <hanjinke.666@bytedance.com> wrote:
>
> From: Jinke Han <hanjinke.666@bytedance.com>
>
> In the current code, io statistics are missing for cgroup when bio
> was throttled by blk-throttle. Fix it by moving the unreaching code
> to submit_bio_noacct_nocheck.
>
> Fixes: 3f98c753717c ("block: don't check bio in blk_throtl_dispatch_work_fn")
> Signed-off-by: Jinke Han <hanjinke.666@bytedance.com>
Acked-by: Muchun Song <songmuchun@bytedance.com>
Thanks.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] block: Fix io statistics for cgroup in throttle path
2023-02-16 3:22 [PATCH] block: Fix io statistics for cgroup in throttle path Jinke Han
` (2 preceding siblings ...)
2023-02-16 6:57 ` Muchun Song
@ 2023-02-16 18:05 ` Jens Axboe
3 siblings, 0 replies; 5+ messages in thread
From: Jens Axboe @ 2023-02-16 18:05 UTC (permalink / raw)
To: ming.lei, Jinke Han; +Cc: linux-block, linux-kernel, muchun.song
On Thu, 16 Feb 2023 11:22:50 +0800, Jinke Han wrote:
> In the current code, io statistics are missing for cgroup when bio
> was throttled by blk-throttle. Fix it by moving the unreaching code
> to submit_bio_noacct_nocheck.
>
>
Applied, thanks!
[1/1] block: Fix io statistics for cgroup in throttle path
commit: 0f7c8f0f7934c389b0f9fa1f151e753d8de6348f
Best regards,
--
Jens Axboe
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2023-02-16 18:06 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-16 3:22 [PATCH] block: Fix io statistics for cgroup in throttle path Jinke Han
2023-02-16 6:08 ` Christoph Hellwig
2023-02-16 6:33 ` Ming Lei
2023-02-16 6:57 ` Muchun Song
2023-02-16 18:05 ` Jens Axboe
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).