cgroups.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] blk-throttle: Eliminate redundant checks for data direction
@ 2024-01-23  8:12 Tang Yizhou
  2024-01-23  8:46 ` Christoph Hellwig
  2024-02-05 17:16 ` Jens Axboe
  0 siblings, 2 replies; 3+ messages in thread
From: Tang Yizhou @ 2024-01-23  8:12 UTC (permalink / raw)
  To: tj, axboe; +Cc: linux-block, cgroups, linux-kernel, chunguang.xu, Tang Yizhou

From: Tang Yizhou <yizhou.tang@shopee.com>

After calling throtl_peek_queued(), the data direction can be determined so
there is no need to call bio_data_dir() to check the direction again.

Signed-off-by: Tang Yizhou <yizhou.tang@shopee.com>
---
 block/blk-throttle.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/block/blk-throttle.c b/block/blk-throttle.c
index 16f5766620a4..2ad4f6cd465b 100644
--- a/block/blk-throttle.c
+++ b/block/blk-throttle.c
@@ -1098,7 +1098,7 @@ static int throtl_dispatch_tg(struct throtl_grp *tg)
 	while ((bio = throtl_peek_queued(&sq->queued[READ])) &&
 	       tg_may_dispatch(tg, bio, NULL)) {
 
-		tg_dispatch_one_bio(tg, bio_data_dir(bio));
+		tg_dispatch_one_bio(tg, READ);
 		nr_reads++;
 
 		if (nr_reads >= max_nr_reads)
@@ -1108,7 +1108,7 @@ static int throtl_dispatch_tg(struct throtl_grp *tg)
 	while ((bio = throtl_peek_queued(&sq->queued[WRITE])) &&
 	       tg_may_dispatch(tg, bio, NULL)) {
 
-		tg_dispatch_one_bio(tg, bio_data_dir(bio));
+		tg_dispatch_one_bio(tg, WRITE);
 		nr_writes++;
 
 		if (nr_writes >= max_nr_writes)
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] blk-throttle: Eliminate redundant checks for data direction
  2024-01-23  8:12 [PATCH] blk-throttle: Eliminate redundant checks for data direction Tang Yizhou
@ 2024-01-23  8:46 ` Christoph Hellwig
  2024-02-05 17:16 ` Jens Axboe
  1 sibling, 0 replies; 3+ messages in thread
From: Christoph Hellwig @ 2024-01-23  8:46 UTC (permalink / raw)
  To: Tang Yizhou; +Cc: tj, axboe, linux-block, cgroups, linux-kernel, chunguang.xu

Looks good:

Reviewed-by: Christoph Hellwig <hch@lst.de>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] blk-throttle: Eliminate redundant checks for data direction
  2024-01-23  8:12 [PATCH] blk-throttle: Eliminate redundant checks for data direction Tang Yizhou
  2024-01-23  8:46 ` Christoph Hellwig
@ 2024-02-05 17:16 ` Jens Axboe
  1 sibling, 0 replies; 3+ messages in thread
From: Jens Axboe @ 2024-02-05 17:16 UTC (permalink / raw)
  To: tj, Tang Yizhou; +Cc: linux-block, cgroups, linux-kernel, chunguang.xu


On Tue, 23 Jan 2024 16:12:48 +0800, Tang Yizhou wrote:
> After calling throtl_peek_queued(), the data direction can be determined so
> there is no need to call bio_data_dir() to check the direction again.
> 
> 

Applied, thanks!

[1/1] blk-throttle: Eliminate redundant checks for data direction
      commit: 3bca7640b4c50621b94365a1746f4b86116fec56

Best regards,
-- 
Jens Axboe




^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-02-05 17:16 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-01-23  8:12 [PATCH] blk-throttle: Eliminate redundant checks for data direction Tang Yizhou
2024-01-23  8:46 ` Christoph Hellwig
2024-02-05 17:16 ` 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).