Message ID | 20231226091405.206166-1-hch@lst.de (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | [1/2] loop: remove a pointless blk_queue_max_hw_sectors call | expand |
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 >
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..
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
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(-)