Received: by 2002:a05:6358:bb9e:b0:b9:5105:a5b4 with SMTP id df30csp3105957rwb; Mon, 5 Sep 2022 06:36:26 -0700 (PDT) X-Google-Smtp-Source: AA6agR7nXsqU0HBTgFRo3Agzeqa/fhxf9zJK0dbCQirw+8ZOKtysN3d/j1iKQXBquh4ERYs9AkDg X-Received: by 2002:a17:907:1606:b0:73d:b512:d91d with SMTP id hb6-20020a170907160600b0073db512d91dmr35754125ejc.276.1662384985947; Mon, 05 Sep 2022 06:36:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662384985; cv=none; d=google.com; s=arc-20160816; b=EBrz0uULEEs+sAMSnY4myi25K0LbL+XDHFMO/FDcEYwZG+7UWIj3H3r5XOZGzSyP4k BkM791T3oJUE7zJqSk66phNVDNBimeaJWVVs+709k5b0ICsEUWUTFXT9qdjtCT678/+V hbikCEoGYBvEdCl4BYEfAxh5vKOA/2weqs0ZtB/DCYAXzKyDL170SfIyudrXlhrEXqDH 1QIzpDsBHX10HCQnRRC44I0Qggk4XaXTOlFSQy+Gb6gDuVRPdS0tdcuspIZKDD7rw+hA NGBaGi8KBpNqsevT7giKXcqUINdAU+dzBuYFLtO6KhLVcgOObrbaX2iT29F/q4ul31+j 3vjg== 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 :in-reply-to:from:cc:to:content-language:subject:user-agent :mime-version:date:message-id:dkim-signature:dkim-filter; bh=0NOo6f/pWYXuPoQFfjEOXBVE2XC8pCS60UOPZi9RzHU=; b=l3ZPvlNOdB6YuCDxH+4445jscNWsKYorXwAYuH40UI+8zSWfXAabwX2xphHwnLecEB JbaDGddmIdGid46tTOk2qK41aQXv7yszeaWqxb/h+QAOdQoMHfRcZEzRD5WEPF0UtHou B8MKPNl2WOztdXFqBRSawsQhKK6H9A41hw28yI7ApAXPed0X/mHlQ6g8q7n0C8glQTtW tjk9HSF40TB5NEC/4AqDmfpJ+BXEcJ3fCLhl4zlWAM5YF0Q2lZ2GZRpvDwc/0QbRPuK9 TlvuVvYX5Gq0qtCuytDDtLUteFBZndVUkMLH37mympk20hEw484+zceK+bNqO0pgx1yw ZXuQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=NN+9eXvz; 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 eg51-20020a05640228b300b00445b19945desi482961edb.304.2022.09.05.06.35.57; Mon, 05 Sep 2022 06:36:25 -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=NN+9eXvz; 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 S237510AbiIEM5c (ORCPT + 99 others); Mon, 5 Sep 2022 08:57:32 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35730 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236829AbiIEM53 (ORCPT ); Mon, 5 Sep 2022 08:57:29 -0400 Received: from mailout2.w1.samsung.com (mailout2.w1.samsung.com [210.118.77.12]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B3B3E205D8 for ; Mon, 5 Sep 2022 05:57:28 -0700 (PDT) Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20220905125717euoutp027248ac07bcd2254342a6b7f8dd347fc7~R_DNufX_L0936709367euoutp02C for ; Mon, 5 Sep 2022 12:57:17 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20220905125717euoutp027248ac07bcd2254342a6b7f8dd347fc7~R_DNufX_L0936709367euoutp02C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1662382637; bh=0NOo6f/pWYXuPoQFfjEOXBVE2XC8pCS60UOPZi9RzHU=; h=Date:Subject:To:CC:From:In-Reply-To:References:From; b=NN+9eXvzx0lqZ+64NZjyuQcp9cbTMwvnURrGMqQAJOLw4mJGZta+4rDN3bpUCMeLV 1c1uJC0Bwsodqxj30MPpsMMv7aGMcuANdoOtdk7VtJduK6Ejo8JGZNEad5/Wimjl9F 3/o1M2L9YH+PblB1DjmCavRP82rbafXmBnnxAYN4= Received: from eusmges3new.samsung.com (unknown [203.254.199.245]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20220905125712eucas1p27c789651a573fe2b0f6774b0a5c7889f~R_DI2eCzV1056610566eucas1p2j; Mon, 5 Sep 2022 12:57:12 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges3new.samsung.com (EUCPMTA) with SMTP id 1D.2C.19378.722F5136; Mon, 5 Sep 2022 13:57:11 +0100 (BST) Received: from eusmtrp2.samsung.com (unknown [182.198.249.139]) by eucas1p1.samsung.com (KnoxPortal) with ESMTPA id 20220905125711eucas1p12e53a64104034b1a8dca6ada0a79cf94~R_DIcHdgG1238212382eucas1p1v; Mon, 5 Sep 2022 12:57:11 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eusmtrp2.samsung.com (KnoxPortal) with ESMTP id 20220905125711eusmtrp20c331e84f5a49de8bce1b5aa4250139d~R_DIbOf650766107661eusmtrp2u; Mon, 5 Sep 2022 12:57:11 +0000 (GMT) X-AuditID: cbfec7f5-a35ff70000014bb2-e1-6315f2279068 Received: from eusmtip1.samsung.com ( [203.254.199.221]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id 15.CB.10862.722F5136; Mon, 5 Sep 2022 13:57:11 +0100 (BST) Received: from CAMSVWEXC01.scsc.local (unknown [106.1.227.71]) by eusmtip1.samsung.com (KnoxPortal) with ESMTPA id 20220905125711eusmtip19aba6d939273cea0e9076ccec1896a95~R_DILN56f3006530065eusmtip1b; Mon, 5 Sep 2022 12:57:11 +0000 (GMT) Received: from [106.110.32.100] (106.110.32.100) by CAMSVWEXC01.scsc.local (2002:6a01:e347::6a01:e347) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Mon, 5 Sep 2022 13:57:10 +0100 Message-ID: <67726654-2c13-2c41-c002-30dc99db8497@samsung.com> Date: Mon, 5 Sep 2022 14:57:08 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0 Subject: Re: [PATCH v12 13/13] dm: add power-of-2 target for zoned devices with non power-of-2 zone sizes Content-Language: en-US To: Mike Snitzer CC: , , , , , Damien Le Moal , , , Johannes Thumshirn , , , , , , , From: Pankaj Raghav In-Reply-To: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Originating-IP: [106.110.32.100] X-ClientProxiedBy: CAMSVWEXC01.scsc.local (2002:6a01:e347::6a01:e347) To CAMSVWEXC01.scsc.local (2002:6a01:e347::6a01:e347) X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrPKsWRmVeSWpSXmKPExsWy7djP87rqn0STDbattbRYf+oYs8Xqu/1s FtM+/GS2+H32PLNFa/s3Jou972azWqxcfZTJ4sn6WcwWf7vuAcVuaVtc3jWHzWL+sqfsFhPa vjJbrLn5lMXixC1pi7aNXxkdBDwuX/H22DnrLrvH5bOlHptWdbJ5bF5S77H7ZgObx87W+6we 7/ddZfP4vEnOo/1AN1MAVxSXTUpq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wMAAA== X-CMS-MailID: 20220905125711eucas1p12e53a64104034b1a8dca6ada0a79cf94 X-Msg-Generator: CA X-RootMTR: 20220823121915eucas1p10296d6a2ab00de5e73791a7d6b8e39de X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20220823121915eucas1p10296d6a2ab00de5e73791a7d6b8e39de References: <20220823121859.163903-1-p.raghav@samsung.com> <20220823121859.163903-14-p.raghav@samsung.com> X-Spam-Status: No, score=-8.8 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A, 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 >> >> 1) why is a partial mapping of the underlying device disallowed? >> 2) why is it assumed all IO is read-only? (talk to me and others like >> we don't know the inherent limitations of this class of zoned hw) >> >> On a code level: >> 1) are you certain you're properly failing all writes? >> - are writes allowed to the "zone capacity area" but _not_ >> allowed to the "emulated zone area"? (if yes, _please document_). >> 2) yes, you absolutely need to implement the .status target_type hook >> (for both STATUS and TABLE). >> 3) really not loving the nested return (of DM_MAPIO_SUBMITTED or >> DM_MAPIO_REMAPPED) from methods called from dm_po2z_map(). Would >> prefer to not have to do a depth-first search to see where and when >> dm_po2z_map() returns a DM_MAPIO_XXX unless there is a solid >> justification for it. To me it just obfuscates the DM interface a >> bit too much. >> >> Otherwise, pretty clean code and nothing weird going on. >> >> I look forward to seeing your next (final?) revision of this patchset. > > Thinking further.. I'm left confused about just what the heck this > target is assuming. > > E.g.: feels like its exposing a readonly end of the zone is very > bi-polar... yet no hint to upper layer it shouldn't write to that > read-only end (the "emulated zone").. but there has to be some zoned > magic assumed? And I'm just naive? > You are absolutely right about "zoned magic". Applications that use a zoned block device are aware of the zone capacity and zone size. BLKREPORTZONE ioctl is typically used to get the zone information from a zoned block device. This target adjusts the zone report so that zone size and zone capacity are modified correctly (see dm_po2z_report_zones() and dm_po2z_report_zones_cb() functions).