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 us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 62E34C6FA8B for ; Fri, 16 Sep 2022 08:45:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1663317905; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post; bh=3E4KExRIuO+iOb5UxsqYn9YUcmP/QlT21Hz2CgkEPNI=; b=V5MYP3TwKsFzdyvIBbGD+kHOG9ld/ObrvQuTjea6RwK+/5VTr32prTJxsIwXnrZdo5/SX2 xa/V6MaIRAY8jGuUoym+zQ6JkDJr/bkZasEi8EWa+rNjCrgWFFdtNuu/HwvA3noUmwlRJz HcWiHejsCeBHcUI85nGGGa9Luj0VvLw= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-292-1F2FwPhXOtSZlrt2oYrzzw-1; Fri, 16 Sep 2022 04:45:01 -0400 X-MC-Unique: 1F2FwPhXOtSZlrt2oYrzzw-1 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.rdu2.redhat.com [10.11.54.4]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id CC655862FE0; Fri, 16 Sep 2022 08:44:59 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id BC23F2087440; Fri, 16 Sep 2022 08:44:59 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 3B9D61947063; Fri, 16 Sep 2022 08:44:58 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 9A5421946586 for ; Fri, 16 Sep 2022 06:09:57 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 7BA96C15BB2; Fri, 16 Sep 2022 06:09:57 +0000 (UTC) Received: from localhost (unknown [10.39.192.86]) by smtp.corp.redhat.com (Postfix) with ESMTP id 46FC3C15BA4; Fri, 16 Sep 2022 06:09:56 +0000 (UTC) Date: Fri, 16 Sep 2022 07:09:55 +0100 From: Stefan Hajnoczi To: Sarthak Kukreti Message-ID: References: <20220915164826.1396245-1-sarthakkukreti@google.com> MIME-Version: 1.0 In-Reply-To: <20220915164826.1396245-1-sarthakkukreti@google.com> X-Scanned-By: MIMEDefang 3.1 on 10.11.54.8 X-Mailman-Approved-At: Fri, 16 Sep 2022 08:44:55 +0000 Subject: Re: [dm-devel] [PATCH RFC 0/8] Introduce provisioning primitives for thinly provisioned storage X-BeenThere: dm-devel@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: device-mapper development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jens Axboe , Gwendal Grignou , Theodore Ts'o , "Michael S . Tsirkin" , Jason Wang , Bart Van Assche , Mike Snitzer , linux-kernel@vger.kernel.org, virtualization@lists.linux-foundation.org, linux-block@vger.kernel.org, dm-devel@redhat.com, Andreas Dilger , Daniil Lunev , Paolo Bonzini , linux-ext4@vger.kernel.org, Evan Green , Alasdair Kergon Content-Type: multipart/mixed; boundary="===============2498237334590000574==" Errors-To: dm-devel-bounces@redhat.com Sender: "dm-devel" X-Scanned-By: MIMEDefang 3.1 on 10.11.54.4 --===============2498237334590000574== Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="w/wnRFkY16cMLsvF" Content-Disposition: inline --w/wnRFkY16cMLsvF Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Sep 15, 2022 at 09:48:18AM -0700, Sarthak Kukreti wrote: > From: Sarthak Kukreti >=20 > Hi, >=20 > This patch series is an RFC of a mechanism to pass through provision requ= ests on stacked thinly provisioned storage devices/filesystems. >=20 > The linux kernel provides several mechanisms to set up thinly provisioned= block storage abstractions (eg. dm-thin, loop devices over sparse files), = either directly as block devices or backing storage for filesystems. Curren= tly, short of writing data to either the device or filesystem, there is no = way for users to pre-allocate space for use in such storage setups. Conside= r the following use-cases: >=20 > 1) Suspend-to-disk and resume from a dm-thin device: In order to ensure t= hat the underlying thinpool metadata is not modified during the suspend mec= hanism, the dm-thin device needs to be fully provisioned. > 2) If a filesystem uses a loop device over a sparse file, fallocate() on = the filesystem will allocate blocks for files but the underlying sparse fil= e will remain intact. > 3) Another example is virtual machine using a sparse file/dm-thin as a st= orage device; by default, allocations within the VM boundaries will not aff= ect the host. > 4) Several storage standards support mechanisms for thin provisioning on = real hardware devices. For example: > a. The NVMe spec 1.0b section 2.1.1 loosely talks about thin provisioni= ng: "When the THINP bit in the NSFEAT field of the Identify Namespace data = structure is set to =E2=80=981=E2=80=99, the controller ... shall track the= number of allocated blocks in the Namespace Utilization field" > b. The SCSi Block Commands reference - 4 section references "Thin provi= sioned logical units", > c. UFS 3.0 spec section 13.3.3 references "Thin provisioning". When REQ_OP_PROVISION is sent on an already-allocated range of blocks, are those blocks zeroed? NVMe Write Zeroes with Deallocate=3D0 works this way, for example. That behavior is counterintuitive since the operation name suggests it just affects the logical block's provisioning state, not the contents of the blocks. > In all of the above situations, currently the only way for pre-allocating= space is to issue writes (or use WRITE_ZEROES/WRITE_SAME). However, that d= oes not scale well with larger pre-allocation sizes.=20 What exactly is the issue with WRITE_ZEROES scalability? Are you referring to cases where the device doesn't support an efficient WRITE_ZEROES command and actually writes blocks filled with zeroes instead of updating internal allocation metadata cheaply? Stefan --w/wnRFkY16cMLsvF Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAEBCAAdFiEEhpWov9P5fNqsNXdanKSrs4Grc8gFAmMkEzMACgkQnKSrs4Gr c8hn3wgAjJDAhaMbZwpCmdUdohpKtyMia1I6OsTlcURdfUV2iu1afmfcG5c7Q2pV ZPZC+DZhgUOEkpD1Aj5gCjpi8/1EXpmCwDGB36AgVnwzCMV9QLdW7B3xoCvJipNa b+KGhLFliE0pBX9ZGYqCZ7a8Tuz2OGtNhpAsd/tUOMYCLzc6WTqTIeB6Wv6rYrw4 kIF+kP7pEK4INQYAav+pYDzZxqd4yrKINa6PEOZUMxzuLnH4eW8l+xrsTDIMbA+e ummgls1ZrhgPhUJNqscmevqfJMLqMsZTxN6+B9zH+G6GrxAc1rqeRTdlMAwwYxYg DIMeBAXmfutiQDOVF8Tj6W1p7wrNLw== =s/zf -----END PGP SIGNATURE----- --w/wnRFkY16cMLsvF-- --===============2498237334590000574== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline -- dm-devel mailing list dm-devel@redhat.com https://listman.redhat.com/mailman/listinfo/dm-devel --===============2498237334590000574==-- 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 E3C83C54EE9 for ; Fri, 16 Sep 2022 06:10:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229896AbiIPGKR (ORCPT ); Fri, 16 Sep 2022 02:10:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45774 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229538AbiIPGKQ (ORCPT ); Fri, 16 Sep 2022 02:10:16 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A056CA0605 for ; Thu, 15 Sep 2022 23:10:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1663308613; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=WexFcKZFirN/jM+xTeznAj7e5nDORoI0aBqRUMifb8Y=; b=YsHarc1UTDu2mXRfkJ0RdbL+z7Xq61Zhki+sWD/60Fjd9zEMPXcXl0wz05ryztfExyHs6N DOtIjHCAXAV5xUs8DQTBEBNNT9IGktSavUVkbjLJKA3+oo/vU2uVCL+shcCewiw1Su27ht q4QDd9mGrVHmLqeRyvCbGel/q5yz5vU= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-292-jZYnFVjgP6GqmjFBWdto1w-1; Fri, 16 Sep 2022 02:09:58 -0400 X-MC-Unique: jZYnFVjgP6GqmjFBWdto1w-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 7BE48882822; Fri, 16 Sep 2022 06:09:57 +0000 (UTC) Received: from localhost (unknown [10.39.192.86]) by smtp.corp.redhat.com (Postfix) with ESMTP id 46FC3C15BA4; Fri, 16 Sep 2022 06:09:56 +0000 (UTC) Date: Fri, 16 Sep 2022 07:09:55 +0100 From: Stefan Hajnoczi To: Sarthak Kukreti 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 , Alasdair Kergon , Mike Snitzer , Theodore Ts'o , Andreas Dilger , Bart Van Assche , Daniil Lunev , Evan Green , Gwendal Grignou Subject: Re: [PATCH RFC 0/8] Introduce provisioning primitives for thinly provisioned storage Message-ID: References: <20220915164826.1396245-1-sarthakkukreti@google.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="w/wnRFkY16cMLsvF" Content-Disposition: inline In-Reply-To: <20220915164826.1396245-1-sarthakkukreti@google.com> X-Scanned-By: MIMEDefang 3.1 on 10.11.54.8 Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org --w/wnRFkY16cMLsvF Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Sep 15, 2022 at 09:48:18AM -0700, Sarthak Kukreti wrote: > From: Sarthak Kukreti >=20 > Hi, >=20 > This patch series is an RFC of a mechanism to pass through provision requ= ests on stacked thinly provisioned storage devices/filesystems. >=20 > The linux kernel provides several mechanisms to set up thinly provisioned= block storage abstractions (eg. dm-thin, loop devices over sparse files), = either directly as block devices or backing storage for filesystems. Curren= tly, short of writing data to either the device or filesystem, there is no = way for users to pre-allocate space for use in such storage setups. Conside= r the following use-cases: >=20 > 1) Suspend-to-disk and resume from a dm-thin device: In order to ensure t= hat the underlying thinpool metadata is not modified during the suspend mec= hanism, the dm-thin device needs to be fully provisioned. > 2) If a filesystem uses a loop device over a sparse file, fallocate() on = the filesystem will allocate blocks for files but the underlying sparse fil= e will remain intact. > 3) Another example is virtual machine using a sparse file/dm-thin as a st= orage device; by default, allocations within the VM boundaries will not aff= ect the host. > 4) Several storage standards support mechanisms for thin provisioning on = real hardware devices. For example: > a. The NVMe spec 1.0b section 2.1.1 loosely talks about thin provisioni= ng: "When the THINP bit in the NSFEAT field of the Identify Namespace data = structure is set to =E2=80=981=E2=80=99, the controller ... shall track the= number of allocated blocks in the Namespace Utilization field" > b. The SCSi Block Commands reference - 4 section references "Thin provi= sioned logical units", > c. UFS 3.0 spec section 13.3.3 references "Thin provisioning". When REQ_OP_PROVISION is sent on an already-allocated range of blocks, are those blocks zeroed? NVMe Write Zeroes with Deallocate=3D0 works this way, for example. That behavior is counterintuitive since the operation name suggests it just affects the logical block's provisioning state, not the contents of the blocks. > In all of the above situations, currently the only way for pre-allocating= space is to issue writes (or use WRITE_ZEROES/WRITE_SAME). However, that d= oes not scale well with larger pre-allocation sizes.=20 What exactly is the issue with WRITE_ZEROES scalability? Are you referring to cases where the device doesn't support an efficient WRITE_ZEROES command and actually writes blocks filled with zeroes instead of updating internal allocation metadata cheaply? Stefan --w/wnRFkY16cMLsvF Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAEBCAAdFiEEhpWov9P5fNqsNXdanKSrs4Grc8gFAmMkEzMACgkQnKSrs4Gr c8hn3wgAjJDAhaMbZwpCmdUdohpKtyMia1I6OsTlcURdfUV2iu1afmfcG5c7Q2pV ZPZC+DZhgUOEkpD1Aj5gCjpi8/1EXpmCwDGB36AgVnwzCMV9QLdW7B3xoCvJipNa b+KGhLFliE0pBX9ZGYqCZ7a8Tuz2OGtNhpAsd/tUOMYCLzc6WTqTIeB6Wv6rYrw4 kIF+kP7pEK4INQYAav+pYDzZxqd4yrKINa6PEOZUMxzuLnH4eW8l+xrsTDIMbA+e ummgls1ZrhgPhUJNqscmevqfJMLqMsZTxN6+B9zH+G6GrxAc1rqeRTdlMAwwYxYg DIMeBAXmfutiQDOVF8Tj6W1p7wrNLw== =s/zf -----END PGP SIGNATURE----- --w/wnRFkY16cMLsvF-- 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 smtp3.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 730DEECAAD8 for ; Fri, 16 Sep 2022 06:10:16 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id F15A5611DF; Fri, 16 Sep 2022 06:10:15 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org F15A5611DF Authentication-Results: smtp3.osuosl.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=N7H4jCpM X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id y54jF5FV_AIb; Fri, 16 Sep 2022 06:10:15 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [IPv6:2605:bc80:3010:104::8cd3:938]) by smtp3.osuosl.org (Postfix) with ESMTPS id 52268611D9; Fri, 16 Sep 2022 06:10:14 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp3.osuosl.org 52268611D9 Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id 0D59AC0033; Fri, 16 Sep 2022 06:10:14 +0000 (UTC) Received: from smtp1.osuosl.org (smtp1.osuosl.org [IPv6:2605:bc80:3010::138]) by lists.linuxfoundation.org (Postfix) with ESMTP id 31BD4C002D for ; Fri, 16 Sep 2022 06:10:12 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id 0BA4B83E9B for ; Fri, 16 Sep 2022 06:10:12 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org 0BA4B83E9B Authentication-Results: smtp1.osuosl.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=N7H4jCpM X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 3lUKlcZx8Kqj for ; Fri, 16 Sep 2022 06:10:10 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.8.0 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org 9C4C683E75 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by smtp1.osuosl.org (Postfix) with ESMTPS id 9C4C683E75 for ; Fri, 16 Sep 2022 06:10:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1663308609; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=WexFcKZFirN/jM+xTeznAj7e5nDORoI0aBqRUMifb8Y=; b=N7H4jCpMNSI6PtRVRwp4Kow40kSjqXq1rjLogFlWjun5JZLtGRwWxc1hYmuk/ryiFNGzMl 2Am9T/WNyiDNu9BZ+BgOwOuSTvdvOkHkomSHN49q5bWOiBCGaJlTWi7WTZwucuGb403H5H 3NDO3ruQ1MsvxmGAz09zkhvqtauhXlA= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-292-jZYnFVjgP6GqmjFBWdto1w-1; Fri, 16 Sep 2022 02:09:58 -0400 X-MC-Unique: jZYnFVjgP6GqmjFBWdto1w-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 7BE48882822; Fri, 16 Sep 2022 06:09:57 +0000 (UTC) Received: from localhost (unknown [10.39.192.86]) by smtp.corp.redhat.com (Postfix) with ESMTP id 46FC3C15BA4; Fri, 16 Sep 2022 06:09:56 +0000 (UTC) Date: Fri, 16 Sep 2022 07:09:55 +0100 From: Stefan Hajnoczi To: Sarthak Kukreti Subject: Re: [PATCH RFC 0/8] Introduce provisioning primitives for thinly provisioned storage Message-ID: References: <20220915164826.1396245-1-sarthakkukreti@google.com> MIME-Version: 1.0 In-Reply-To: <20220915164826.1396245-1-sarthakkukreti@google.com> X-Scanned-By: MIMEDefang 3.1 on 10.11.54.8 Cc: Jens Axboe , Gwendal Grignou , Theodore Ts'o , "Michael S . Tsirkin" , Bart Van Assche , Mike Snitzer , linux-kernel@vger.kernel.org, virtualization@lists.linux-foundation.org, linux-block@vger.kernel.org, dm-devel@redhat.com, Andreas Dilger , Daniil Lunev , Paolo Bonzini , linux-ext4@vger.kernel.org, Evan Green , Alasdair Kergon X-BeenThere: virtualization@lists.linux-foundation.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Linux virtualization List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: multipart/mixed; boundary="===============4862343357281960716==" Errors-To: virtualization-bounces@lists.linux-foundation.org Sender: "Virtualization" --===============4862343357281960716== Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="w/wnRFkY16cMLsvF" Content-Disposition: inline --w/wnRFkY16cMLsvF Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Sep 15, 2022 at 09:48:18AM -0700, Sarthak Kukreti wrote: > From: Sarthak Kukreti >=20 > Hi, >=20 > This patch series is an RFC of a mechanism to pass through provision requ= ests on stacked thinly provisioned storage devices/filesystems. >=20 > The linux kernel provides several mechanisms to set up thinly provisioned= block storage abstractions (eg. dm-thin, loop devices over sparse files), = either directly as block devices or backing storage for filesystems. Curren= tly, short of writing data to either the device or filesystem, there is no = way for users to pre-allocate space for use in such storage setups. Conside= r the following use-cases: >=20 > 1) Suspend-to-disk and resume from a dm-thin device: In order to ensure t= hat the underlying thinpool metadata is not modified during the suspend mec= hanism, the dm-thin device needs to be fully provisioned. > 2) If a filesystem uses a loop device over a sparse file, fallocate() on = the filesystem will allocate blocks for files but the underlying sparse fil= e will remain intact. > 3) Another example is virtual machine using a sparse file/dm-thin as a st= orage device; by default, allocations within the VM boundaries will not aff= ect the host. > 4) Several storage standards support mechanisms for thin provisioning on = real hardware devices. For example: > a. The NVMe spec 1.0b section 2.1.1 loosely talks about thin provisioni= ng: "When the THINP bit in the NSFEAT field of the Identify Namespace data = structure is set to =E2=80=981=E2=80=99, the controller ... shall track the= number of allocated blocks in the Namespace Utilization field" > b. The SCSi Block Commands reference - 4 section references "Thin provi= sioned logical units", > c. UFS 3.0 spec section 13.3.3 references "Thin provisioning". When REQ_OP_PROVISION is sent on an already-allocated range of blocks, are those blocks zeroed? NVMe Write Zeroes with Deallocate=3D0 works this way, for example. That behavior is counterintuitive since the operation name suggests it just affects the logical block's provisioning state, not the contents of the blocks. > In all of the above situations, currently the only way for pre-allocating= space is to issue writes (or use WRITE_ZEROES/WRITE_SAME). However, that d= oes not scale well with larger pre-allocation sizes.=20 What exactly is the issue with WRITE_ZEROES scalability? Are you referring to cases where the device doesn't support an efficient WRITE_ZEROES command and actually writes blocks filled with zeroes instead of updating internal allocation metadata cheaply? Stefan --w/wnRFkY16cMLsvF Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAEBCAAdFiEEhpWov9P5fNqsNXdanKSrs4Grc8gFAmMkEzMACgkQnKSrs4Gr c8hn3wgAjJDAhaMbZwpCmdUdohpKtyMia1I6OsTlcURdfUV2iu1afmfcG5c7Q2pV ZPZC+DZhgUOEkpD1Aj5gCjpi8/1EXpmCwDGB36AgVnwzCMV9QLdW7B3xoCvJipNa b+KGhLFliE0pBX9ZGYqCZ7a8Tuz2OGtNhpAsd/tUOMYCLzc6WTqTIeB6Wv6rYrw4 kIF+kP7pEK4INQYAav+pYDzZxqd4yrKINa6PEOZUMxzuLnH4eW8l+xrsTDIMbA+e ummgls1ZrhgPhUJNqscmevqfJMLqMsZTxN6+B9zH+G6GrxAc1rqeRTdlMAwwYxYg DIMeBAXmfutiQDOVF8Tj6W1p7wrNLw== =s/zf -----END PGP SIGNATURE----- --w/wnRFkY16cMLsvF-- --===============4862343357281960716== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Virtualization mailing list Virtualization@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/virtualization --===============4862343357281960716==--