Received: by 2002:ac0:e34a:0:0:0:0:0 with SMTP id g10csp472955imn; Wed, 27 Jul 2022 11:10:27 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vM/4G2cBjZMCornKHi3C/8BKyXHJ1iH/GplvmHYfgNdm9/PQzCU1PVGN6bytVxwtPgEF1B X-Received: by 2002:a17:907:970d:b0:72b:3589:a22c with SMTP id jg13-20020a170907970d00b0072b3589a22cmr18891655ejc.621.1658945427392; Wed, 27 Jul 2022 11:10:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658945427; cv=none; d=google.com; s=arc-20160816; b=A1+to+YrMbb1GCmczivNXIwMJAC9ikQK9YuVNZCKuotxX+DpLZaQThs+ZoZkBAu1L1 0SU4R/7GH1ZZ0u4z0HazUKwutLI79LdbzsfFGTt5fEDdcfm9rE7vk2AU4a+y5WayRr0O 3lPyyBhUqPVl7WyGpmAqUMhDygTDFF8KkX9qetvEJ3DKNOrp4CYYgWrqGi83b5h2R9jv 1yxVv8xeNMMvYBOiyuvAg/NPFOrkyha5aooJFq133qgCZOGaAqXcnlPmSNVPb/PFMpXk 9b5bTMisWmTY5Vr446eL32E7q3dlrg3tWzeWK9R8bPeYf6VBL0r1z8KFxv36EvsuFKuQ Dutg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:cms-type:content-transfer-encoding :mime-version:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:dkim-filter; bh=BDysFYNk87Sy+iH2ATaUwA/CYoqH1bPuiKpwIv4PNH4=; b=btLhOtXzIWcpYjfX9s3TkJQxyr33JXEgEjydrrEmLF7gexUyHsgN9OcaOLtSwi+2Gd mHBcHtrBzQ/1Xzquo+rgx7g/RrbzXWrigZwv/EL7uASVWpth19/T7WhAAaqiHgeYHNHh rXQlJI1szTpISEHMIHImoOlo2clJI29PUWNgfkwkR3koN3mCw4lc6UNe9V7KkmKHOyZI nqoEWBMrX8uP2gxWcqX+njMAV7i48E1NwSJL0UpkKfD4ID1JQmTfyDats8lYeKChQyQX apFQ8Rp3cD+2sfOsImEX9+/WyjwY9hB9d+mOlVL+NzBZx9cUwfXgXEusNPQwIZA847Tc eBzg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=l1FC8joZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id he9-20020a1709073d8900b007123952b00dsi7042304ejc.100.2022.07.27.11.10.02; Wed, 27 Jul 2022 11:10:27 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=l1FC8joZ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229946AbiG0Q0D (ORCPT + 99 others); Wed, 27 Jul 2022 12:26:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49512 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236595AbiG0QY0 (ORCPT ); Wed, 27 Jul 2022 12:24:26 -0400 Received: from mailout2.w1.samsung.com (mailout2.w1.samsung.com [210.118.77.12]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F200F4E604 for ; Wed, 27 Jul 2022 09:23:19 -0700 (PDT) Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20220727162259euoutp0226fb7004a55577458d39d7ce69c21601~FvDZu10xx1245112451euoutp02s for ; Wed, 27 Jul 2022 16:22:59 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20220727162259euoutp0226fb7004a55577458d39d7ce69c21601~FvDZu10xx1245112451euoutp02s DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1658938979; bh=BDysFYNk87Sy+iH2ATaUwA/CYoqH1bPuiKpwIv4PNH4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=l1FC8joZBs9tULMFGdL9Ltz7W21raE/rNqGHEOWXYMNwJ68Ynvg6rwUugydf9GrTY GBCzwzoG7swv6IG9PLA1gcj6ULYYH1GegcYK5knN3IeVjDutu8JUF09dhw/RzoiL2c rxAUX201grV/N8/Vwaz3GGJznSJkjxSm0gS/+8e8= Received: from eusmges1new.samsung.com (unknown [203.254.199.242]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20220727162258eucas1p217e6f4283b34ae7aa09a8668412c0d1f~FvDYUb_zX0838408384eucas1p2G; Wed, 27 Jul 2022 16:22:58 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges1new.samsung.com (EUCPMTA) with SMTP id F5.C3.09664.26661E26; Wed, 27 Jul 2022 17:22:58 +0100 (BST) Received: from eusmtrp1.samsung.com (unknown [182.198.249.138]) by eucas1p2.samsung.com (KnoxPortal) with ESMTPA id 20220727162257eucas1p2848a75c4aa7e559abb5d9ae0fbd374c1~FvDX8AmGA2220522205eucas1p2B; Wed, 27 Jul 2022 16:22:57 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eusmtrp1.samsung.com (KnoxPortal) with ESMTP id 20220727162257eusmtrp1b431db91f9d620ddc563d89d431e4200~FvDX7Mt3d0298902989eusmtrp1R; Wed, 27 Jul 2022 16:22:57 +0000 (GMT) X-AuditID: cbfec7f2-d81ff700000025c0-f6-62e16662e688 Received: from eusmtip1.samsung.com ( [203.254.199.221]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id CB.8D.09038.16661E26; Wed, 27 Jul 2022 17:22:57 +0100 (BST) Received: from localhost (unknown [106.210.248.8]) by eusmtip1.samsung.com (KnoxPortal) with ESMTPA id 20220727162257eusmtip1df9def4b055afa74f07522657e052479~FvDXkL73Z0050700507eusmtip1j; Wed, 27 Jul 2022 16:22:57 +0000 (GMT) From: Pankaj Raghav To: damien.lemoal@opensource.wdc.com, hch@lst.de, axboe@kernel.dk, snitzer@kernel.org, Johannes.Thumshirn@wdc.com Cc: matias.bjorling@wdc.com, gost.dev@samsung.com, linux-kernel@vger.kernel.org, hare@suse.de, linux-block@vger.kernel.org, pankydev8@gmail.com, bvanassche@acm.org, jaegeuk@kernel.org, dm-devel@redhat.com, linux-nvme@lists.infradead.org, Pankaj Raghav , Johannes Thumshirn , Damien Le Moal Subject: [PATCH v8 11/11] dm: add power-of-2 zoned target for non-power-of-2 zoned devices Date: Wed, 27 Jul 2022 18:22:45 +0200 Message-Id: <20220727162245.209794-12-p.raghav@samsung.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220727162245.209794-1-p.raghav@samsung.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrHKsWRmVeSWpSXmKPExsWy7djP87pJaQ+TDCY8Y7NYfbefzWLah5/M Fr/Pnme2aG3/xmSx991sVoubB3YyWexZNInJYuXqo0wWT9bPYrb423UPKHtL2+LyrjlsFvOX PWW3mND2ldni89IWdos1N5+yWJy4Je0g6HH5irfHzll32T0uny312LSqk81j85J6j903G9g8 drbeZ/V4v+8qm0ffllWMHptPV3t83iTn0X6gmymAJ4rLJiU1J7MstUjfLoErY9XTI8wFm/Ir Dk7sYW9g3BjdxcjJISFgIjG/cQFrFyMXh5DACkaJl53d7BDOF0aJ7t6tjCBVQgKfGSU2bbSF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z6bFrVyeaxeUm9x+6bDWwe O1vvs3q833eVzaNvyypGj82nqz0+b5LzaD/QzRTAE6VnU5RfWpKqkJFfXGKrFG1oYaRnaGmh Z2RiqWdobB5rZWSqpG9nk5Kak1mWWqRvl6CXserpEeaCTfkVByf2sDcwbozuYuTkkBAwkTg2 cwl7FyMXh5DAUkaJJ7c2skEkJCRuL2xihLCFJf5c62KDKHrKKDH9bQtQBwcHm4CWRGMnmCki UClx9ossSAmzQDOzxIIN95lA4sICURJtUwNATBYBVYl/V1NAJvIKWEvsnjudBWK6vMTMS9/Z QWxOoPjmKfOYQGwhASuJZw8+skHUC0qcnPkErJ4ZqL5562zmCYwCs5CkZiFJLWBkWsUoklpa nJueW2ykV5yYW1yal66XnJ+7iREYrduO/dyyg3Hlq496hxiZOBgPMUpwMCuJ8CZE308S4k1J rKxKLcqPLyrNSS0+xGgKdPZEZinR5HxgusgriTc0MzA1NDGzNDC1NDNWEuf1LOhIFBJITyxJ zU5NLUgtgulj4uCUamCy3xz058yTv53JV0wdOh5s5PbfGyD1q0HaYtJj3lNPf7L3CgbNZtv1 MfaPh6XK0Q8lmTc/rAqou5lm72l5c7Zz5iuHl3cM+gLiD8fNMPe3XbDCJm+vg0pD0r5bZ6ct YbSa2BRzPfjMuq5TPr6nk9+u2W/2kpVf2uDynf1nHVzzLKdNMLXTFLb0+1Bqabr891TmjLD6 K9/v7uDe9+f60y2dGzPmK09sPnLXMTdEfr2ObXkc3/qJDm5T/qa80/L47R7M1uV990Ylq2Lm Xkvmlqqzi5dOCvJS3+5xUru4sK3rfQLLBz0Hptb2LJ6uJWnzz6uHdt7427j/xBc9HVlXv3v2 SfxtkVcXdr1xivrYKqfEUpyRaKjFXFScCAA5ZpvlXwMAAA== X-CMS-MailID: 20220727162257eucas1p2848a75c4aa7e559abb5d9ae0fbd374c1 X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" X-RootMTR: 20220727162257eucas1p2848a75c4aa7e559abb5d9ae0fbd374c1 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20220727162257eucas1p2848a75c4aa7e559abb5d9ae0fbd374c1 References: <20220727162245.209794-1-p.raghav@samsung.com> X-Spam-Status: No, score=-7.7 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Only power-of-2(po2) zoned devices were supported in linux but now non power-of-2(npo2) zoned device 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 zoned devices, it was suggested to create a dm target for npo2 zoned device to appear as a po2 target so that file systems can initially work without any explicit changes by using this target. The design of this target is very simple: introduce gaps between the underlying device's zone size and the nearest po2 device zone size. Device's actual zone size becomes the zone capacity of the target and device's nearest po2 zone size becomes the target's zone size. 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 All IOs will be remapped from target to the actual device location. 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