public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [RFC PATCHv2] block: set bdi congested when no tag available
@ 2022-06-16 12:30 zhaoyang.huang
  2022-06-16 15:27 ` Jens Axboe
  0 siblings, 1 reply; 3+ messages in thread
From: zhaoyang.huang @ 2022-06-16 12:30 UTC (permalink / raw)
  To: Jens Axboe, Mel Gorman, Zhaoyang Huang, linux-block, linux-kernel,
	ke.wang

From: Zhaoyang Huang <zhaoyang.huang@unisoc.com>

In previous version, block layer will set bdi to be congested when
get_request fail, which may throttle direct_reclaim. Move them back
under current blk-mq design.

Signed-off-by: Zhaoyang Huang <zhaoyang.huang@unisoc.com>
---
v2: simplify the code
---
---
 block/blk-mq-tag.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/block/blk-mq-tag.c b/block/blk-mq-tag.c
index 995336a..0cbc445 100644
--- a/block/blk-mq-tag.c
+++ b/block/blk-mq-tag.c
@@ -11,6 +11,7 @@
 
 #include <linux/blk-mq.h>
 #include <linux/delay.h>
+#include <linux/backing-dev.h>
 #include "blk.h"
 #include "blk-mq.h"
 #include "blk-mq-sched.h"
@@ -126,6 +127,8 @@ unsigned int blk_mq_get_tag(struct blk_mq_alloc_data *data)
 	if (tag != BLK_MQ_NO_TAG)
 		goto found_tag;
 
+	set_bdi_congested(data->q->disk->bdi,BLK_RW_SYNC);
+	set_bdi_congested(data->q->disk->bdi,BLK_RW_ASYNC);
 	if (data->flags & BLK_MQ_REQ_NOWAIT)
 		return BLK_MQ_NO_TAG;
 
@@ -190,6 +193,8 @@ unsigned int blk_mq_get_tag(struct blk_mq_alloc_data *data)
 		blk_mq_put_tag(tags, data->ctx, tag + tag_offset);
 		return BLK_MQ_NO_TAG;
 	}
+	clear_bdi_congested(data->q->disk->bdi,BLK_RW_SYNC);
+	clear_bdi_congested(data->q->disk->bdi,BLK_RW_ASYNC);
 	return tag + tag_offset;
 }
 
-- 
1.9.1


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

* Re: [RFC PATCHv2] block: set bdi congested when no tag available
  2022-06-16 12:30 [RFC PATCHv2] block: set bdi congested when no tag available zhaoyang.huang
@ 2022-06-16 15:27 ` Jens Axboe
  2022-06-17  6:45   ` 答复: " 黄朝阳 (Zhaoyang Huang)
  0 siblings, 1 reply; 3+ messages in thread
From: Jens Axboe @ 2022-06-16 15:27 UTC (permalink / raw)
  To: zhaoyang.huang, Mel Gorman, Zhaoyang Huang, linux-block,
	linux-kernel, ke.wang

On 6/16/22 6:30 AM, zhaoyang.huang wrote:
> From: Zhaoyang Huang <zhaoyang.huang@unisoc.com>
> 
> In previous version, block layer will set bdi to be congested when
> get_request fail, which may throttle direct_reclaim. Move them back
> under current blk-mq design.

bdi congestion doesn't exist anymore, not sure what this patch is
against?

-- 
Jens Axboe


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

* 答复: [RFC PATCHv2] block: set bdi congested when no tag available
  2022-06-16 15:27 ` Jens Axboe
@ 2022-06-17  6:45   ` 黄朝阳 (Zhaoyang Huang)
  0 siblings, 0 replies; 3+ messages in thread
From: 黄朝阳 (Zhaoyang Huang) @ 2022-06-17  6:45 UTC (permalink / raw)
  To: Jens Axboe, Mel Gorman, Zhaoyang Huang,
	linux-block@vger.kernel.org, linux-kernel@vger.kernel.org,
	王科 (Ke Wang)



On 6/16/22 6:30 AM, zhaoyang.huang wrote:
> From: Zhaoyang Huang <zhaoyang.huang@unisoc.com>
>
> In previous version, block layer will set bdi to be congested when
> get_request fail, which may throttle direct_reclaim. Move them back
> under current blk-mq design.

bdi congestion doesn't exist anymore, not sure what this patch is
against?

ok. What i am trying to solve is introducing reclaim throttle when excessive number of IOs consume all tags on hwctx. It is could be introduced by page thrashing or access of mapped lib files. 
--
Jens Axboe


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

end of thread, other threads:[~2022-06-17  6:46 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-06-16 12:30 [RFC PATCHv2] block: set bdi congested when no tag available zhaoyang.huang
2022-06-16 15:27 ` Jens Axboe
2022-06-17  6:45   ` 答复: " 黄朝阳 (Zhaoyang Huang)

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox