* [PATCH 1/2] loop: remove a pointless blk_queue_max_hw_sectors call
@ 2023-12-26 9:14 Christoph Hellwig
2023-12-26 9:14 ` [PATCH 2/2] loop: don't update discard limits from loop_set_status Christoph Hellwig
2023-12-26 9:38 ` [PATCH 1/2] loop: remove a pointless blk_queue_max_hw_sectors call Yu Kuai
0 siblings, 2 replies; 4+ messages in thread
From: Christoph Hellwig @ 2023-12-26 9:14 UTC (permalink / raw)
To: axboe; +Cc: linux-block
BLK_DEF_MAX_SECTORS is (as the name implies) already the default.
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
drivers/block/loop.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/drivers/block/loop.c b/drivers/block/loop.c
index 5bc2b4fcfa772d..371a318e691d02 100644
--- a/drivers/block/loop.c
+++ b/drivers/block/loop.c
@@ -2038,8 +2038,6 @@ static int loop_add(int i)
}
lo->lo_queue = lo->lo_disk->queue;
- blk_queue_max_hw_sectors(lo->lo_queue, BLK_DEF_MAX_SECTORS);
-
/*
* By default, we do buffer IO, so it doesn't make sense to enable
* merge because the I/O submitted to backing file is handled page by
--
2.39.2
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH 2/2] loop: don't update discard limits from loop_set_status
2023-12-26 9:14 [PATCH 1/2] loop: remove a pointless blk_queue_max_hw_sectors call Christoph Hellwig
@ 2023-12-26 9:14 ` Christoph Hellwig
2023-12-26 9:38 ` [PATCH 1/2] loop: remove a pointless blk_queue_max_hw_sectors call Yu Kuai
1 sibling, 0 replies; 4+ messages in thread
From: Christoph Hellwig @ 2023-12-26 9:14 UTC (permalink / raw)
To: axboe; +Cc: linux-block
loop_set_status doesn't change anything relevant to the discard and
write_zeroes setting, so don't bother calling loop_config_discard.
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
drivers/block/loop.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/drivers/block/loop.c b/drivers/block/loop.c
index 371a318e691d02..794bc92da165c3 100644
--- a/drivers/block/loop.c
+++ b/drivers/block/loop.c
@@ -1303,8 +1303,6 @@ loop_set_status(struct loop_device *lo, const struct loop_info64 *info)
loop_set_size(lo, new_size);
}
- loop_config_discard(lo);
-
/* update dio if lo_offset or transfer is changed */
__loop_update_dio(lo, lo->use_dio);
--
2.39.2
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH 1/2] loop: remove a pointless blk_queue_max_hw_sectors call
2023-12-26 9:14 [PATCH 1/2] loop: remove a pointless blk_queue_max_hw_sectors call Christoph Hellwig
2023-12-26 9:14 ` [PATCH 2/2] loop: don't update discard limits from loop_set_status Christoph Hellwig
@ 2023-12-26 9:38 ` Yu Kuai
2023-12-27 8:19 ` Christoph Hellwig
1 sibling, 1 reply; 4+ messages in thread
From: Yu Kuai @ 2023-12-26 9:38 UTC (permalink / raw)
To: Christoph Hellwig, axboe; +Cc: linux-block, yukuai (C)
Hi,
在 2023/12/26 17:14, Christoph Hellwig 写道:
> BLK_DEF_MAX_SECTORS is (as the name implies) already the default.
Looks like this not true. From blk_set_default_limits():
lim->max_sectors = lim->max_hw_sectors = BLK_SAFE_MAX_SECTORS;
So, the default is not BLK_DEF_MAX_SECTORS. Or am I missing something?
Thanks,
Kuai
>
> Signed-off-by: Christoph Hellwig <hch@lst.de>
> ---
> drivers/block/loop.c | 2 --
> 1 file changed, 2 deletions(-)
>
> diff --git a/drivers/block/loop.c b/drivers/block/loop.c
> index 5bc2b4fcfa772d..371a318e691d02 100644
> --- a/drivers/block/loop.c
> +++ b/drivers/block/loop.c
> @@ -2038,8 +2038,6 @@ static int loop_add(int i)
> }
> lo->lo_queue = lo->lo_disk->queue;
>
> - blk_queue_max_hw_sectors(lo->lo_queue, BLK_DEF_MAX_SECTORS);
> -
> /*
> * By default, we do buffer IO, so it doesn't make sense to enable
> * merge because the I/O submitted to backing file is handled page by
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH 1/2] loop: remove a pointless blk_queue_max_hw_sectors call
2023-12-26 9:38 ` [PATCH 1/2] loop: remove a pointless blk_queue_max_hw_sectors call Yu Kuai
@ 2023-12-27 8:19 ` Christoph Hellwig
0 siblings, 0 replies; 4+ messages in thread
From: Christoph Hellwig @ 2023-12-27 8:19 UTC (permalink / raw)
To: Yu Kuai; +Cc: Christoph Hellwig, axboe, linux-block, yukuai (C)
On Tue, Dec 26, 2023 at 05:38:31PM +0800, Yu Kuai wrote:
> Hi,
>
> 在 2023/12/26 17:14, Christoph Hellwig 写道:
>> BLK_DEF_MAX_SECTORS is (as the name implies) already the default.
>
> Looks like this not true. From blk_set_default_limits():
>
> lim->max_sectors = lim->max_hw_sectors = BLK_SAFE_MAX_SECTORS;
>
> So, the default is not BLK_DEF_MAX_SECTORS. Or am I missing something?
No, you're not. The naming and our code is just a desaster..
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2023-12-27 8:19 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-12-26 9:14 [PATCH 1/2] loop: remove a pointless blk_queue_max_hw_sectors call Christoph Hellwig
2023-12-26 9:14 ` [PATCH 2/2] loop: don't update discard limits from loop_set_status Christoph Hellwig
2023-12-26 9:38 ` [PATCH 1/2] loop: remove a pointless blk_queue_max_hw_sectors call Yu Kuai
2023-12-27 8:19 ` Christoph Hellwig
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox