Received: by 2002:a05:7412:3b8b:b0:fc:a2b0:25d7 with SMTP id nd11csp2479311rdb; Mon, 12 Feb 2024 06:21:13 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXr4QQAovi7G6LEAC5CP1yfS3+KeaWlgo9yZCZHUFk6JGdAvy1mwRLJWO+9uW96os5oCNJSz7g/1Jl+JVb6uAVTCwaahPEl12os3jyhYw== X-Google-Smtp-Source: AGHT+IHX351YMFMzc1FfDh00Dz2o2jcmOTCd/Y7XccC5lms7ziXJf5JEl7J7kRdbrx/1dRUHI3fi X-Received: by 2002:a05:6830:a50:b0:6dd:ef0b:4f7c with SMTP id g16-20020a0568300a5000b006ddef0b4f7cmr5439033otu.34.1707747673071; Mon, 12 Feb 2024 06:21:13 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707747673; cv=pass; d=google.com; s=arc-20160816; b=FlxkLmTC/SyisrKkZrxjzZihFoSR2uo42Y/tjFEdwdlgzVYOn0APSWfHLUPa86Aj+T RTOLcwXv7bxU6kiiMcPFedzjtqtB4g5J+h/ds3iq1m9DwUGFTsQDArUbOlwBA0Rmer73 tW6BANkgPI7ETsXfqpwGfJu1fF+K/tsEJzAjPHJU+mTsd+BksUrTQk8OgkBBjYQHEf95 t31LvqY1P9Fk5mOkScdVCQlHbg11AmQ+HXWp2hFTnfSsKeRyJNhk7ePst9XL+TCPB/Yz HA+cI8pSa9glydGlULBEKnwHDylGpaqaMXGEfYmQji0PefvMLnmtWnbGhRXxd67s95S/ 3zKw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:organization:references :in-reply-to:message-id:subject:cc:to:from:date:dkim-signature; bh=7rZfjdEu2RYZ/9BtHHNLkIKbP50Gk/4PTrBnkkv9ErI=; fh=cBK926ClUtyrffO6fhU7WB3k2MhzizfsqooQ4Sv676Q=; b=XgafTRCrI+TtzLhGAPJWcSGgWt5mTo2k+zFftcMkWLKdnW7CyrSp8bvx4vmizi6ZMT 5QjOMOjjv2cSf7JnuzxHZ26iUauiBNEkf/9OEfYHOB2yB9DlKf3PTP5GqAlReFeJw+DR 48eUrN/HNtD+epeQogt5iNespZdrBHK+cjQepV8QRvgI6UzVzz5hOKfQiuS8e3nDYi6X 94yhbJddFfN7Jzh/K17oyctRySWt8n1Hjhm0TUxLYp+8bUFLpYlEeo7qnac8laO1ZNhM d9YxvuaCs8CtdtghherzpBNgBHg5Rjb70rmMpOIEk0bwQqS4mSlfhg5V447nX1szrhT6 hjLw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=HCqZorbz; arc=pass (i=1 spf=pass spfdomain=bootlin.com dkim=pass dkdomain=bootlin.com dmarc=pass fromdomain=bootlin.com); spf=pass (google.com: domain of linux-kernel+bounces-61818-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-61818-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com X-Forwarded-Encrypted: i=2; AJvYcCVi+hlCNntTDi18swssylxI7YhlF6UiCAYYjef8pmlYIgG7TH4fBUWYt2/BXChRMoKBUTOnWsM/DTpFOJBFUylyzHa2dBYDpnEsBwZGFw== Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id h19-20020ac85153000000b0042c652314adsi424598qtn.429.2024.02.12.06.21.12 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 12 Feb 2024 06:21:13 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-61818-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=HCqZorbz; arc=pass (i=1 spf=pass spfdomain=bootlin.com dkim=pass dkdomain=bootlin.com dmarc=pass fromdomain=bootlin.com); spf=pass (google.com: domain of linux-kernel+bounces-61818-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-61818-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 098BB1C22A5B for ; Mon, 12 Feb 2024 14:21:02 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1D18A3BB27; Mon, 12 Feb 2024 14:20:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b="HCqZorbz" Received: from relay1-d.mail.gandi.net (relay1-d.mail.gandi.net [217.70.183.193]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B00FF3B191; Mon, 12 Feb 2024 14:20:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.70.183.193 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707747636; cv=none; b=LHYX9sWedxnNuSYRjqCbYz5R32337bMs7wxjZlndC6btn9JfTrmSf9a1c5KsZEcQflV5pUI6XXDO2XqAq8cdDem/yhjiUejaCXZwxt6oP5cWoN4CPWTfPe236UsJ82L60RYZPQgPRB3GCPX80exV/6K9fZ26hYr9JMXBhVk/f2A= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707747636; c=relaxed/simple; bh=HOOFzuqzT3fIYr/DIX8rmV3hi9Jkc6ezbSFq2yKsCNk=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=VG/CRTE13qnovFd4WS8gcTLAkNk+wisACYnOjX+Tp3GU7I+lFd5haHZyw9R9nl4jBephavrdxxF7lr+VUEB2r0veYSBKCbJyXsKb0Ip/hBPvPB+bsel497+bLDflX26rpB29jvQYKyjQah8QH8VuXk//jBnndPeCikhTGVbMQSo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.b=HCqZorbz; arc=none smtp.client-ip=217.70.183.193 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Received: by mail.gandi.net (Postfix) with ESMTPSA id 0A14A240004; Mon, 12 Feb 2024 14:20:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1707747626; h=from:from: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; bh=7rZfjdEu2RYZ/9BtHHNLkIKbP50Gk/4PTrBnkkv9ErI=; b=HCqZorbzy0esT9Eqv/sS9A2HZ4FrwPc/w9nx9jaj7DuOm8mxgj0PaRgWzh3jdZ9NbCOENL 63gi1eZ8V05xzYU+5d4HG8vIdGBid9lAJaH/XrJq6obsJSREHR+qvy/iqMsZAZvHZ1pQB6 yBcCy1YzjUqElDP4fDnwpM8RIknbl5fJ7KxsqeXwhl2iUHLx3OIXOS+lF46ITJQHzcaIAN q7/oWSa5EItG6QLW4IUMlLgNQywuaw/+4aPDawbHlvep8ZtTaO14bs+nLGsIQszn0JBk/7 +Hljz66sK0u46tlT3ZmnMEOnVaB6/aBbX7tQ8MJ0KONxqtfUdGAiNbu3O6v9XA== Date: Mon, 12 Feb 2024 15:20:22 +0100 From: Herve Codina To: Andy Shevchenko Cc: Vadim Fedorenko , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Yury Norov , Rasmus Villemoes , linux-kernel@vger.kernel.org, netdev@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, Andrew Lunn , Mark Brown , Christophe Leroy , Thomas Petazzoni Subject: Re: [PATCH v3 RESEND 3/6] bitmap: Make bitmap_onto() available to users Message-ID: <20240212152022.75b10268@bootlin.com> In-Reply-To: References: <20240212075646.19114-1-herve.codina@bootlin.com> <20240212075646.19114-4-herve.codina@bootlin.com> <20240212143753.620ddd6e@bootlin.com> Organization: Bootlin X-Mailer: Claws Mail 4.2.0 (GTK 3.24.38; x86_64-redhat-linux-gnu) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-GND-Sasl: herve.codina@bootlin.com On Mon, 12 Feb 2024 16:01:38 +0200 Andy Shevchenko wrote: > On Mon, Feb 12, 2024 at 02:37:53PM +0100, Herve Codina wrote: > > On Mon, 12 Feb 2024 14:27:16 +0200 > > Andy Shevchenko wrote: > > > On Mon, Feb 12, 2024 at 08:56:31AM +0100, Herve Codina wrote: > > > > Currently the bitmap_onto() is available only for CONFIG_NUMA=y case, > > > > while some users may benefit out of it and being independent to NUMA > > > > code. > > > > > > > > Make it available to users by moving out of ifdeffery and exporting for > > > > modules. > > > > > > Wondering if you are trying to have something like > > > https://lore.kernel.org/lkml/20230926052007.3917389-1-andriy.shevchenko@linux.intel.com/ > > > > Yes, it looks like. > > Can you confirm that your bitmap_scatter() do the same operations as the > > existing bitmap_onto() ? > > I have test cases to be 100% sure, but on the first glance, yes it does with > the adjustment to the atomicity of the operations (which I do not understand > why be atomic in the original bitmap_onto() implementation). > > This actually gives a question if we should use your approach or mine. > At least the help of bitmap_onto() is kinda hard to understand. Agree, the bitmap_onto() code is simpler to understand than its help. I introduced bitmap_off() to be the "reverse" bitmap_onto() operations and I preferred to avoid duplicating function that do the same things. On my side, I initially didn't use the bitmap_*() functions and did the the bits manipulation by hand. During the review, it was suggested to use the bitmap_*() family and I followed this suggestion. I did tests to be sure that bitmap_onto() and bitmap_off() did exactly the same things as my previous code did. > > > If so, your bitmap_gather() will match my bitmap_off() (patch 4 in this > > series). > > Yes. > Regards, Hervé