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 C04ACC19F2A for ; Thu, 11 Aug 2022 16:43:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S239094AbiHKQnf (ORCPT ); Thu, 11 Aug 2022 12:43:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36484 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239105AbiHKQnT (ORCPT ); Thu, 11 Aug 2022 12:43:19 -0400 Received: from esa2.hgst.iphmx.com (esa2.hgst.iphmx.com [68.232.143.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 742C3A7A8A for ; Thu, 11 Aug 2022 09:15:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1660234528; x=1691770528; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=FGQZRl2CWl3CIWMy8wlUQ2KpRGUAW/JJBfetn8XTZIc=; b=Uv01tuw5xi3k9ntqwqzn3ztx8cu/sU5l82OTvUTQorkkuynve1898PLd UoxLXvN8zvdaF0jk/tsuqAV8pN22AxEFgig/DqQdXjPOkhgaPLPbJUZIW yPzs4Deicmhmkn/MRHs10i41AmssSY25aWsvfUa24Jolzv51aiwTYKy5a JPhrzpEdKx8q9GFJoes9qUiRR9/k+yOJnrgrt8pIQRbSM+UAopizQCiDs AInFa+/+Y23i4SLmAnk9XIDlTthOi1VxZEkoFx9/wDb822GU1xbu9AcWH J/wQpCgVmzdKxrFB4F1IEauSdTviIIlhRQ4y53ASM47tPrPfGloarevvf g==; X-IronPort-AV: E=Sophos;i="5.93,230,1654531200"; d="scan'208";a="312747139" Received: from h199-255-45-15.hgst.com (HELO uls-op-cesaep02.wdc.com) ([199.255.45.15]) by ob1.hgst.iphmx.com with ESMTP; 12 Aug 2022 00:15:18 +0800 IronPort-SDR: lMQq/Qvp0UB8cKCu/ZjfiE1ltD/h0X6K7p9r14znhZR24yFwYcOQ6d4WuYl4rUN9oiym3Ux9x2 6dTlG1s1zlu25WmCIoAAQ45x+CUp/6e2tQlTjUdj8mtKB1ZGnT8sNI24Iau9UProayvvt122Xc e+2su01uFAE26LGJYTX2e320vhkJNWZMl/vfi02KKk5WEGsSHgpN5/MsqG0FvsJDKsDTFBjQxB 8QU+grCGnJXRKIsibDXrbe9Yki4O+1h9hJwTBZruZ6nH031RxuI3aE2FuvPLEQByygbHWOvLX5 GJzadZYxh2lmeSNFBuM6n+8X Received: from uls-op-cesaip01.wdc.com ([10.248.3.36]) by uls-op-cesaep02.wdc.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 11 Aug 2022 08:30:52 -0700 IronPort-SDR: rsMbhJfjfEurKT4NV/GDM7bZ3u2hknewRu9Ic7QnMFBBBCh2+qsO1Q4s9DrxZcRpeCH/FLhfeo mThRxKImi12chyu5lgWg755hZ6GJH+X2cjeQSFoYDX4ThdjJuHSHgiPxlnu7W8yh/7rKidC2mN qqipiLBxL+yEzNQpjGtrAF1XO4t/fh9r0MluJP5Dnix4fxGyltVkNTbqexXKN4iYuKRon7KQIl 6EOyMmb3G4OxLcX7/c7PYmP0vEy3s6o4spbA36mIrDsDwE7uZ0FTmlCRZpxYP4srjvOCLVs562 1yU= WDCIronportException: Internal Received: from usg-ed-osssrv.wdc.com ([10.3.10.180]) by uls-op-cesaip01.wdc.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 11 Aug 2022 09:15:18 -0700 Received: from usg-ed-osssrv.wdc.com (usg-ed-osssrv.wdc.com [127.0.0.1]) by usg-ed-osssrv.wdc.com (Postfix) with ESMTP id 4M3X2s6Yd0z1Rw4L for ; Thu, 11 Aug 2022 09:15:17 -0700 (PDT) Authentication-Results: usg-ed-osssrv.wdc.com (amavisd-new); dkim=pass reason="pass (just generated, assumed good)" header.d=opensource.wdc.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d= opensource.wdc.com; h=content-transfer-encoding:content-type :in-reply-to:organization:from:references:to:content-language :subject:user-agent:mime-version:date:message-id; s=dkim; t= 1660234513; x=1662826514; bh=FGQZRl2CWl3CIWMy8wlUQ2KpRGUAW/JJBfe tn8XTZIc=; b=pLJ8H1VGsT+K0Z9fydoNf0JFpXEt57BH8OF/uP4qNi7vadZe9PS z8gBpzWZVhBepvK5Kuii+YJUPmS6l17HSlTs1W33G0Kb7QzioSB8ivM5wke+Pjc9 Y31xGxmrOp5snR3n3+q4DU/eAyhRelz5YMfvy0ntQoQ40SieBkt+E6Z5EhZ9N9aM jqhKQsA8aGEXGI8U7Lr8AU7+FnfRi+eZaO3S2EfUmv/hSCN6fVUlvRfgnRrGVIQE AAfe2Pl95/5Hyy8vrHdbvrFms7piQt2Py+p6l6YixSf8LNrvgGHU35irPBPZRkGt dYMPWYteu4qcPDV0fLbx6KNUyDZoVCliyCg== X-Virus-Scanned: amavisd-new at usg-ed-osssrv.wdc.com Received: from usg-ed-osssrv.wdc.com ([127.0.0.1]) by usg-ed-osssrv.wdc.com (usg-ed-osssrv.wdc.com [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id Coo2LNpjMrIX for ; Thu, 11 Aug 2022 09:15:13 -0700 (PDT) Received: from [10.111.68.99] (c02drav6md6t.sdcorp.global.sandisk.com [10.111.68.99]) by usg-ed-osssrv.wdc.com (Postfix) with ESMTPSA id 4M3X2m3BXJz1RtVk; Thu, 11 Aug 2022 09:15:12 -0700 (PDT) Message-ID: <9cc04d5e-dfa5-6d48-b9e1-60d319ab2299@opensource.wdc.com> Date: Thu, 11 Aug 2022 09:15:12 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0) Gecko/20100101 Thunderbird/91.12.0 Subject: Re: [PATCH v10 13/13] dm: add power-of-2 target for zoned devices with non power-of-2 zone sizes Content-Language: en-US To: Pankaj Raghav , snitzer@kernel.org, axboe@kernel.dk, hch@lst.de, agk@redhat.com Cc: linux-block@vger.kernel.org, Johannes.Thumshirn@wdc.com, bvanassche@acm.org, matias.bjorling@wdc.com, hare@suse.de, gost.dev@samsung.com, linux-nvme@lists.infradead.org, jaegeuk@kernel.org, pankydev8@gmail.com, linux-kernel@vger.kernel.org, dm-devel@redhat.com, Damien Le Moal , Joel Granados References: <20220811143043.126029-1-p.raghav@samsung.com> <20220811143043.126029-14-p.raghav@samsung.com> From: Damien Le Moal Organization: Western Digital Research In-Reply-To: <20220811143043.126029-14-p.raghav@samsung.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org On 2022/08/11 7:30, Pankaj Raghav wrote: > Only zoned devices with power-of-2(po2) number of sectors per zone(zone > size) were supported in linux but now non power-of-2(npo2) zone sizes > support has been added to the block layer. > > Filesystems such as F2FS and btrfs have support for zoned devices with > po2 zone size assumption. Before adding native support for npo2 zone > sizes, it was suggested to create a dm target for npo2 zone size device to > appear as a po2 size zoned target so that file systems can initially work > without any explicit changes by using this target. > > The design of this target is very simple: remap the device zone size to > the zone capacity and change the zone size to be the nearest power of 2 > number of sectors. > > For e.g., a device with a zone size/capacity of 3M will have an equivalent > target layout as follows: > > Device layout :- > zone capacity = 3M > zone size = 3M > > |--------------|-------------| > 0 3M 6M > > Target layout :- > zone capacity=3M > zone size = 4M > > |--------------|---|--------------|---| > 0 3M 4M 7M 8M > > The area between target's zone capacity and zone size will be emulated > in the target. > The read IOs that fall in the emulated gap area will return 0 filled > bio and all the other IOs in that area will result in an error. > If a read IO span across the emulated area boundary, then the IOs are > split across them. All other IO operations that span across the emulated > area boundary will result in an error. > > The target can be easily created as follows: > dmsetup create