[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZIOE2ASeUAXxzpRO@redhat.com>
Date: Fri, 9 Jun 2023 16:00:24 -0400
From: Mike Snitzer <snitzer@...nel.org>
To: Sarthak Kukreti <sarthakkukreti@...omium.org>
Cc: dm-devel@...hat.com, linux-block@...r.kernel.org,
linux-ext4@...r.kernel.org, linux-kernel@...r.kernel.org,
linux-fsdevel@...r.kernel.org, Jens Axboe <axboe@...nel.dk>,
"Michael S. Tsirkin" <mst@...hat.com>,
Jason Wang <jasowang@...hat.com>,
Stefan Hajnoczi <stefanha@...hat.com>,
Alasdair Kergon <agk@...hat.com>,
Christoph Hellwig <hch@...radead.org>,
Brian Foster <bfoster@...hat.com>,
Theodore Ts'o <tytso@....edu>,
Andreas Dilger <adilger.kernel@...ger.ca>,
Bart Van Assche <bvanassche@...gle.com>,
"Darrick J. Wong" <djwong@...nel.org>
Subject: Re: [PATCH v7 2/5] block: Introduce provisioning primitives
On Thu, May 18 2023 at 6:33P -0400,
Sarthak Kukreti <sarthakkukreti@...omium.org> wrote:
> Introduce block request REQ_OP_PROVISION. The intent of this request
> is to request underlying storage to preallocate disk space for the given
> block range. Block devices that support this capability will export
> a provision limit within their request queues.
>
> This patch also adds the capability to call fallocate() in mode 0
> on block devices, which will send REQ_OP_PROVISION to the block
> device for the specified range,
>
> Signed-off-by: Sarthak Kukreti <sarthakkukreti@...omium.org>
> ---
...
> diff --git a/block/blk-settings.c b/block/blk-settings.c
> index 896b4654ab00..d303e6614c36 100644
> --- a/block/blk-settings.c
> +++ b/block/blk-settings.c
> @@ -59,6 +59,7 @@ void blk_set_default_limits(struct queue_limits *lim)
> lim->zoned = BLK_ZONED_NONE;
> lim->zone_write_granularity = 0;
> lim->dma_alignment = 511;
> + lim->max_provision_sectors = 0;
> }
>
> /**
> @@ -82,6 +83,7 @@ void blk_set_stacking_limits(struct queue_limits *lim)
> lim->max_dev_sectors = UINT_MAX;
> lim->max_write_zeroes_sectors = UINT_MAX;
> lim->max_zone_append_sectors = UINT_MAX;
> + lim->max_provision_sectors = UINT_MAX;
> }
> EXPORT_SYMBOL(blk_set_stacking_limits);
>
> @@ -578,6 +594,9 @@ int blk_stack_limits(struct queue_limits *t, struct queue_limits *b,
> t->max_segment_size = min_not_zero(t->max_segment_size,
> b->max_segment_size);
>
> + t->max_provision_sectors = min_not_zero(t->max_provision_sectors,
> + b->max_provision_sectors);
> +
This needs to use min() since max_provision_sectors also serves to
indicate if the device supports REQ_OP_PROVISION. Otherwise, if I set
max_provision_sectors to 0 on a dm thin-pool the blk_stack_limits()
will ignore my having set it to 0 (to disable) and it'll remain as
UINT_MAX (thanks to blk_set_default_limits).
Mike
Powered by blists - more mailing lists