Received: by 2002:a05:6358:489b:b0:bb:da1:e618 with SMTP id x27csp4961548rwn; Mon, 12 Sep 2022 01:59:58 -0700 (PDT) X-Google-Smtp-Source: AA6agR4ZHovYLg1Yku11+CwjeBNhYssboVfWUFAWB/BxwaG/EGclZE56zXj6bgWTKL+RiZDbbg9k X-Received: by 2002:a17:90a:d585:b0:1f4:f9a5:22a9 with SMTP id v5-20020a17090ad58500b001f4f9a522a9mr23192848pju.49.1662973198631; Mon, 12 Sep 2022 01:59:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662973198; cv=none; d=google.com; s=arc-20160816; b=pTvbkShubDOBwtRnHlguVN5DBW/Fw8BGA+ZTSBRKm3HHTL/Nx6LE3Glut72Cx08mAJ 6ihIe0DVcCnRDiNWSA5B7zdy0gIzPzwDMgzzYUT5Lz7mfq3H72PLO8UzEFHH2EtiorzK tu5SF2HugrJ3VCICxaCRwJzbnULPZRD/LWiBPwGjVUESwaFUOTWWvwa84ZYfWi383/jz UBdnl+SShiuVHDuhfkp3ZPBVjVP7sa7VVQY6Ru2uLqab6CLo098TatDV/s5q+J2nq72V IJFe/j/6Z5F5g7wKRqTrOtJu7rcOGW/pIJEs5K4VJjktUhXUe4WWftmly9eOuBsXJxZt TIdw== 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=ftkn+rR0lj4Sy/gskDw+21f79zgrAIwN+OnLaJGKrK0=; b=j4+2sXqE8JOiHkBuOIY4WC8rORpCVYHqRPXyBVcE9J+qGizVXpm6gsEHQwkNtj0qvx Faq9+TsMgI6yWagRpgbGmy/O3ZApIvsvNnYCp4dalg7NRfJ7iyLZkau0f+aUpPPXEWCY ZHPZ8KTT5+y0MAB/wgWv6nNuTXw5arxyFho9mn49GXf8qXoifoOHuJdjkGZP/yyEW8xP tbrBf1lNXghu6bJDoaK4cT0ZJEPtYxOyt+Ww86idlVnJEaLpw9qGzsaXksM9MvIBP+7D kLB6z6n7l6apTl/ua4mZSoKGblqZZF4YPy1WDZ/B5AIlIEH6I9FlNz4ke0QhHDUSYjnx e3IA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=Vl8lU1VG; 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 188-20020a6300c5000000b0042b4724fb0fsi9447642pga.736.2022.09.12.01.59.46; Mon, 12 Sep 2022 01:59:58 -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=Vl8lU1VG; 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 S230364AbiILIY2 (ORCPT + 99 others); Mon, 12 Sep 2022 04:24:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58942 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230319AbiILIXE (ORCPT ); Mon, 12 Sep 2022 04:23:04 -0400 Received: from mailout2.w1.samsung.com (mailout2.w1.samsung.com [210.118.77.12]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ADD142DA9F for ; Mon, 12 Sep 2022 01:22:57 -0700 (PDT) Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20220912082229euoutp024950c7be10b0d0a87d4509f9d0f5e101~UD0SKiJxq2459324593euoutp02H for ; Mon, 12 Sep 2022 08:22:29 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20220912082229euoutp024950c7be10b0d0a87d4509f9d0f5e101~UD0SKiJxq2459324593euoutp02H DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1662970949; bh=ftkn+rR0lj4Sy/gskDw+21f79zgrAIwN+OnLaJGKrK0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Vl8lU1VGpJkXqAOCU1L/nhF/GP6U10I0FhIY2eZRfiFSxOpYzYxvKRtNAlETjYwn4 NlB0Wda9qSvZaHv8460Q9Yhm971DUm64INn09QCo7Nj8sDUVeqFNI5J99Qg1Az9/Fe MHIh6poFkfNmGrVUyJHmofhh7YQqoU/TObg+yB0I= Received: from eusmges1new.samsung.com (unknown [203.254.199.242]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20220912082221eucas1p2de725c04e5a886be72e457a910c1bf27~UD0KkmiuA2080020800eucas1p2I; Mon, 12 Sep 2022 08:22:21 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges1new.samsung.com (EUCPMTA) with SMTP id C2.A8.29727.D3CEE136; Mon, 12 Sep 2022 09:22:21 +0100 (BST) Received: from eusmtrp2.samsung.com (unknown [182.198.249.139]) by eucas1p2.samsung.com (KnoxPortal) with ESMTPA id 20220912082220eucas1p24605fdcf22aedc4c40d5303da8f17ad5~UD0J9MezM2081220812eucas1p2i; Mon, 12 Sep 2022 08:22:20 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eusmtrp2.samsung.com (KnoxPortal) with ESMTP id 20220912082220eusmtrp2fc7aee3f5acceee3f20a1779396b031f~UD0J8SZqo3116631166eusmtrp2W; Mon, 12 Sep 2022 08:22:20 +0000 (GMT) X-AuditID: cbfec7f2-21dff7000001741f-21-631eec3db4dc Received: from eusmtip1.samsung.com ( [203.254.199.221]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id 35.43.10862.C3CEE136; Mon, 12 Sep 2022 09:22:20 +0100 (BST) Received: from localhost (unknown [106.210.248.191]) by eusmtip1.samsung.com (KnoxPortal) with ESMTPA id 20220912082220eusmtip13a754fbe294b2d7e3ff4976e1d4fa77e~UD0Jj_EIH1380413804eusmtip1C; Mon, 12 Sep 2022 08:22:20 +0000 (GMT) From: Pankaj Raghav To: hch@lst.de, agk@redhat.com, damien.lemoal@opensource.wdc.com, axboe@kernel.dk, snitzer@kernel.org Cc: linux-kernel@vger.kernel.org, Johannes.Thumshirn@wdc.com, linux-nvme@lists.infradead.org, pankydev8@gmail.com, matias.bjorling@wdc.com, linux-block@vger.kernel.org, bvanassche@acm.org, gost.dev@samsung.com, dm-devel@redhat.com, hare@suse.de, jaegeuk@kernel.org, Pankaj Raghav , Johannes Thumshirn , Damien Le Moal Subject: [PATCH v13 13/13] dm: add power-of-2 target for zoned devices with non power-of-2 zone sizes Date: Mon, 12 Sep 2022 10:22:04 +0200 Message-Id: <20220912082204.51189-14-p.raghav@samsung.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220912082204.51189-1-p.raghav@samsung.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFnrEKsWRmVeSWpSXmKPExsWy7djP87q2b+SSDaY95bVYf+oYs8Xqu/1s FtM+/GS2+H32PLNFa/s3Jou972azWtw8sJPJYs+iSUwWK1cfZbJ4sn4Ws8XfrntA2VvaFpd3 zWGzmL/sKbvFhLavzBafl7awW6y5+ZTF4sQtaQchj8tXvD12zrrL7nH5bKnHplWdbB6bl9R7 7L7ZwOaxs/U+q8f7fVfZPPq2rGL02Hy62uPzJjmP9gPdTAE8UVw2Kak5mWWpRfp2CVwZ/yYF FtyprZi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8XfrntA2VvaFpd3 zWGzmL/sKbvFhLavzBafl7awW6y5+ZTF4sQtaQchj8tXvD12zrrL7nH5bKnHplWdbB6bl9R7 7L7ZwOaxs/U+q8f7fVfZPPq2rGL02Hy62uPzJjmP9gPdTAE8UXo2RfmlJakKGfnFJbZK0YYW RnqGlhZ6RiaWeobG5rFWRqZK+nY2Kak5mWWpRfp2CXoZ/yYFFtyprZi2u4GtgfFlchcjJ4eE gInE569NLF2MXBxCAksZJdbPWM0IkZCQuL2wCcoWlvhzrYsNoug5o8SfuTOBEhwcbAJaEo2d 7CA1IgK5Ep9X/mADsZkFFjJLPOvOBbGFBVIltu+6ygRiswioSjy+3wlm8wpYSaw/tYwZYr68 xMxL38HmcALFX69qBdsrJGApcfbbDXaIekGJkzOfsEDMl5do3jqbeQKjwCwkqVlIUgsYmVYx iqSWFuem5xYb6RUn5haX5qXrJefnbmIERu62Yz+37GBc+eqj3iFGJg7GQ4wSHMxKIrwshtLJ QrwpiZVVqUX58UWlOanFhxhNge6eyCwlmpwPTB15JfGGZgamhiZmlgamlmbGSuK8ngUdiUIC 6YklqdmpqQWpRTB9TBycUg1MRkYignad2ieSd1oEzromyPT4ojOf4IG6zb/U1yecWfj7HXvq V17TFE25Z3ZPbm7Yx715251GF/UN8oJ3Jp1NnfL36XzWhqAMa5+Eu68f2Ws2+8za1qEjk+yt rmj/wv9+bo1hXE/fJfkXbHYri08xfy5wWfb+vPu6/4vqpT2nnyvXFHSy4/6sEBN7YNOT26/u N0if3eDLkVw/d6nw51afEj5l11lzRCSO3mu5Iu7xUkLYobSSYYVkqQTH111r57qkmkWe+7T0 0Vrf7RNvyjxuuPu3ize27cjP+mrNO4L5K82jVlnfbNt4zOTLh63aGdNZ42f3FFl18kglNatb vdl0b937dGGZmIvOS6YsW+6mxFKckWioxVxUnAgAANycVmUDAAA= X-CMS-MailID: 20220912082220eucas1p24605fdcf22aedc4c40d5303da8f17ad5 X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" X-RootMTR: 20220912082220eucas1p24605fdcf22aedc4c40d5303da8f17ad5 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20220912082220eucas1p24605fdcf22aedc4c40d5303da8f17ad5 References: <20220912082204.51189-1-p.raghav@samsung.com> X-Spam-Status: No, score=-7.1 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, T_SCC_BODY_TEXT_LINE 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 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 zone size target so that file systems can initially work without any explicit changes. 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 value. 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