All of lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: tglx@linutronix.de, linux-kernel@vger.kernel.org,
	mingo@redhat.com, dvhart@infradead.org, andrealmeid@igalia.com,
	Andrew Morton <akpm@linux-foundation.org>,
	urezki@gmail.com, hch@infradead.org, lstoakes@gmail.com,
	Arnd Bergmann <arnd@arndb.de>,
	linux-api@vger.kernel.org, linux-mm@kvack.org,
	linux-arch@vger.kernel.org, malteskarupke@web.de, cl@linux.com,
	llong@redhat.com
Subject: Re: [PATCH 2/6] futex: Implement FUTEX2_NUMA
Date: Mon, 28 Oct 2024 10:38:29 +0100	[thread overview]
Message-ID: <20241028093829.GK9767@noisy.programming.kicks-ass.net> (raw)
In-Reply-To: <i4ljhfndmqrdg5zevd4gf2chmzesfieflxvfj2io2qfhfj4vb7@nicvpjmcdtyu>

On Fri, Oct 25, 2024 at 11:30:26AM -0700, Davidlohr Bueso wrote:
> On Fri, 25 Oct 2024, Peter Zijlstra wrote:\n
> 
> > static int __init futex_init(void)
> > {
> > -	unsigned int futex_shift;
> > -	unsigned long i;
> > +	unsigned int order, n;
> > +	unsigned long size, i;
> > 
> > #ifdef CONFIG_BASE_SMALL
> > 	futex_hashsize = 16;
> > #else
> > -	futex_hashsize = roundup_pow_of_two(256 * num_possible_cpus());
> > +	futex_hashsize = 256 * num_possible_cpus();
> > +	futex_hashsize /= num_possible_nodes();
> > +	futex_hashsize = roundup_pow_of_two(futex_hashsize);
> > #endif
> > +	futex_hashshift = ilog2(futex_hashsize);
> > +	size = sizeof(struct futex_hash_bucket) * futex_hashsize;
> > +	order = get_order(size);
> > +
> > +	for_each_node(n) {
> 
> Probably want to skip nodes that don't have CPUs, those will never
> have the remote for .node value.

What if the CPU-less node is placed equidistant between two (or more)
regular nodes and it is the best location for a futex that is spanning
those nodes?

That is to say, just because it doesn't have CPUs, doesn't mean it is
never the right node.

Hmm?

  reply	other threads:[~2024-10-28  9:38 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-25  9:03 [PATCH 0/6] futex: The remaining futex2 bits Peter Zijlstra
2024-10-25  9:03 ` [PATCH 1/6] mm: Add vmalloc_huge_node() Peter Zijlstra
2024-10-25  9:58   ` Uladzislau Rezki
2024-10-25 16:00   ` Davidlohr Bueso
2024-10-25 19:54   ` Christoph Lameter (Ampere)
2024-10-25  9:03 ` [PATCH 2/6] futex: Implement FUTEX2_NUMA Peter Zijlstra
2024-10-25 18:30   ` Davidlohr Bueso
2024-10-28  9:38     ` Peter Zijlstra [this message]
2024-10-25 19:28   ` Christoph Lameter (Ampere)
2024-10-28  1:59     ` Davidlohr Bueso
2024-10-28 22:34       ` Christoph Lameter (Ampere)
2024-10-28  9:46     ` Peter Zijlstra
2024-10-28 22:37       ` Christoph Lameter (Ampere)
2024-10-25 21:23   ` André Almeida
2024-10-25  9:03 ` [PATCH 3/6] futex: Propagate flags into futex_get_value_locked() Peter Zijlstra
2024-10-25  9:03 ` [PATCH 4/6] futex: Enable FUTEX2_{8,16} Peter Zijlstra
2024-10-25  9:03 ` [PATCH 5/6] futex,selftests: Extend the futex selftests Peter Zijlstra
2024-10-25  9:03 ` [PATCH 6/6] futex,selftests: Extend the futex selftests for NUMA Peter Zijlstra

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=20241028093829.GK9767@noisy.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --cc=akpm@linux-foundation.org \
    --cc=andrealmeid@igalia.com \
    --cc=arnd@arndb.de \
    --cc=cl@linux.com \
    --cc=dvhart@infradead.org \
    --cc=hch@infradead.org \
    --cc=linux-api@vger.kernel.org \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=llong@redhat.com \
    --cc=lstoakes@gmail.com \
    --cc=malteskarupke@web.de \
    --cc=mingo@redhat.com \
    --cc=tglx@linutronix.de \
    --cc=urezki@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.