Don't set discard sectors for request queue
PATCH 1/1 Don't set discard sectors for request queue
It should use disk_stack_limits to get a proper max_discard_sectors rather than setting a value by stack drivers.
And there is a bug. If all member disks are rotational devices, raid0/raid10 set max_discard_sectors. So the member devices are not ssd/nvme, but raid0/raid10 export the wrong value. It reports warning messages in function __blkdev_issue_discard when mkfs.xfs
--- drivers/md/raid0.c | 1 - drivers/md/raid10.c | 2 -- 2 files changed, 3 deletions(-)
drivers/md/raid0.c +0 -1
@@ -398,7 +398,6 @@ static int raid0_run(struct mddev *mddev)blk_queue_max_hw_sectors (mddev->queue, mddev->chunk_sectors);blk_queue_max_write_zeroes_sectors (mddev->queue, mddev->chunk_sectors); -blk_queue_max_discard_sectors (mddev->queue,UINT_MAX );blk_queue_io_min (mddev->queue, mddev->chunk_sectors <<9 ); blk_queue_io_opt(mddev->queue,
drivers/md/raid10.c +0 -2
@@ -4145,8 +4145,6 @@ static int raid10_run(struct mddev *mddev) conf->thread =NULL ;if (mddev->queue) { -blk_queue_max_discard_sectors (mddev->queue, -UINT_MAX );blk_queue_max_write_zeroes_sectors (mddev->queue,0 );blk_queue_io_min (mddev->queue, mddev->chunk_sectors <<9 );raid10_set_io_opt (conf);
Signature · 1 line
2.32.0 (Apple Git-132)
Song Liu
maintainerOn Mon, Oct 31, 2022 at 10:08 PM Xiao Ni <[email protected]> wrote:
Please update the subject as md/raid0, raid10: xxx.
Quoted 8 lines
It should use
disk_stack_limitsto get a propermax_discard_sectorsrather than setting a value by stack drivers.And there is a bug. If all member disks are rotational devices, raid0/raid10 set
max_discard_sectors. So the member devices are not ssd/nvme, but raid0/raid10 export the wrong value. It reports warning messages in function__blkdev_issue_discardwhen mkfs.xfs
Please provide more information about this bug: the warning message, the impact, etc. in the commit log.
Quoted 3 lines
Signed-off-by Xiao Ni <[email protected]>Reported-by Yi Zhang <[email protected]>
Thanks,
Song
Quoted 33 lines
--- drivers/md/raid0.c | 1 - drivers/md/raid10.c | 2 -- 2 files changed, 3 deletions(-)drivers/md/raid0.c +0
-1@@ -398,7 +398,6 @@ static int raid0_run(struct mddev *mddev)blk_queue_max_hw_sectors (mddev->queue, mddev->chunk_sectors);blk_queue_max_write_zeroes_sectors (mddev->queue, mddev->chunk_sectors); -blk_queue_max_discard_sectors (mddev->queue,UINT_MAX );blk_queue_io_min (mddev->queue, mddev->chunk_sectors <<9 ); blk_queue_io_opt(mddev->queue,drivers/md/raid10.c +0
-3@@ -4145,8 +4145,6 @@ static int raid10_run(struct mddev *mddev) conf->thread =NULL ;if (mddev->queue) { -blk_queue_max_discard_sectors (mddev->queue, -UINT_MAX );blk_queue_max_write_zeroes_sectors (mddev->queue,0 );blk_queue_io_min (mddev->queue, mddev->chunk_sectors <<9 );raid10_set_io_opt (conf); --2.32.0 (Apple Git-132)
Quoted 4 lines · Song Liu
On Mon, Oct 31, 2022 at 10:08 PM Xiao Ni <[email protected]> wrote:
Please update the subject as md/raid0, raid10: xxx.
Sorry for forgetting about this again.
Quoted 5 lines
Quoted 5 lines
It should use
disk_stack_limitsto get a propermax_discard_sectorsrather than setting a value by stack drivers.
Quoted 7 lines
Quoted 4 lines
And there is a bug. If all member disks are rotational devices, raid0/raid10 set
max_discard_sectors. So the member devices are not ssd/nvme, but raid0/raid10 export the wrong value. It reports warning messages in function__blkdev_issue_discardwhen mkfs.xfsPlease provide more information about this bug: the warning message, the impact, etc. in the commit log.
I remember we need to obey a rule to paste the warning/panic messages, right? If so, can you tell the position again? I use the keyword "warning/panic/calltrace"
to search in file process/submitting-patches.rst and can't find the useful information.
Or it just needs to paste the calltraces in the patch?
Regards
Xiao
Quoted 42 lines
Quoted 4 lines
Signed-off-by Xiao Ni <[email protected]>Reported-by Yi Zhang <[email protected]>Thanks,
SongQuoted 33 lines
--- drivers/md/raid0.c | 1 - drivers/md/raid10.c | 2 -- 2 files changed, 3 deletions(-)drivers/md/raid0.c +0
-1@@ -398,7 +398,6 @@ static int raid0_run(struct mddev *mddev)blk_queue_max_hw_sectors (mddev->queue, mddev->chunk_sectors);blk_queue_max_write_zeroes_sectors (mddev->queue, mddev->chunk_sectors); -blk_queue_max_discard_sectors (mddev->queue,UINT_MAX );blk_queue_io_min (mddev->queue, mddev->chunk_sectors <<9 ); blk_queue_io_opt(mddev->queue,drivers/md/raid10.c +0
-3@@ -4145,8 +4145,6 @@ static int raid10_run(struct mddev *mddev) conf->thread =NULL ;if (mddev->queue) { -blk_queue_max_discard_sectors (mddev->queue, -UINT_MAX );blk_queue_max_write_zeroes_sectors (mddev->queue,0 );blk_queue_io_min (mddev->queue, mddev->chunk_sectors <<9 );raid10_set_io_opt (conf); --2.32.0 (Apple Git-132)
Song Liu
maintainerQuoted 22 lines · Xiao Ni
Quoted 4 lines · Song Liu
On Mon, Oct 31, 2022 at 10:08 PM Xiao Ni <[email protected]> wrote:
Please update the subject as md/raid0, raid10: xxx.
Sorry for forgetting about this again.
Quoted 5 lines
Quoted 5 lines
It should use
disk_stack_limitsto get a propermax_discard_sectorsrather than setting a value by stack drivers.Quoted 7 lines
Quoted 4 lines
And there is a bug. If all member disks are rotational devices, raid0/raid10 set
max_discard_sectors. So the member devices are not ssd/nvme, but raid0/raid10 export the wrong value. It reports warning messages in function__blkdev_issue_discardwhen mkfs.xfsPlease provide more information about this bug: the warning message, the impact, etc. in the commit log.
Quoted 6 lines
I remember we need to obey a rule to paste the warning/panic messages, right? If so, can you tell the position again? I use the keyword "warning/panic/calltrace"
to search in fileprocess/submitting-patches.rstand can't find the useful information.
Or it just needs to paste the calltraces in the patch?
I think we can just paste the call trace in the commit log.
Thanks,
Song