Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp1223259iob; Wed, 4 May 2022 17:57:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzoMYeKk8ggXZGURSne6uLeXBvPad6RxwwmKOldjLbq5M7TBhjOoS+wK85YIIh8yQKWv1yO X-Received: by 2002:a17:906:4fc6:b0:6f4:da16:4a09 with SMTP id i6-20020a1709064fc600b006f4da164a09mr3381254ejw.599.1651712278442; Wed, 04 May 2022 17:57:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1651712278; cv=none; d=google.com; s=arc-20160816; b=nne55mvLvIlCL+3kUvq9Vi9Ayo8l+oZtu8/5Pxi7eEE/QgI84Fotjzup+gGCH/Mj/8 Y1roNthULFV3RKCX68pMYut2kRKt6z0WZczrgZcLjINeQTLBJz2qUg0pCwayRn+srIaT wi9iP1HKbg1l7GBU0R2P3grPEI2pt194hAdutQB4wjGJBw4UOOAiufRMM9xn2hUDeO8s ot8ehWR7qyqIe4N0c7YMyoj7e9grJD13xJDwMfbBalk0zyuanuVQYunVnItiM3u5kftN fPuhPY/WdQBopIIhO+uEzM7oiKZoDqiXFZknZ0Fl1dbZZNvrk16csldPijsZMGayYysh 2V2g== 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=QW3cLWpBJkzfWe1x2FW4quPvDQbAoy4RiBj5X+kWFa4=; b=zZNOV88v2sZoEVVICAFZvTfaOGnRJ2wTv2/HKzvy7MBGup2BQaLQAkJeC+QVF9Nz/T BHh/A2F0d4/mH3ImzIEwxIUCVP849htBpjglwLkpUcYdSkinp5JVLr+ajBOg4o3R5y+S SOwN9PNMukBrKf8Ljpnerv9fjF6wRXgstqHx3atvo5Ysha4fOwroVYx24eRTkQgx8DnW dQ9NbvRCeqPG+aDCyxUMAUt+cER9NsqLAGhcBbu5XNn5C3GdvC/sIZnrFHJ+dYNDUpDt 5ZPaBUWm18DGfGQYfb+TcRDuFnwWVbYB1YD6QMQj79NiPqFlVCB+PGRT8rDQ0C7xdsic 1/xw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=TmkYX3mq; 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 go6-20020a1709070d8600b006df76385c48si675541ejc.232.2022.05.04.17.57.35; Wed, 04 May 2022 17:57: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=TmkYX3mq; 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 S1377269AbiEDSui (ORCPT + 99 others); Wed, 4 May 2022 14:50:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48938 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1352734AbiEDSug (ORCPT ); Wed, 4 May 2022 14:50:36 -0400 Received: from mailout1.w1.samsung.com (mailout1.w1.samsung.com [210.118.77.11]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4ECEE140FE for ; Wed, 4 May 2022 11:46:59 -0700 (PDT) Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20220504184655euoutp01f8a76b1eb9016c6e68878630c55f4220~r_1F6GIaK2538325383euoutp01t for ; Wed, 4 May 2022 18:46:55 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20220504184655euoutp01f8a76b1eb9016c6e68878630c55f4220~r_1F6GIaK2538325383euoutp01t DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1651690015; bh=QW3cLWpBJkzfWe1x2FW4quPvDQbAoy4RiBj5X+kWFa4=; h=Date:Subject:To:CC:From:In-Reply-To:References:From; b=TmkYX3mqTZBp0Z+WZOfu42hwLPdLpFUluvxsT5DRrgv6El354pFj1MiHyC8Qea5ib 6ldsOgMLp4vweCAvrjmoHeEJsUj/nlzvj2BLPooVglZTkFF1XJxUca0zOEKS6kvrEz VYHrulG2grOaJwDts50BZu8UNx8cO+573KfBFyR8= Received: from eusmges2new.samsung.com (unknown [203.254.199.244]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20220504184655eucas1p1df3a8d11dd3d8a8de89a2064dc3afb6d~r_1FR7oCQ1842118421eucas1p1A; Wed, 4 May 2022 18:46:55 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges2new.samsung.com (EUCPMTA) with SMTP id C7.FF.09887.E1AC2726; Wed, 4 May 2022 19:46:54 +0100 (BST) Received: from eusmtrp2.samsung.com (unknown [182.198.249.139]) by eucas1p1.samsung.com (KnoxPortal) with ESMTPA id 20220504184654eucas1p12690d7da7df67e21dc347b4c0f84f403~r_1EkTkjB2247422474eucas1p1W; Wed, 4 May 2022 18:46:54 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eusmtrp2.samsung.com (KnoxPortal) with ESMTP id 20220504184654eusmtrp20e7d6549392a9adade0f308525738d82~r_1EjP-J33190631906eusmtrp2M; Wed, 4 May 2022 18:46:54 +0000 (GMT) X-AuditID: cbfec7f4-45bff7000000269f-3a-6272ca1eb13e Received: from eusmtip1.samsung.com ( [203.254.199.221]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id 08.3A.09404.E1AC2726; Wed, 4 May 2022 19:46:54 +0100 (BST) Received: from CAMSVWEXC01.scsc.local (unknown [106.1.227.71]) by eusmtip1.samsung.com (KnoxPortal) with ESMTPA id 20220504184654eusmtip12c62d7628b73df7545fbbbdda5c4c2b1~r_1EVioUp2790327903eusmtip1I; Wed, 4 May 2022 18:46:54 +0000 (GMT) Received: from [192.168.8.130] (106.210.248.170) by CAMSVWEXC01.scsc.local (2002:6a01:e347::6a01:e347) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Wed, 4 May 2022 19:46:51 +0100 Message-ID: <61a72147-292f-b1d0-fbfd-5b34d71a69a0@samsung.com> Date: Wed, 4 May 2022 20:46:50 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.8.1 Subject: Re: [PATCH 04/16] block: allow blk-zoned devices to have non-power-of-2 zone size Content-Language: en-US To: Hannes Reinecke , Damien Le Moal , , , , , , , , , CC: , , , , , , , , , , , , , From: Pankaj Raghav In-Reply-To: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit X-Originating-IP: [106.210.248.170] X-ClientProxiedBy: CAMSVWEXC01.scsc.local (2002:6a01:e347::6a01:e347) To CAMSVWEXC01.scsc.local (2002:6a01:e347::6a01:e347) X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrKJsWRmVeSWpSXmKPExsWy7djP87pyp4qSDNYstbZYf+oYs8Xqu/1s FtM+/GS2OD31LJPFpP4Z7Ba/z55ntrjwo5HJYs+iSUwWK1cfZbJ4sn4Ws0XPgQ8sFn+77gHF Wh4yW/x5aGgx6dA1RounV2cxWey9pW1xedccNov5y56yW0xo+8pscWPCU0aLicc3s1qse/2e xeLELWkHCY/LV7w9/p1Yw+Yxsfkdu8f5extZPC6fLfXYtKqTzWNh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2vbJrusgxWOshNtF/dt5tCS+9X7 MW3xxo+bTDb0KVvNP7xmdeKtZX83+Pa225g0Hno9MeaLo+xR8bvxazVC/OaaL9q3Olii/sX1 vWcO6t8y8+WwdJD/UPCmVO6l/vZUJZbijERDLeai4kQApiWVyO4DAAA= X-CMS-MailID: 20220504184654eucas1p12690d7da7df67e21dc347b4c0f84f403 X-Msg-Generator: CA X-RootMTR: 20220427160300eucas1p1470fe30535849de6204bb78d7083cb3a X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20220427160300eucas1p1470fe30535849de6204bb78d7083cb3a References: <20220427160255.300418-1-p.raghav@samsung.com> <20220427160255.300418-5-p.raghav@samsung.com> X-Spam-Status: No, score=-10.2 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=ham 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 Hi Hannes, Somehow your message did not go through the mailing list. Maybe you hit reply instead of reply all? I have added your reviewed-by tag in the other commits based on your response. Thanks. Anyway, my response to this email below: On 2022-05-04 18:59, Hannes Reinecke wrote: > On 4/27/22 09:02, Pankaj Raghav wrote: >> zone size (%llu)\n", >> -                disk->disk_name, zone->len); >> +        if (zone->len == 0) { >> +            pr_warn("%s: Invalid zoned device size", >> +                disk->disk_name); >>               return -ENODEV; >>           } >>             args->zone_sectors = zone->len; >> -        args->nr_zones = (capacity + zone->len - 1) >> ilog2(zone->len); >> +        args->nr_zones = div64_u64(capacity + zone->len - 1, zone->len); > > This is a different calculation than the one you're using in the first > patch. Can you please add a helper such that both are using the same > calculation? > So this calculation is actually doing a roundup to the nearest zone number operation and not just a division that is done in the block layer helper such as bdev_zone_no(). Note the `zone->len - 1` added to the capacity. This is done to take into account also the last unequal zone size, if present. Another thing to note is that block layer helpers cannot be used here because at this point we haven't set the chunk sectors and we are still in the revalidation callback. Maybe some comments on top of this will help to avoid any confusion? What do you think? And, I am not aware of any generic helper in math.h that does this operation for both 32 and 64 bit architecture. Regards, Pankaj