Hi, Yongqiaong
貌似下边这个bugzilla链接写错了, bugzilla: https://gitee.com/openeuler/kernel/issues/I6HOKY https://gitee.com/openeuler/kernel/issues/I6HOKY
看上去应该是: https://gitee.com/openeuler/kernel/issues/I6LH5K
-Sang Lipeng
在 2023/3/8 22:08,“Yongqiang Liu”<liuyongqiang13@huawei.com mailto:liuyongqiang13@huawei.com> 写入:
此封邮件来自公司外部,除非您能判断发件人和知道邮件内容安全,否则请勿打开链接或者附件,如需帮助可将本封邮件转发上报至信息安全部进行判别(MailTo:anquan@jd.com mailto:anquan@jd.com)。 JD Security Tips: Please do not click on links or open attachments unless you trust the sender and know the content is safe.If you need help, you can forward this email to the Information Security Department for identification (MailTo: anquan@jd.com mailto:anquan@jd.com).
From: Yu Kuai <yukuai3@huawei.com mailto:yukuai3@huawei.com>
mainline inclusion from mainline-v6.2-rc1 commit 671fae5e51297fc76b3758ca2edd514858734a6a category: bugfix bugzilla: https://gitee.com/openeuler/kernel/issues/I6HOKY https://gitee.com/openeuler/kernel/issues/I6HOKY CVE: NA
Reference: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?h... https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?h=v6.2&id=671fae5e51297fc76b3758ca2edd514858734a6a
--------------------------------
Commit b5dc5d4d1f4f ("block,bfq: Disable writeback throttling") tries to disable wbt for bfq, it's done by calling wbt_disable_default() in bfq_init_queue(). However, wbt is still enabled if default elevator is bfq:
device_add_disk elevator_init_mq bfq_init_queue wbt_disable_default -> done nothing
blk_register_queue wbt_enable_default -> wbt is enabled
Fix the problem by adding a new flag ELEVATOR_FLAG_DISBALE_WBT, bfq will set the flag in bfq_init_queue, and following wbt_enable_default() won't enable wbt while the flag is set.
Signed-off-by: Yu Kuai <yukuai3@huawei.com mailto:yukuai3@huawei.com> Reviewed-by: Christoph Hellwig <hch@lst.de mailto:hch@lst.de> Link: https://lore.kernel.org/r/20221019121518.3865235-7-yukuai1@huaweicloud.com mailto:20221019121518.3865235-7-yukuai1@huaweicloud.com Signed-off-by: Jens Axboe <axboe@kernel.dk mailto:axboe@kernel.dk>
Conflict: block/bfq-iosched.c block/blk-wbt.c block/elevator.h
Signed-off-by: Li Lingfeng <lilingfeng3@huawei.com mailto:lilingfeng3@huawei.com> Reviewed-by: Hou Tao <houtao1@huawei.com mailto:houtao1@huawei.com> Signed-off-by: Yongqiang Liu <liuyongqiang13@huawei.com mailto:liuyongqiang13@huawei.com> --- block/blk-wbt.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-)
diff --git a/block/blk-wbt.c b/block/blk-wbt.c index 366d294a11ef..1a5ea2e0c055 100644 --- a/block/blk-wbt.c +++ b/block/blk-wbt.c @@ -711,11 +711,15 @@ void wbt_set_write_cache(struct request_queue *q, bool write_cache_on) */ void wbt_enable_default(struct request_queue *q) { - struct rq_qos *rqos = wbt_rq_qos(q); + struct rq_qos *rqos; + bool disable_flag = q->elevator && + !strcmp(q->elevator->type->elevator_name, "cfq");
/* Throttling already enabled? */ + rqos = wbt_rq_qos(q); if (rqos) { - if (RQWB(rqos)->enable_state == WBT_STATE_OFF_DEFAULT) + if (!disable_flag && + RQWB(rqos)->enable_state == WBT_STATE_OFF_DEFAULT) RQWB(rqos)->enable_state = WBT_STATE_ON_DEFAULT; return; } @@ -724,8 +728,9 @@ void wbt_enable_default(struct request_queue *q) if (!test_bit(QUEUE_FLAG_REGISTERED, &q->queue_flags)) return;
- if ((q->mq_ops && IS_ENABLED(CONFIG_BLK_WBT_MQ)) || - (q->request_fn && IS_ENABLED(CONFIG_BLK_WBT_SQ))) + if (((q->mq_ops && IS_ENABLED(CONFIG_BLK_WBT_MQ)) || + (q->request_fn && IS_ENABLED(CONFIG_BLK_WBT_SQ))) && + !disable_flag) wbt_init(q); } EXPORT_SYMBOL_GPL(wbt_enable_default); -- 2.25.1
_______________________________________________ Kernel mailing list -- kernel@openeuler.org mailto:kernel@openeuler.org To unsubscribe send an email to kernel-leave@openeuler.org mailto:kernel-leave@openeuler.org