diff mbox series

[2/2] md: bypass block throttle for superblock update

Message ID 20231107175736.47522-2-junxiao.bi@oracle.com (mailing list archive)
State Superseded, archived
Headers show
Series [1/2] Revert "md/raid5: Wait for MD_SB_CHANGE_PENDING in raid5d" | expand

Commit Message

Junxiao Bi Nov. 7, 2023, 5:57 p.m. UTC
commit 5e2cf333b7bd ("md/raid5: Wait for MD_SB_CHANGE_PENDING in raid5d")
introduced a hung bug and got reverted in last patch, since the issue
that commit is fixing is due to md superblock write is throttled by wbt,
to fix it, we can have superblock write bypass block layer throttle.

Fixes: 5e2cf333b7bd ("md/raid5: Wait for MD_SB_CHANGE_PENDING in raid5d")
Suggested-by: Yu Kuai <yukuai1@huaweicloud.com>
Signed-off-by: Junxiao Bi <junxiao.bi@oracle.com>
---
 drivers/md/md.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

Comments

Logan Gunthorpe Nov. 7, 2023, 7:33 p.m. UTC | #1
On 2023-11-07 10:57, Junxiao Bi wrote:
> commit 5e2cf333b7bd ("md/raid5: Wait for MD_SB_CHANGE_PENDING in raid5d")
> introduced a hung bug and got reverted in last patch, since the issue
> that commit is fixing is due to md superblock write is throttled by wbt,
> to fix it, we can have superblock write bypass block layer throttle.
> 
> Fixes: 5e2cf333b7bd ("md/raid5: Wait for MD_SB_CHANGE_PENDING in raid5d")
> Suggested-by: Yu Kuai <yukuai1@huaweicloud.com>
> Signed-off-by: Junxiao Bi <junxiao.bi@oracle.com>

This makes sense to me. However, I haven't looked at that bug in a long
time though and I haven't tested the proposed solution to ensure the bug
is indeed fixed.

Would it not make sense to have the fixing commit first before the
revert? So there isn't a spot in the history with a known bug?

Besides that,

Reviewed-by: Logan Gunthorpe <logang@deltatee.com>

Thanks!

Logan
Junxiao Bi Nov. 7, 2023, 9:11 p.m. UTC | #2
On 11/7/23 11:33 AM, Logan Gunthorpe wrote:

>
> On 2023-11-07 10:57, Junxiao Bi wrote:
>> commit 5e2cf333b7bd ("md/raid5: Wait for MD_SB_CHANGE_PENDING in raid5d")
>> introduced a hung bug and got reverted in last patch, since the issue
>> that commit is fixing is due to md superblock write is throttled by wbt,
>> to fix it, we can have superblock write bypass block layer throttle.
>>
>> Fixes: 5e2cf333b7bd ("md/raid5: Wait for MD_SB_CHANGE_PENDING in raid5d")
>> Suggested-by: Yu Kuai <yukuai1@huaweicloud.com>
>> Signed-off-by: Junxiao Bi <junxiao.bi@oracle.com>
> This makes sense to me. However, I haven't looked at that bug in a long
> time though and I haven't tested the proposed solution to ensure the bug
> is indeed fixed.
>
> Would it not make sense to have the fixing commit first before the
> revert? So there isn't a spot in the history with a known bug?

Yea, that makes sense.

Thanks for the review.

>
> Besides that,
>
> Reviewed-by: Logan Gunthorpe <logang@deltatee.com>
>
> Thanks!
>
> Logan
diff mbox series

Patch

diff --git a/drivers/md/md.c b/drivers/md/md.c
index 4ee4593c874a..7a5a22097365 100644
--- a/drivers/md/md.c
+++ b/drivers/md/md.c
@@ -1013,9 +1013,10 @@  void md_super_write(struct mddev *mddev, struct md_rdev *rdev,
 		return;
 
 	bio = bio_alloc_bioset(rdev->meta_bdev ? rdev->meta_bdev : rdev->bdev,
-			       1,
-			       REQ_OP_WRITE | REQ_SYNC | REQ_PREFLUSH | REQ_FUA,
-			       GFP_NOIO, &mddev->sync_set);
+			      1,
+			      REQ_OP_WRITE | REQ_SYNC | REQ_IDLE | REQ_META
+				  | REQ_PREFLUSH | REQ_FUA,
+			      GFP_NOIO, &mddev->sync_set);
 
 	atomic_inc(&rdev->nr_pending);