Received: by 2002:a05:6a10:1287:0:0:0:0 with SMTP id d7csp5071840pxv; Wed, 28 Jul 2021 02:21:09 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzVsBVyl+xOmsZzIOc8qO4ga4dx3IHg5G9UUXnF9boFJ9C84Dyk43vg5kHnwVkUks9Sv0OI X-Received: by 2002:a17:906:2bc9:: with SMTP id n9mr15172193ejg.23.1627464068955; Wed, 28 Jul 2021 02:21:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627464068; cv=none; d=google.com; s=arc-20160816; b=I0rjKTVdSEFv+LU0pX6vn3jDKcZY0QAMFjsxOFcjWZRDIH0EiaVKbg+/eVRiSMNmYC 0TMmSSf6osj6RkXIQcZZkDITVn5VHVSFNBcAf3isZQyNVecQD5zaBqxuQSOT7rzhA/+C 0vT4OT5JWHJYKapfNtqjQJh7Avup169NRfRlKysLbuTCayW7ls7NVvHP4UZhKNU0RMMm 0tdrx1wgh0cS5WMwe+GJZr8eP62t8vuCmFzpjQPbHwm/W8aJOIaRRMyv1sC0R0d0iPpq ns3onwACGomNOFyrKQbn9ZQ86fYDmjVZsbKudzyxqzBQAHM1v5NxSIlpslFdyXmPD98x FGnA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=q8tz0lmFVcXyPsYMxnRVzzQrkyomXcwXgEWm5HC4cJw=; b=n42h2VNMY9z8lQFZ3tzhFYWHF2mU/l5Q2lwrWlDKDc+mVATCtNoS+XrdZcO/wrFYBD 7CR2iWB9Vnp0AegFUjqaml8vghRGE1C/NvJpzh9pGwj7NDktrCXcyTUc/2QGpRAar2mR VCH7sf/5e4E0pBQvPNpuZ/j5A3A66WCeHmjmd5ZULPsl71f3F+2xdM5/8bRhJbDSexFD al/YAXuolq5If2YPsa89khyFjfvrLFJrBAss07I0erZGyMRA8WYAxtj4Kg2qo6KG/w2j VhL12gR0dOQbsLkKXekRZ69vJyZRJ4DFVbf5Y2NFCYq9fG1N5gIwuWslKeLJNTdxQxEX huKg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=EQ29uUAs; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u17si5191382ejx.612.2021.07.28.02.20.45; Wed, 28 Jul 2021 02:21:08 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=EQ29uUAs; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231328AbhG1JTZ (ORCPT + 99 others); Wed, 28 Jul 2021 05:19:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51734 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231282AbhG1JTY (ORCPT ); Wed, 28 Jul 2021 05:19:24 -0400 Received: from mail-pl1-x636.google.com (mail-pl1-x636.google.com [IPv6:2607:f8b0:4864:20::636]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C551AC061757 for ; Wed, 28 Jul 2021 02:19:22 -0700 (PDT) Received: by mail-pl1-x636.google.com with SMTP id d17so1887720plh.10 for ; Wed, 28 Jul 2021 02:19:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=q8tz0lmFVcXyPsYMxnRVzzQrkyomXcwXgEWm5HC4cJw=; b=EQ29uUAsK6hRusefMY6zPuXHY3mMarlsE3NWmYOCPiNaZpdYC9VMPIt4vmqAilHvy2 azNvc42lRl89dGDfv6j6M5MU0sWupsbFrnd1ZkDiEM1Vtatppus5qzejTdwgOlhQPucz l8bDdC0E1xJD/jUc8/3rt2NQa7FMs/M5SNw6Ldk6kiFmKExyjKrT6cRtb1dNyWwB1Gp9 EsuRTDTC/x0orCnw3azi55noXdEJLg8QJv/QzkBh9WAyCj+gX1OL0ayKlLqN0hflKYsO tSpZnjul/CVCtVBlHKk9pnBHqGUO8HtCm+PI2H5JHQKBsQrGoGdzxTsDRJgkb04o/8jH l96A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=q8tz0lmFVcXyPsYMxnRVzzQrkyomXcwXgEWm5HC4cJw=; b=GlPcNnXAmtZAjXBRPd29sDnNDzHOt0DenucoseSvwMUlSI9SZAAPuWVNksylonxKiZ LLYkMFKLeX12FPTGNVFIotHg2cW7GohvhdQrN/42JxB9NyDewYHvp08StWYzD2Rd2sqR SuVPswenJe1abpKtpXFTiMGWU2luJoLLRT+v5WNt0PW53BImIVzpizb1L4N7TuN4lVE4 KoVQ9OfYPWD69X7pCfmSuRXTWKgYFgD+NZYo+GwWTt5x46fBJiOlNirTBzMKNHimvwC8 7OpGYdTBmuzLA0qZNItCFnqulUTmdh4bOw7aWKoKSjHOmttL2AcwFVRMuK1OevoIQt8N zp9w== X-Gm-Message-State: AOAM532Yybuymgnsva0eZqknBEIpZehggBOtHprC9F+rPsE5/9czhWvm oBikRJViRalqmosyrDDBUic/f/BLltnndg92NRc= X-Received: by 2002:a63:cf0a:: with SMTP id j10mr28417501pgg.4.1627463962184; Wed, 28 Jul 2021 02:19:22 -0700 (PDT) MIME-Version: 1.0 References: <20210727094441.9815-1-andrea.merello@gmail.com> In-Reply-To: From: Andy Shevchenko Date: Wed, 28 Jul 2021 12:18:46 +0300 Message-ID: Subject: Re: [PATCH v1 1/1] bitmap.h: add const modifier to bitmap_next_[set/clear]_region() argument To: Andrea Merello Cc: Yury Norov , Andy Shevchenko , Bartosz Golaszewski , linux-kernel , Rasmus Villemoes , Andrea Merello Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jul 28, 2021 at 9:39 AM Andrea Merello wrote: > Il giorno mar 27 lug 2021 alle ore 17:26 Yury Norov > ha scritto: > > On Tue, Jul 27, 2021 at 02:48:42PM +0300, Andy Shevchenko wrote: ... > > I try to remove those two because in practice they bring more mess > > than good. All real use-cases for bitmap_next_{set,clear}_region > > relate to iterating the whole bitmap, ie nobody just wants to find a > > next region. Untill recently there was only a single user of the API, > > so I easily reworked the code to use find_first_bit/find_next bit and > > by chance return faster. > > Ah, that's interesting to know: I'm working on a new driver that used > find_next_zero_bit() and find_next_bit() [0]; Andy told me that my > algorithm could be rewritten exploiting some bitmap_* helpers, so I > rewrote my code using bitmap_for_each_set_region(), which in turn uses > bitmap_next_set_region(). > > Should I revert to my previous implementation that uses > find_next_zero_bit() and find_next_bit() ? According to the https://github.com/norov/linux/commit/a2d6e02d19450a49a55f08c151d1f704723bec1a they are transformed to for_each_bitrange(), etc. ... > Looks like also bitmap_for_each_set_region() went away indeed ? See above. -- With Best Regards, Andy Shevchenko