From patchwork Wed Jun 15 10:19:20 2022
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
X-Patchwork-Submitter: Pankaj Raghav
X-Patchwork-Id: 12882068
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 87F1CCCA473
for ; Wed, 15 Jun 2022 10:21:13 +0000 (UTC)
Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand
id S1347586AbiFOKVM (ORCPT );
Wed, 15 Jun 2022 06:21:12 -0400
Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37534 "EHLO
lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org
with ESMTP id S240029AbiFOKUR (ORCPT
);
Wed, 15 Jun 2022 06:20:17 -0400
Received: from mailout2.w1.samsung.com (mailout2.w1.samsung.com
[210.118.77.12])
by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AF2904B403
for ;
Wed, 15 Jun 2022 03:20:14 -0700 (PDT)
Received: from eucas1p1.samsung.com (unknown [182.198.249.206])
by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id
20220615102013euoutp027c77c8587d2774bf17f2d65f2a1ae8c9~4xArAmwzB2943629436euoutp02T
for ;
Wed, 15 Jun 2022 10:20:13 +0000 (GMT)
DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com
20220615102013euoutp027c77c8587d2774bf17f2d65f2a1ae8c9~4xArAmwzB2943629436euoutp02T
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com;
s=mail20170921; t=1655288413;
bh=QqPz2OWxGMD8uCb8jReBS97cNwDJ8EJVxZGORNAnUdo=;
h=From:To:Cc:Subject:Date:In-Reply-To:References:From;
b=iLL5b2vtEgRJs2TbtMn9Tfo2u6mfRMBjIEUbDaAVM8O2ra6qhVb8CN7i92Syp285T
1tB3K29ZU3LEKvLqDz4oLxcPTQx1IpMHw1YactdVZmnKeExd01JhV71AzixJek0QV2
WGG578YKOhha7MRRlh8xxpC1DqdlyjjP/gd4eV8Y=
Received: from eusmges1new.samsung.com (unknown [203.254.199.242]) by
eucas1p2.samsung.com (KnoxPortal) with ESMTP id
20220615102011eucas1p27927ddf4d6c43741b27aa5073cb46fc2~4xApc1BVV1912519125eucas1p2M;
Wed, 15 Jun 2022 10:20:11 +0000 (GMT)
Received: from eucas1p2.samsung.com ( [182.198.249.207]) by
eusmges1new.samsung.com (EUCPMTA) with SMTP id 10.5B.09664.B52B9A26;
Wed, 15
Jun 2022 11:20:11 +0100 (BST)
Received: from eusmtrp2.samsung.com (unknown [182.198.249.139]) by
eucas1p2.samsung.com (KnoxPortal) with ESMTPA id
20220615102011eucas1p220368db4a186181b1927dea50a79e5d4~4xAo7795N0710507105eucas1p2s;
Wed, 15 Jun 2022 10:20:11 +0000 (GMT)
Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by
eusmtrp2.samsung.com (KnoxPortal) with ESMTP id
20220615102011eusmtrp2227b720bc5fb53cd1c83b1d6c4bc4bce~4xAo6uDdB0361403614eusmtrp2W;
Wed, 15 Jun 2022 10:20:11 +0000 (GMT)
X-AuditID: cbfec7f2-d81ff700000025c0-4c-62a9b25bf383
Received: from eusmtip2.samsung.com ( [203.254.199.222]) by
eusmgms1.samsung.com (EUCPMTA) with SMTP id 2A.65.09095.B52B9A26;
Wed, 15
Jun 2022 11:20:11 +0100 (BST)
Received: from localhost (unknown [106.210.248.244]) by eusmtip2.samsung.com
(KnoxPortal) with ESMTPA id
20220615102010eusmtip2dbad86de53e6f9e7136701b3cc5cabba~4xAnvRvtz0472904729eusmtip2g;
Wed, 15 Jun 2022 10:20:09 +0000 (GMT)
From: Pankaj Raghav
To: hch@lst.de, snitzer@redhat.com, damien.lemoal@opensource.wdc.com,
axboe@kernel.dk
Cc: bvanassche@acm.org, linux-kernel@vger.kernel.org,
jiangbo.365@bytedance.com, hare@suse.de, pankydev8@gmail.com,
dm-devel@redhat.com, jonathan.derrick@linux.dev,
gost.dev@samsung.com, dsterba@suse.com, jaegeuk@kernel.org,
linux-nvme@lists.infradead.org, Johannes.Thumshirn@wdc.com,
linux-block@vger.kernel.org, Pankaj Raghav ,
Johannes Thumshirn ,
Damien Le Moal
Subject: [PATCH v7 13/13] dm: add non power of 2 zoned target
Date: Wed, 15 Jun 2022 12:19:20 +0200
Message-Id: <20220615101920.329421-14-p.raghav@samsung.com>
X-Mailer: git-send-email 2.25.1
In-Reply-To: <20220615101920.329421-1-p.raghav@samsung.com>
MIME-Version: 1.0
X-Brightmail-Tracker:
H4sIAAAAAAAAA+NgFvrJKsWRmVeSWpSXmKPExsWy7djP87rRm1YmGezfr2mx+m4/m8W0Dz+Z
LX6fPc9s0dr+jcli77vZrBYXfjQyWdw8sJPJYs+iSUwWK1cfZbJ4sn4Ws0XPgQ8sFn+77gHF
Wh4yW+y9pW1xedccNov5y56yW3xe2sJusebmUxaLto1fGR2EPS5f8fb4d2INm8fOWXfZPS6f
LfXYtKqTzWNhw1Rmj81L6j1232wAyrXeZ/V4v+8qm0ffllWMHuu3XGXx2Hy62uPzJjmP9gPd
TAH8UVw2Kak5mWWpRfp2CVwZvV3rmAo6oyvObWplaWDc4NXFyMkhIWAicfrNfcYuRi4OIYEV
jBJfdjezQThfGCX+n21kgXA+M0p0z73MCNNyaflpJojEckaJGU8WQzkvGSWmXf8I1MLBwSag
JdHYyQ7SICIQLnF0zz2wGmaBw8wSt1d2gyWEBWwlNm59xAZiswioSmw884QFxOYVsJY48/M/
O8Q2eYmZl76D2ZxA8R2ze1ghagQlTs6EqGcGqmneOpsZov4Sp8Smbh0I20Vi3q0DLBC2sMSr
41ugZspI/N85nwnCrpZ4euM3M8hxEgItjBL9O9ezgTwgAbSs70wOiMksoCmxfpc+RLmjxKqW
J4wQFXwSN94KQlzAJzFp23RmiDCvREeb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JdHYyQ4SFhGIlui8+Z4NZA6zwFVmie8N85hBEsICthIb
tz4C62URUJXYeOYJ2HxeAWuJMz//s0PMl5eYeek7mM0JFN8xu4cVZL6QgJXErnfxEOWCEidn
QrQyA5U3b53NPIFRYBaS1CwkqQWMTKsYRVJLi3PTc4sN9YoTc4tL89L1kvNzNzECY3zbsZ+b
dzDOe/VR7xAjEwfjIUYJDmYlEV6z4JVJQrwpiZVVqUX58UWlOanFhxhNgc6eyCwlmpwPTDJ5
JfGGZgamhiZmlgamlmbGSuK8ngUdiUIC6YklqdmpqQWpRTB9TBycUg1MLusnXT7wbF+fdX9z
bOnsuTFXu3c7rQkRVUkTvBvSKJ7DveVO0Zm9Z6Yq28vtPDnvtqqLQcUkMT1LjhfnbaZ4CnF0
ZZ+YuOCf8iqJU1EelhXvZta28v4+m3VbhHlS3xH2rsu5SvoWHQF9lzzkNzGVFk7gij+8Lt9S
/UuK0GcNg9snWh4KJH9lP3Ne/ajFvl+JjUznE7+5z14jcS3pZYltaruhfeC21umzY2/29fba
7+9a/8R3bt6eEBsZl4k9O6vuq57dOPcnO6/uTjb7J5sa86sbul6XK1f9Loq+Y/ezKPKdn6/V
xd6jfW/Ot+/Zrb7ewDXVMDF+7/TzAfGvLjk9/BHp8vTx7hX1lTkJ5dFKLMUZiYZazEXFiQDr
6t5jegMAAA==
X-CMS-MailID: 20220615102011eucas1p220368db4a186181b1927dea50a79e5d4
X-Msg-Generator: CA
X-RootMTR: 20220615102011eucas1p220368db4a186181b1927dea50a79e5d4
X-EPHeader: CA
CMS-TYPE: 201P
X-CMS-RootMailID: 20220615102011eucas1p220368db4a186181b1927dea50a79e5d4
References: <20220615101920.329421-1-p.raghav@samsung.com>
Precedence: bulk
List-ID:
X-Mailing-List: linux-block@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 po2 device 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 zone
capacity and the po2 zone size of the underlying device. All IOs will be
remapped from target to the actual device location. For devices that use
zone append, the bi_sector is remapped from device to target's layout.
The read IOs that fall in the "emulated" gap area will return 0 and all
the other IOs in that area will result in an error. If an read IO span
across the zone capacity boundary, then the IOs are split between the
boundary. All other IO operations that span across a zone capacity
boundary will result in an error.
The target can be easily updated as follows:
dmsetup create