From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E54BDC53210 for ; Thu, 29 Dec 2022 08:19:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233155AbiL2IS4 (ORCPT ); Thu, 29 Dec 2022 03:18:56 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37920 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233236AbiL2ISF (ORCPT ); Thu, 29 Dec 2022 03:18:05 -0500 Received: from mail-ed1-x52d.google.com (mail-ed1-x52d.google.com [IPv6:2a00:1450:4864:20::52d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1093613DCE for ; Thu, 29 Dec 2022 00:17:35 -0800 (PST) Received: by mail-ed1-x52d.google.com with SMTP id r26so20575126edc.5 for ; Thu, 29 Dec 2022 00:17:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=7n+B+X0KvL5FYpt4R5yWJ/ag0L0NLxa0tbY9qucKwuI=; b=aM/Ttwb0xqobbPsfNShnECgwZZ0RVTZPBATDxWKlrmgoYc131+i6w0GKSBj1PdVklm gbChCXaQ6kiGtiwXqjToSpSW7zNn+YGWX5SWfwTFn1L5KuHM7Q7U66SHcHp9Wg2KrYUe zxjDtJAp6e++CJq9Z/mH0g4XiyUZ6LJVU+4AY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=7n+B+X0KvL5FYpt4R5yWJ/ag0L0NLxa0tbY9qucKwuI=; b=H83CBPDtIx/C4MqOQDbhvneJ3Vo72zb0mv8pE6O92hurCUfghDkrwlWTbgRyuywHoW Wnmkxfiq60V7nlnLopQbr55DB2Z3NePjpDVrmhViHRhRpwoaeik+lARx6M8ZG0om6fN1 9EvnSbuBxqZja0R73v8Oi6O+JpnesdK7UkpuYCnwjR8f/DBzoX41S/899JcypD3jgdnc 1wPJOooL5I+mTSbmtD4Ml1V6C0n50k7o/oEvgvlib08HzpRpOGQBIr63M8lJhVjLA2rS BQGyt/R7CA+8I7WOtwRfALHop5+bBVGDPAsWAJl53gxuLmFFycn6bu2h52dTP3OtdygR /mPQ== X-Gm-Message-State: AFqh2kqz6HCG2Qei7am7EiZeFIfok+ePOLu74wuujAvTV0ufdQRZiIiS yt7ZRyg21a45X12/ZiHII9hd13FWOOwMZXTrRSjNYw== X-Google-Smtp-Source: AMrXdXulwl3zEgOGWwmMivflDb4UfyGNGI7lU4m/aeAvt/3L5Hf+inrJtG+WSFp0FPQl5mpy0l5FjfKOF5TBfRVSOU8= X-Received: by 2002:a50:fe17:0:b0:487:e554:31e8 with SMTP id f23-20020a50fe17000000b00487e55431e8mr670416edt.353.1672301854647; Thu, 29 Dec 2022 00:17:34 -0800 (PST) MIME-Version: 1.0 References: <20220915164826.1396245-1-sarthakkukreti@google.com> <20220915164826.1396245-2-sarthakkukreti@google.com> In-Reply-To: From: Sarthak Kukreti Date: Thu, 29 Dec 2022 00:17:23 -0800 Message-ID: Subject: Re: [PATCH RFC 1/8] block: Introduce provisioning primitives To: Mike Snitzer Cc: dm-devel@redhat.com, linux-block@vger.kernel.org, linux-ext4@vger.kernel.org, linux-kernel@vger.kernel.org, virtualization@lists.linux-foundation.org, Jens Axboe , "Michael S . Tsirkin" , Jason Wang , Paolo Bonzini , Stefan Hajnoczi , Alasdair Kergon , Mike Snitzer , "Theodore Ts'o" , Andreas Dilger , Bart Van Assche , Daniil Lunev , Evan Green , Gwendal Grignou Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Sep 23, 2022 at 8:15 AM Mike Snitzer wrote: > > On Thu, Sep 15 2022 at 12:48P -0400, > Sarthak Kukreti wrote: > > > From: Sarthak Kukreti > > > > 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 device that support this capability will export > > a provision limit within their request queues. > > > > Signed-off-by: Sarthak Kukreti > > --- > > block/blk-core.c | 5 ++++ > > block/blk-lib.c | 55 +++++++++++++++++++++++++++++++++++++++ > > block/blk-merge.c | 17 ++++++++++++ > > block/blk-settings.c | 19 ++++++++++++++ > > block/blk-sysfs.c | 8 ++++++ > > block/bounce.c | 1 + > > include/linux/bio.h | 6 +++-- > > include/linux/blk_types.h | 5 +++- > > include/linux/blkdev.h | 16 ++++++++++++ > > 9 files changed, 129 insertions(+), 3 deletions(-) > > > > diff --git a/block/blk-settings.c b/block/blk-settings.c > > index 8bb9eef5310e..be79ad68b330 100644 > > --- a/block/blk-settings.c > > +++ b/block/blk-settings.c > > @@ -57,6 +57,7 @@ void blk_set_default_limits(struct queue_limits *lim) > > lim->misaligned = 0; > > lim->zoned = BLK_ZONED_NONE; > > lim->zone_write_granularity = 0; > > + lim->max_provision_sectors = 0; > > } > > EXPORT_SYMBOL(blk_set_default_limits); > > > > @@ -81,6 +82,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); > > > > Please work through the blk_stack_limits() implementation too (simple > min_not_zero?). > (Sorry, I might have misunderstood what you meant) Doesn't the chunk at L572 handle this: @@ -572,6 +588,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); + t->misaligned |= b->misaligned;