RE: [PATCH 2/9] lib/bitmap: implement bitmap_{empty,full} with bitmap_weight_eq()
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
- To: "'Yury Norov'" <yury.norov@xxxxxxxxx>, Michał Mirosław <mirq-linux@xxxxxxxxxxxx>
- Subject: RE: [PATCH 2/9] lib/bitmap: implement bitmap_{empty,full} with bitmap_weight_eq()
- From: David Laight <David.Laight@xxxxxxxxxx>
- Date: Wed, 15 Dec 2021 08:40:10 +0000
- Accept-language: en-GB, en-US
- Cc: "linux-kernel@xxxxxxxxxxxxxxx" <linux-kernel@xxxxxxxxxxxxxxx>, "James E.J. Bottomley" <jejb@xxxxxxxxxxxxx>, "Martin K. Petersen" <martin.petersen@xxxxxxxxxx>, "Paul E. McKenney" <paulmck@xxxxxxxxxx>, "Rafael J. Wysocki" <rafael@xxxxxxxxxx>, Alexander Shishkin <alexander.shishkin@xxxxxxxxxxxxxxx>, Alexey Klimov <aklimov@xxxxxxxxxx>, Amitkumar Karwar <amitkarwar@xxxxxxxxx>, Andi Kleen <ak@xxxxxxxxxxxxxxx>, Andrew Lunn <andrew@xxxxxxx>, Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>, Andy Gross <agross@xxxxxxxxxx>, Andy Lutomirski <luto@xxxxxxxxxx>, "Andy Shevchenko" <andy@xxxxxxxxxxxxx>, Anup Patel <anup.patel@xxxxxxx>, "Ard Biesheuvel" <ardb@xxxxxxxxxx>, Arnaldo Carvalho de Melo <acme@xxxxxxxxxx>, Arnd Bergmann <arnd@xxxxxxxx>, Borislav Petkov <bp@xxxxxxxxx>, "Catalin Marinas" <catalin.marinas@xxxxxxx>, Christoph Hellwig <hch@xxxxxx>, "Christoph Lameter" <cl@xxxxxxxxx>, Daniel Vetter <daniel@xxxxxxxx>, Dave Hansen <dave.hansen@xxxxxxxxxxxxxxx>, David Airlie <airlied@xxxxxxxx>, Dennis Zhou <dennis@xxxxxxxxxx>, Dinh Nguyen <dinguyen@xxxxxxxxxx>, Geetha sowjanya <gakula@xxxxxxxxxxx>, Geert Uytterhoeven <geert@xxxxxxxxxxxxxx>, "Greg Kroah-Hartman" <gregkh@xxxxxxxxxxxxxxxxxxx>, Guo Ren <guoren@xxxxxxxxxx>, Hans de Goede <hdegoede@xxxxxxxxxx>, Heiko Carstens <hca@xxxxxxxxxxxxx>, Ian Rogers <irogers@xxxxxxxxxx>, Ingo Molnar <mingo@xxxxxxxxxx>, "Jakub Kicinski" <kuba@xxxxxxxxxx>, Jason Wessel <jason.wessel@xxxxxxxxxxxxx>, "Jens Axboe" <axboe@xxxxxx>, Jiri Olsa <jolsa@xxxxxxxxxx>, Jonathan Cameron <jic23@xxxxxxxxxx>, Juri Lelli <juri.lelli@xxxxxxxxxx>, Kalle Valo <kvalo@xxxxxxxxxxxxxx>, Kees Cook <keescook@xxxxxxxxxxxx>, "Krzysztof Kozlowski" <krzysztof.kozlowski@xxxxxxxxxxxxx>, Lee Jones <lee.jones@xxxxxxxxxx>, Marc Zyngier <maz@xxxxxxxxxx>, Marcin Wojtas <mw@xxxxxxxxxxxx>, Mark Gross <markgross@xxxxxxxxxx>, Mark Rutland <mark.rutland@xxxxxxx>, Matti Vaittinen <mazziesaccount@xxxxxxxxx>, "Mauro Carvalho Chehab" <mchehab@xxxxxxxxxx>, Mel Gorman <mgorman@xxxxxxx>, "Michael Ellerman" <mpe@xxxxxxxxxxxxxx>, Mike Marciniszyn <mike.marciniszyn@xxxxxxxxxxxxxxxxxxxx>, Nicholas Piggin <npiggin@xxxxxxxxx>, Palmer Dabbelt <palmer@xxxxxxxxxxx>, Peter Zijlstra <peterz@xxxxxxxxxxxxx>, Petr Mladek <pmladek@xxxxxxxx>, Randy Dunlap <rdunlap@xxxxxxxxxxxxx>, "Rasmus Villemoes" <linux@xxxxxxxxxxxxxxxxxx>, Roy Pledge <Roy.Pledge@xxxxxxx>, Russell King <linux@xxxxxxxxxxxxxxx>, Saeed Mahameed <saeedm@xxxxxxxxxx>, Sagi Grimberg <sagi@xxxxxxxxxxx>, Sergey Senozhatsky <senozhatsky@xxxxxxxxxxxx>, Solomon Peachy <pizza@xxxxxxxxxxxx>, Stephen Boyd <sboyd@xxxxxxxxxx>, Stephen Rothwell <sfr@xxxxxxxxxxxxxxxx>, Steven Rostedt <rostedt@xxxxxxxxxxx>, Subbaraya Sundeep <sbhatta@xxxxxxxxxxx>, Sudeep Holla <sudeep.holla@xxxxxxx>, Sunil Goutham <sgoutham@xxxxxxxxxxx>, Tariq Toukan <tariqt@xxxxxxxxxx>, Tejun Heo <tj@xxxxxxxxxx>, Thomas Bogendoerfer <tsbogend@xxxxxxxxxxxxxxxx>, Thomas Gleixner <tglx@xxxxxxxxxxxxx>, "Ulf Hansson" <ulf.hansson@xxxxxxxxxx>, Vincent Guittot <vincent.guittot@xxxxxxxxxx>, Vineet Gupta <vgupta@xxxxxxxxxx>, Viresh Kumar <viresh.kumar@xxxxxxxxxx>, Vivien Didelot <vivien.didelot@xxxxxxxxx>, Vlastimil Babka <vbabka@xxxxxxx>, Will Deacon <will@xxxxxxxxxx>, "bcm-kernel-feedback-list@xxxxxxxxxxxx" <bcm-kernel-feedback-list@xxxxxxxxxxxx>, "kvm@xxxxxxxxxxxxxxx" <kvm@xxxxxxxxxxxxxxx>, "linux-alpha@xxxxxxxxxxxxxxx" <linux-alpha@xxxxxxxxxxxxxxx>, "linux-arm-kernel@xxxxxxxxxxxxxxxxxxx" <linux-arm-kernel@xxxxxxxxxxxxxxxxxxx>, "linux-crypto@xxxxxxxxxxxxxxx" <linux-crypto@xxxxxxxxxxxxxxx>, "linux-csky@xxxxxxxxxxxxxxx" <linux-csky@xxxxxxxxxxxxxxx>, "linux-ia64@xxxxxxxxxxxxxxx" <linux-ia64@xxxxxxxxxxxxxxx>, "linux-mips@xxxxxxxxxxxxxxx" <linux-mips@xxxxxxxxxxxxxxx>, "linux-mm@xxxxxxxxx" <linux-mm@xxxxxxxxx>, "linux-perf-users@xxxxxxxxxxxxxxx" <linux-perf-users@xxxxxxxxxxxxxxx>, "linux-riscv@xxxxxxxxxxxxxxxxxxx" <linux-riscv@xxxxxxxxxxxxxxxxxxx>, "linux-s390@xxxxxxxxxxxxxxx" <linux-s390@xxxxxxxxxxxxxxx>, "linux-snps-arc@xxxxxxxxxxxxxxxxxxx" <linux-snps-arc@xxxxxxxxxxxxxxxxxxx>, "linuxppc-dev@xxxxxxxxxxxxxxxx" <linuxppc-dev@xxxxxxxxxxxxxxxx>
- In-reply-to: <CAAH8bW9-dbENFUrwPUQ-uJVVX_s=PWb2zpAJ8BqkV3vJE696mA@mail.gmail.com>
- References: <20211128035704.270739-1-yury.norov@gmail.com> <20211128035704.270739-3-yury.norov@gmail.com> <YaPGDOvBzhiRFcOP@qmqm.qmqm.pl> <CAAH8bW9-dbENFUrwPUQ-uJVVX_s=PWb2zpAJ8BqkV3vJE696mA@mail.gmail.com>
From: Yury Norov
> Sent: 14 December 2021 19:43
...
>
> I think that for long bitmaps the most time consuming operation is moving
> data to L1, and for short bitmaps the difference between approaches is
> barely measurable.
>
> But hweght_long on each iteration can't be more effective than the current
> version. So, I'll drop this patch for v2 and keep things unchanged.
Actually do bitmap_full/empty() calls make any sense at all?
The result is stale since bitmaps are designed to do locked operations.
If you have a lock covering the bitmap then you should be using
something that uses non-locked accesses.
Rightly or wrongly that isn't the bitmap api.
David
-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)
[Index of Archives]
[Linux Kernel]
[Sparc Linux]
[DCCP]
[Linux ARM]
[Yosemite News]
[Linux SCSI]
[Linux x86_64]
[Linux for Ham Radio]