X-Patchwork-Id: 12930595
X-Patchwork-Delegate: snitzer@redhat.com
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 B4436C04A68
for ; Wed, 27 Jul 2022 17:00:30 +0000 (UTC)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;
s=mimecast20190719; t=1658941229;
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:
content-transfer-encoding:content-transfer-encoding:
in-reply-to:in-reply-to:references:references:list-id:list-help:
list-unsubscribe:list-subscribe:list-post;
bh=c/LiXSuR4QOwZ0L/9t3Agnglc0PEUydXkUBbpvFwOdk=;
b=S7GA6XIVrXKZdy2oh9qPrSr6TQwyeqSG8j7yOQI8kdei3fooRGisHw+fkT0N5ViH/HkKNB
TaNU3/RbGWSWFJLfGN2ybV3cfQc7jAaDlHL0X13T9v5y/IsaNcB8RMxsIeUM9o2262i0A7
Tw+OaeIQbPOHDVyS0TaX0N7GxS/b9J0=
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-110-EpEOjJhmNhGIQyKC-LtG1A-1; Wed, 27 Jul 2022 13:00:26 -0400
X-MC-Unique: EpEOjJhmNhGIQyKC-LtG1A-1
Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com
[10.11.54.2])
(using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))
(No client certificate requested)
by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 8CF7B802D2C;
Wed, 27 Jul 2022 17:00:24 +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 3B08040C1288;
Wed, 27 Jul 2022 17:00:24 +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 D6D2E1945DAB;
Wed, 27 Jul 2022 17:00:23 +0000 (UTC)
Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.rdu2.redhat.com
[10.11.54.5])
by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with
ESMTP id DC7B51945DA2
for ; Wed, 27 Jul 2022 16:31:26 +0000 (UTC)
Received: by smtp.corp.redhat.com (Postfix)
id CF448909FE; Wed, 27 Jul 2022 16:31:26 +0000 (UTC)
Received: from mimecast-mx02.redhat.com
(mimecast08.extmail.prod.ext.rdu2.redhat.com [10.11.55.24])
by smtp.corp.redhat.com (Postfix) with ESMTPS id CAFA218EB7
for ; Wed, 27 Jul 2022 16:31:26 +0000 (UTC)
Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com
[205.139.110.120])
(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
(No client certificate requested)
by mimecast-mx02.redhat.com (Postfix) with ESMTPS id AC8B6384F80C
for ; Wed, 27 Jul 2022 16:31:26 +0000 (UTC)
Received: from mailout1.w1.samsung.com (mailout1.w1.samsung.com
[210.118.77.11]) by relay.mimecast.com with ESMTP with STARTTLS
(version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
us-mta-548-3c9xuU8qMriE4zpXHKcvtA-1; Wed, 27 Jul 2022 12:31:24 -0400
X-MC-Unique: 3c9xuU8qMriE4zpXHKcvtA-1
Received: from eucas1p2.samsung.com (unknown [182.198.249.207])
by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id
20220727162259euoutp0114430c276ece1deddf078f2a72faa660~FvDZuCWj32751827518euoutp01D
for ; Wed, 27 Jul 2022 16:22:59 +0000 (GMT)
DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com
20220727162259euoutp0114430c276ece1deddf078f2a72faa660~FvDZuCWj32751827518euoutp01D
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
Date: Wed, 27 Jul 2022 18:22:45 +0200
Message-Id: <20220727162245.209794-12-p.raghav@samsung.com>
In-Reply-To: <20220727162245.209794-1-p.raghav@samsung.com>
MIME-Version: 1.0
X-Brightmail-Tracker:
H4sIAAAAAAAAA+NgFrrHKsWRmVeSWpSXmKPExsWy7djP87pJaQ+TDCY8Y7NYfbefzWLah5/M
Fr/Pnme2aG3/xmSx991sVoubB3YyWexZNInJYuXqo0wWT9bPYrb423UPKHtL2+LyrjlsFvOX
PWW3mND2ldni89IWdos1N5+yWJy4Je0g6HH5irfHzll32T0uny312LSqk81j85J6j903G9g8
drbeZ/V4v+8qm0ffllWMHptPV3t83iTn0X6gmymAJ4rLJiU1J7MstUjfLoErY9XTI8wFm/Ir
Dk7sYW9g3BjdxcjJISFgIjG/cQFrFyMXh5DACkaJl53d7BDOF0aJ7t6tjCBVQgKfGSU2bbSF
6Tg2cwlU0XJGiRmvJ7FAOM8ZJa5cusTWxcjBwSagJdHYyQ7SICJQLPHwXStYDbPAVyaJzX3v
WUASwgIxEn1/ZjOC1LMIqEr8u5oCEuYVsJbYPXc6C8QyeYmZl76DzeEEim+eMo8JokZQ4uTM
J2A1zEA1zVtnM4PMlxBYzSnxbMpPZohmF4lDZz8zQdjCEq+Ob2GHsGUkTk/ugVpQLfH0xm+o
5hZGif6d68EekADa1ncmB8RkFtCUWL9LH6LcUaK99zQzRAWfxI23ghAn8ElM2jYdKswr0dEm
BFGtJLHz5xOopRISl5vmQC31kHiy9CfLBEbFWUiemYXkmVkIexcwMq9iFE8tLc5NTy02zEst
1ytOzC0uzUvXS87P3cQITIKn/x3/tINx7quPeocYmTgYDzFKcDArifAmRN9PEuJNSaysSi3K
jy8qzUktPsQozcGiJM6bnLkhUUggPbEkNTs1tSC1CCbLxMEp1cBkLOG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EZinR5HxgusgriTc0MzA1NDGzNDC1NDNWEuf1LOhIFBJITyxJ
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
X-RootMTR: 20220727162257eucas1p2848a75c4aa7e559abb5d9ae0fbd374c1
X-EPHeader: CA
CMS-TYPE: 201P
X-CMS-RootMailID: 20220727162257eucas1p2848a75c4aa7e559abb5d9ae0fbd374c1
References: <20220727162245.209794-1-p.raghav@samsung.com>
X-Mimecast-Impersonation-Protect: Policy=CLT - Impersonation Protection
Definition; Similar Internal Domain=false;
Similar Monitored External Domain=false; Custom External Domain=false;
Mimecast External Domain=false; Newly Observed Domain=false;
Internal User Name=false; Custom Display Name List=false;
Reply-to Address Mismatch=false; Targeted Threat Dictionary=false;
Mimecast Threat Dictionary=false; Custom Threat Dictionary=false
X-Scanned-By: MIMEDefang 2.79 on 10.11.54.5
Subject: [dm-devel] [PATCH v8 11/11] dm: add power-of-2 zoned target for
non-power-of-2 zoned devices
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: Pankaj Raghav ,
Damien Le Moal , bvanassche@acm.org,
pankydev8@gmail.com, gost.dev@samsung.com, linux-kernel@vger.kernel.org,
linux-nvme@lists.infradead.org, linux-block@vger.kernel.org,
dm-devel@redhat.com, Johannes Thumshirn ,
jaegeuk@kernel.org, matias.bjorling@wdc.com
Errors-To: dm-devel-bounces@redhat.com
Sender: "dm-devel"
X-Scanned-By: MIMEDefang 2.84 on 10.11.54.2
Authentication-Results: relay.mimecast.com;
auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=dm-devel-bounces@redhat.com
X-Mimecast-Spam-Score: 0
X-Mimecast-Originator: redhat.com
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