All of lore.kernel.org
 help / color / mirror / Atom feed
From: Florian Weimer <fw@deneb.enyo.de>
To: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Cc: Peter Zijlstra <peterz@infradead.org>,
	linux-kernel@vger.kernel.org,
	Thomas Gleixner <tglx@linutronix.de>,
	"Paul E . McKenney" <paulmck@kernel.org>,
	Boqun Feng <boqun.feng@gmail.com>,
	"H . Peter Anvin" <hpa@zytor.com>, Paul Turner <pjt@google.com>,
	linux-api@vger.kernel.org,
	Christian Brauner <christian.brauner@ubuntu.com>,
	David.Laight@ACULAB.COM, carlos@redhat.com,
	Peter Oskolkov <posk@posk.io>
Subject: Re: [RFC PATCH 1/2] rseq: extend struct rseq with numa node id
Date: Mon, 31 Jan 2022 22:19:09 +0100	[thread overview]
Message-ID: <8735l3k3hu.fsf@mid.deneb.enyo.de> (raw)
In-Reply-To: <20220131205531.17873-1-mathieu.desnoyers@efficios.com> (Mathieu Desnoyers's message of "Mon, 31 Jan 2022 15:55:30 -0500")

* Mathieu Desnoyers:

> Adding the NUMA node id to struct rseq is a straightforward thing to do,
> and a good way to figure out if anything in the user-space ecosystem
> prevents extending struct rseq.
>
> This NUMA node id field allows memory allocators such as tcmalloc to
> take advantage of fast access to the current NUMA node id to perform
> NUMA-aware memory allocation.
>
> It is also useful for implementing NUMA-aware user-space mutexes.

It can be used to implement getcpu purely in userspace, too.  I had
plan to hack this together with a node ID cache in TLS, which should
offer pretty much the same functionality (except for weird CPU
topology changes which alter the node ID of a previously used CPU).

However, I do not understand the need for two fields here.  Why isn't
one enough?

One field would also avoid the need to mess with rseq_cpu_id_state,
maintaining API compatibility.

  parent reply	other threads:[~2022-01-31 21:19 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-31 20:55 [RFC PATCH 1/2] rseq: extend struct rseq with numa node id Mathieu Desnoyers
2022-01-31 20:55 ` [RFC PATCH 2/2] selftests/rseq: Implement rseq numa node id field selftest Mathieu Desnoyers
2022-01-31 21:19 ` Florian Weimer [this message]
2022-01-31 21:26   ` [RFC PATCH 1/2] rseq: extend struct rseq with numa node id Mathieu Desnoyers
2022-02-01 11:08   ` Peter Zijlstra
2022-02-01 12:11     ` Florian Weimer
2022-01-31 21:22 ` Mathieu Desnoyers
2022-02-01 11:08 ` Peter Zijlstra
2022-02-01 12:07   ` Florian Weimer

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=8735l3k3hu.fsf@mid.deneb.enyo.de \
    --to=fw@deneb.enyo.de \
    --cc=David.Laight@ACULAB.COM \
    --cc=boqun.feng@gmail.com \
    --cc=carlos@redhat.com \
    --cc=christian.brauner@ubuntu.com \
    --cc=hpa@zytor.com \
    --cc=linux-api@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mathieu.desnoyers@efficios.com \
    --cc=paulmck@kernel.org \
    --cc=peterz@infradead.org \
    --cc=pjt@google.com \
    --cc=posk@posk.io \
    --cc=tglx@linutronix.de \
    /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.