From: Peter Zijlstra <peterz@infradead.org>
To: Yury Norov <yury.norov@gmail.com>
Cc: andriy.shevchenko@linux.intel.com, linux@rasmusvillemoes.dk,
Andrew Morton <akpm@linux-foundation.org>,
Linus Torvalds <torvalds@linux-foundation.org>,
Mateusz Guzik <mjguzik@gmail.com>,
linux-kernel@vger.kernel.org, linux-mm@kvack.org,
tglx@linutronix.de, rppt@kernel.org
Subject: Re: [PATCH v2 2/2] mm,nodemask: Use nr_node_ids
Date: Fri, 4 Aug 2023 10:14:10 +0200 [thread overview]
Message-ID: <20230804081410.GK212435@hirez.programming.kicks-ass.net> (raw)
In-Reply-To: <ZMwRBqTgkvA7o9x3@yury-ThinkPad>
On Thu, Aug 03, 2023 at 01:41:42PM -0700, Yury Norov wrote:
> Consider MAX_NUMNODES == 64 and nr_node_ids == 4. Then
> small_nodemask_bits == 64.
>
> The nodes_full() will set all 64 bits:
>
> #define nodes_full(nodemask) __nodes_full(&(nodemask), small_nodemask_bits)
> static inline bool __nodes_full(const nodemask_t *srcp, unsigned int nbits)
> {
> return bitmap_full(srcp->bits, nbits);
> }
>
> And the following nodes_weight() will return 64:
>
> #define nodes_weight(nodemask) __nodes_weight(&(nodemask), small_nodemask_bits)
> static inline int __nodes_weight(const nodemask_t *srcp, unsigned int nbits)
> {
> return bitmap_weight(srcp->bits, nbits);
> }
That would be a straight up bug. You're asking it: tell me how many of
these 4 bits are set, and they you say: 64. At which point I'll suggest
they go back to primary school and do the counting lessons again.
Hmm?
prev parent reply other threads:[~2023-08-04 8:14 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-02 11:24 [PATCH 0/2] nodemask: " Peter Zijlstra
2023-08-02 11:24 ` [PATCH 1/2] mm: Mark nr_node_ids __ro_after_init Peter Zijlstra
2023-08-02 14:58 ` Mike Rapoport
2023-08-02 11:25 ` [PATCH 2/2] mm,nodemask: Use nr_node_ids Peter Zijlstra
2023-08-02 15:32 ` Mike Rapoport
2023-08-02 15:48 ` Peter Zijlstra
2023-08-02 19:36 ` [PATCH v2 " Peter Zijlstra
2023-08-03 0:45 ` Yury Norov
2023-08-03 8:41 ` Peter Zijlstra
2023-08-03 20:41 ` Yury Norov
2023-08-03 21:00 ` Yury Norov
2023-08-04 8:14 ` Peter Zijlstra [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20230804081410.GK212435@hirez.programming.kicks-ass.net \
--to=peterz@infradead.org \
--cc=akpm@linux-foundation.org \
--cc=andriy.shevchenko@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=linux@rasmusvillemoes.dk \
--cc=mjguzik@gmail.com \
--cc=rppt@kernel.org \
--cc=tglx@linutronix.de \
--cc=torvalds@linux-foundation.org \
--cc=yury.norov@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox