Received: by 2002:ac0:de83:0:0:0:0:0 with SMTP id b3csp767708imk; Sun, 3 Jul 2022 08:23:10 -0700 (PDT) X-Google-Smtp-Source: AGRyM1vKx7vzKaR6nhJAhwrZmnkecQk5y8Er1lEzJkeizpkceMriw4lGsFnBLuvi1WEOe1s/3Smu X-Received: by 2002:a17:906:6015:b0:726:95c1:924f with SMTP id o21-20020a170906601500b0072695c1924fmr23497024ejj.576.1656861789997; Sun, 03 Jul 2022 08:23:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656861789; cv=none; d=google.com; s=arc-20160816; b=sf8qTZ2WkfG4BT9FTVAVpt9rLlVx/PK1hVN510dA7a+8T8I2dSai2li2snbNSGiW1A KJmEnN8t5JMxLLqVDPJ5DI4z1Wj2V7Uf8qoviyyf+DVRCGEcYD6DcLcPACSMOn+Hu5bj hm5+lxgDDMFn9HDYbROrN17xmKnij3TxvjAVDHTTLIBoFw2MxcyE2+9r9xMvrJOjAfWt xk6aH0y+6f0vdDi+tBrl0fms88MFMno84HOgRyzskVheHIxA+LK5/ksxXN0kyl6ctrxQ GMuXqK2F/i13Rib/14JiYCnrp14Hvj1orKtx1uamfukYBqzn7AIdIFs4xQUvy946PIb4 lOLg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:organization:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=dC0+1486F7zAvZkRZiHTG7IqJKZisf7lpO9S+/ZQqfM=; b=GriZy5mqQfOgUFYC81/PeAoGwR9AVMu4+5posInfNwv751tHTm2fOTH58+Jo4z56oY SWl002BV5DVJB7BbMANzUV4G0gj8POo3W5WkbzHi70QvRdWL9lxcSwKNhpIlu+OVocRz GQKJzXugIwa4LXs+ResDQ/K4qhppI0e3RrnR0KZYCqsQ/h2SY3EEafxfc8DGUMGZfz7k l0MaKQOd3FA3ZKNGuHyIFsDFYXpvDQCpagCnXRGlIVzrTTncAYKGDrQCkpKlNpy+OmSj heVrD3xsBUuUeDG17hrLTARosL8aVPxzhksqiF0cm9OVG4Kwt9Jk/8si/lJ+ngnrcB3L 2JXQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="hk/DyHci"; 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=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j14-20020a170906050e00b00722e541f5c7si5083598eja.605.2022.07.03.08.22.45; Sun, 03 Jul 2022 08:23:09 -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=@intel.com header.s=Intel header.b="hk/DyHci"; 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=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232629AbiGCPVD (ORCPT + 99 others); Sun, 3 Jul 2022 11:21:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35106 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230446AbiGCPVD (ORCPT ); Sun, 3 Jul 2022 11:21:03 -0400 Received: from mga06.intel.com (mga06b.intel.com [134.134.136.31]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F2F408F; Sun, 3 Jul 2022 08:21:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1656861662; x=1688397662; h=date:from:to:cc:subject:message-id:references: mime-version:content-transfer-encoding:in-reply-to; bh=jXW12Ga9G65nqsGYdHBdlWQ5IJhoQ1DN2e8R+iyO4VE=; b=hk/DyHciJM43sj1vk/J/swjmBjYo7E5A2DOKeMwRRGO2NiDWKNbzGitB TpMXFuqxNrpgWQmhbplFPN1uxQgRQbTZHTzzvek/3JZe2PiWRbfhLVmB1 FsxA5BVa0+gwSLkVMZ1EZRWyQJ8Y8zUU1nLmq92EwAHqqkTBOX1EzhXXw X6h5Os2mURtjstKAmNEdYw8114nF0ve2LJaceQ4jr8isKGXb4lN3QDGoD N1Z+11C4X5jEjybf4fMq27Z4CJWRx8u3L3RTZXnUJp/CjuJIpVBcd4M4Y ngZ2VJR3Yz23HV5f+Y/4I6+/iwfsaM/Z2Vi4d3KVfCQBkVLLI4Z4GhYfX Q==; X-IronPort-AV: E=McAfee;i="6400,9594,10397"; a="344639160" X-IronPort-AV: E=Sophos;i="5.92,241,1650956400"; d="scan'208";a="344639160" Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Jul 2022 08:21:01 -0700 X-IronPort-AV: E=Sophos;i="5.92,241,1650956400"; d="scan'208";a="542233739" Received: from smile.fi.intel.com ([10.237.72.54]) by orsmga003-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 03 Jul 2022 08:20:57 -0700 Received: from andy by smile.fi.intel.com with local (Exim 4.96) (envelope-from ) id 1o81P4-0014Px-0j; Sun, 03 Jul 2022 18:20:54 +0300 Date: Sun, 3 Jul 2022 18:20:53 +0300 From: Andy Shevchenko To: Christophe JAILLET Cc: Yury Norov , agk@redhat.com, snitzer@kernel.org, dm-devel@redhat.com, vneethv@linux.ibm.com, oberpar@linux.ibm.com, hca@linux.ibm.com, gor@linux.ibm.com, agordeev@linux.ibm.com, borntraeger@linux.ibm.com, svens@linux.ibm.com, almaz.alexandrovich@paragon-software.com, linux@rasmusvillemoes.dk, linux-s390@vger.kernel.org, ntfs3@lists.linux.dev, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: Re: [PATCH 3/4] bitmap: Introduce bitmap_size() Message-ID: References: <98f5d3d855a9c687ccc035edf62016b02a6876b7.1656785856.git.christophe.jaillet@wanadoo.fr> <4dc5d50a-2291-1d3a-efac-3f6378a15d69@wanadoo.fr> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <4dc5d50a-2291-1d3a-efac-3f6378a15d69@wanadoo.fr> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo X-Spam-Status: No, score=-5.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE,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 On Sun, Jul 03, 2022 at 08:50:19AM +0200, Christophe JAILLET wrote: > Le 02/07/2022 ? 23:09, Yury Norov a ?crit?: > > On Sat, Jul 02, 2022 at 08:29:36PM +0200, Christophe JAILLET wrote: ... > > This should be dropped, for sure, and kmalloc() at line 128 should be > > replaced with bitmap_alloc(). > > This kmalloc() is for a structure and a flexible array. > > You mean re-arranging the code to allocate the structure alone at first, > then the bitmap? It's one way, but it will increase fragmentation of memory. The other one as it seems to me is to name a new API properly, i.e. bitmap_size_to_bytes(). In such case you won't need renames to begin with. And then would be able to convert driver-by-driver in cases of duplicated code. I think that's what confused Yuri and I kinda agree that bitmap_size() should return bits, and not bytes. Also argument for pure bitmap_size() would be bitmap itself, but we have no way to detect the length of bitmap because we are using POD and not a specific data structure for it. -- With Best Regards, Andy Shevchenko