* [PATCH V2 1/1] md/raid0, raid10: Don't set discard sectors for request queue
@ 2022-11-02 2:07 Xiao Ni
2022-11-02 2:16 ` Ming Lei
0 siblings, 1 reply; 3+ messages in thread
From: Xiao Ni @ 2022-11-02 2:07 UTC (permalink / raw)
To: song; +Cc: yi.zhang, ming.lei, ncroxon, linux-raid
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
like this:
[ 4616.022599] ------------[ cut here ]------------
[ 4616.027779] WARNING: CPU: 4 PID: 99634 at block/blk-lib.c:50 __blkdev_issue_discard+0x16a/0x1a0
[ 4616.140663] RIP: 0010:__blkdev_issue_discard+0x16a/0x1a0
[ 4616.146601] Code: 24 4c 89 20 31 c0 e9 fe fe ff ff c1 e8 09 8d 48 ff 4c 89 f0 4c 09 e8 48 85 c1 0f 84 55 ff ff ff b8 ea ff ff ff e9 df fe ff ff <0f> 0b 48 8d 74 24 08 e8 ea d6 00 00 48 c7 c6 20 1e 89 ab 48 c7 c7
[ 4616.167567] RSP: 0018:ffffaab88cbffca8 EFLAGS: 00010246
[ 4616.173406] RAX: ffff9ba1f9e44678 RBX: 0000000000000000 RCX: ffff9ba1c9792080
[ 4616.181376] RDX: 0000000000000000 RSI: 0000000000000000 RDI: ffff9ba1c9792080
[ 4616.189345] RBP: 0000000000000cc0 R08: ffffaab88cbffd10 R09: 0000000000000000
[ 4616.197317] R10: 0000000000000012 R11: 0000000000000000 R12: 0000000000000000
[ 4616.205288] R13: 0000000000400000 R14: 0000000000000cc0 R15: ffff9ba1c9792080
[ 4616.213259] FS: 00007f9a5534e980(0000) GS:ffff9ba1b7c80000(0000) knlGS:0000000000000000
[ 4616.222298] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[ 4616.228719] CR2: 000055a390a4c518 CR3: 0000000123e40006 CR4: 00000000001706e0
[ 4616.236689] Call Trace:
[ 4616.239428] blkdev_issue_discard+0x52/0xb0
[ 4616.244108] blkdev_common_ioctl+0x43c/0xa00
[ 4616.248883] blkdev_ioctl+0x116/0x280
[ 4616.252977] __x64_sys_ioctl+0x8a/0xc0
[ 4616.257163] do_syscall_64+0x5c/0x90
[ 4616.261164] ? handle_mm_fault+0xc5/0x2a0
[ 4616.265652] ? do_user_addr_fault+0x1d8/0x690
[ 4616.270527] ? do_syscall_64+0x69/0x90
[ 4616.274717] ? exc_page_fault+0x62/0x150
[ 4616.279097] entry_SYSCALL_64_after_hwframe+0x63/0xcd
[ 4616.284748] RIP: 0033:0x7f9a55398c6b
Signed-off-by: Xiao Ni <xni@redhat.com>
Reported-by: Yi Zhang <yi.zhang@redhat.com>
---
v2: Modify title and add warning calltrace
drivers/md/raid0.c | 1 -
drivers/md/raid10.c | 2 --
2 files changed, 3 deletions(-)
diff --git a/drivers/md/raid0.c b/drivers/md/raid0.c
index aced0ad8cdab..9d4831ca802c 100644
--- a/drivers/md/raid0.c
+++ b/drivers/md/raid0.c
@@ -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,
diff --git a/drivers/md/raid10.c b/drivers/md/raid10.c
index 3aa8b6e11d58..9a6503f5cb98 100644
--- a/drivers/md/raid10.c
+++ b/drivers/md/raid10.c
@@ -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)
^ permalink raw reply related [flat|nested] 3+ messages in thread* Re: [PATCH V2 1/1] md/raid0, raid10: Don't set discard sectors for request queue
2022-11-02 2:07 [PATCH V2 1/1] md/raid0, raid10: Don't set discard sectors for request queue Xiao Ni
@ 2022-11-02 2:16 ` Ming Lei
2022-11-04 17:51 ` Song Liu
0 siblings, 1 reply; 3+ messages in thread
From: Ming Lei @ 2022-11-02 2:16 UTC (permalink / raw)
To: Xiao Ni; +Cc: song, yi.zhang, ncroxon, linux-raid
On Wed, Nov 2, 2022 at 10:07 AM Xiao Ni <xni@redhat.com> wrote:
>
> 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
> like this:
>
> [ 4616.022599] ------------[ cut here ]------------
> [ 4616.027779] WARNING: CPU: 4 PID: 99634 at block/blk-lib.c:50 __blkdev_issue_discard+0x16a/0x1a0
> [ 4616.140663] RIP: 0010:__blkdev_issue_discard+0x16a/0x1a0
> [ 4616.146601] Code: 24 4c 89 20 31 c0 e9 fe fe ff ff c1 e8 09 8d 48 ff 4c 89 f0 4c 09 e8 48 85 c1 0f 84 55 ff ff ff b8 ea ff ff ff e9 df fe ff ff <0f> 0b 48 8d 74 24 08 e8 ea d6 00 00 48 c7 c6 20 1e 89 ab 48 c7 c7
> [ 4616.167567] RSP: 0018:ffffaab88cbffca8 EFLAGS: 00010246
> [ 4616.173406] RAX: ffff9ba1f9e44678 RBX: 0000000000000000 RCX: ffff9ba1c9792080
> [ 4616.181376] RDX: 0000000000000000 RSI: 0000000000000000 RDI: ffff9ba1c9792080
> [ 4616.189345] RBP: 0000000000000cc0 R08: ffffaab88cbffd10 R09: 0000000000000000
> [ 4616.197317] R10: 0000000000000012 R11: 0000000000000000 R12: 0000000000000000
> [ 4616.205288] R13: 0000000000400000 R14: 0000000000000cc0 R15: ffff9ba1c9792080
> [ 4616.213259] FS: 00007f9a5534e980(0000) GS:ffff9ba1b7c80000(0000) knlGS:0000000000000000
> [ 4616.222298] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
> [ 4616.228719] CR2: 000055a390a4c518 CR3: 0000000123e40006 CR4: 00000000001706e0
> [ 4616.236689] Call Trace:
> [ 4616.239428] blkdev_issue_discard+0x52/0xb0
> [ 4616.244108] blkdev_common_ioctl+0x43c/0xa00
> [ 4616.248883] blkdev_ioctl+0x116/0x280
> [ 4616.252977] __x64_sys_ioctl+0x8a/0xc0
> [ 4616.257163] do_syscall_64+0x5c/0x90
> [ 4616.261164] ? handle_mm_fault+0xc5/0x2a0
> [ 4616.265652] ? do_user_addr_fault+0x1d8/0x690
> [ 4616.270527] ? do_syscall_64+0x69/0x90
> [ 4616.274717] ? exc_page_fault+0x62/0x150
> [ 4616.279097] entry_SYSCALL_64_after_hwframe+0x63/0xcd
> [ 4616.284748] RIP: 0033:0x7f9a55398c6b
>
> Signed-off-by: Xiao Ni <xni@redhat.com>
> Reported-by: Yi Zhang <yi.zhang@redhat.com>
Reviewed-by: Ming Lei <ming.lei@redhat.com>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH V2 1/1] md/raid0, raid10: Don't set discard sectors for request queue
2022-11-02 2:16 ` Ming Lei
@ 2022-11-04 17:51 ` Song Liu
0 siblings, 0 replies; 3+ messages in thread
From: Song Liu @ 2022-11-04 17:51 UTC (permalink / raw)
To: Ming Lei; +Cc: Xiao Ni, yi.zhang, ncroxon, linux-raid
On Tue, Nov 1, 2022 at 7:16 PM Ming Lei <ming.lei@redhat.com> wrote:
>
> On Wed, Nov 2, 2022 at 10:07 AM Xiao Ni <xni@redhat.com> wrote:
> >
> > 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
> > like this:
> >
> > [ 4616.022599] ------------[ cut here ]------------
> > [ 4616.027779] WARNING: CPU: 4 PID: 99634 at block/blk-lib.c:50 __blkdev_issue_discard+0x16a/0x1a0
> > [ 4616.140663] RIP: 0010:__blkdev_issue_discard+0x16a/0x1a0
> > [ 4616.146601] Code: 24 4c 89 20 31 c0 e9 fe fe ff ff c1 e8 09 8d 48 ff 4c 89 f0 4c 09 e8 48 85 c1 0f 84 55 ff ff ff b8 ea ff ff ff e9 df fe ff ff <0f> 0b 48 8d 74 24 08 e8 ea d6 00 00 48 c7 c6 20 1e 89 ab 48 c7 c7
> > [ 4616.167567] RSP: 0018:ffffaab88cbffca8 EFLAGS: 00010246
> > [ 4616.173406] RAX: ffff9ba1f9e44678 RBX: 0000000000000000 RCX: ffff9ba1c9792080
> > [ 4616.181376] RDX: 0000000000000000 RSI: 0000000000000000 RDI: ffff9ba1c9792080
> > [ 4616.189345] RBP: 0000000000000cc0 R08: ffffaab88cbffd10 R09: 0000000000000000
> > [ 4616.197317] R10: 0000000000000012 R11: 0000000000000000 R12: 0000000000000000
> > [ 4616.205288] R13: 0000000000400000 R14: 0000000000000cc0 R15: ffff9ba1c9792080
> > [ 4616.213259] FS: 00007f9a5534e980(0000) GS:ffff9ba1b7c80000(0000) knlGS:0000000000000000
> > [ 4616.222298] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
> > [ 4616.228719] CR2: 000055a390a4c518 CR3: 0000000123e40006 CR4: 00000000001706e0
> > [ 4616.236689] Call Trace:
> > [ 4616.239428] blkdev_issue_discard+0x52/0xb0
> > [ 4616.244108] blkdev_common_ioctl+0x43c/0xa00
> > [ 4616.248883] blkdev_ioctl+0x116/0x280
> > [ 4616.252977] __x64_sys_ioctl+0x8a/0xc0
> > [ 4616.257163] do_syscall_64+0x5c/0x90
> > [ 4616.261164] ? handle_mm_fault+0xc5/0x2a0
> > [ 4616.265652] ? do_user_addr_fault+0x1d8/0x690
> > [ 4616.270527] ? do_syscall_64+0x69/0x90
> > [ 4616.274717] ? exc_page_fault+0x62/0x150
> > [ 4616.279097] entry_SYSCALL_64_after_hwframe+0x63/0xcd
> > [ 4616.284748] RIP: 0033:0x7f9a55398c6b
> >
> > Signed-off-by: Xiao Ni <xni@redhat.com>
> > Reported-by: Yi Zhang <yi.zhang@redhat.com>
>
> Reviewed-by: Ming Lei <ming.lei@redhat.com>
Applied to md-next.
Thanks,
Song
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2022-11-04 17:51 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-11-02 2:07 [PATCH V2 1/1] md/raid0, raid10: Don't set discard sectors for request queue Xiao Ni
2022-11-02 2:16 ` Ming Lei
2022-11-04 17:51 ` Song Liu
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox