linux-api.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
To: Florian Weimer <fw@deneb.enyo.de>
Cc: Peter Zijlstra <peterz@infradead.org>,
	linux-kernel <linux-kernel@vger.kernel.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	paulmck <paulmck@kernel.org>, Boqun Feng <boqun.feng@gmail.com>,
	"H. Peter Anvin" <hpa@zytor.com>, Paul Turner <pjt@google.com>,
	linux-api <linux-api@vger.kernel.org>,
	Christian Brauner <christian.brauner@ubuntu.com>,
	David Laight <David.Laight@ACULAB.COM>,
	carlos <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 16:26:06 -0500 (EST)	[thread overview]
Message-ID: <1424193545.23589.1643664366116.JavaMail.zimbra@efficios.com> (raw)
In-Reply-To: <8735l3k3hu.fsf@mid.deneb.enyo.de>

----- On Jan 31, 2022, at 4:19 PM, Florian Weimer fw@deneb.enyo.de wrote:

> * 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).

I suspect that any approach based on a user-space cache will break with
respect to CRIU. That is one big advantage of using the rseq thread area
for this.

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

As stated in my self-reply, I don't think those two fields are needed
after all.

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

True. However considering that we plan to remove the buggy "rseq_cs.ptr"
fields from the API, that rseq.h UAPI compatibility does not seem to be
very much relevant.

But still, it's better if we can avoid breaking API, agreed. And the
"node_id_start" does not appear to be needed after all.

Thanks,

Mathieu

-- 
Mathieu Desnoyers
EfficiOS Inc.
http://www.efficios.com

  reply	other threads:[~2022-01-31 21:26 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 ` [RFC PATCH 1/2] rseq: extend struct rseq with numa node id Florian Weimer
2022-01-31 21:26   ` Mathieu Desnoyers [this message]
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=1424193545.23589.1643664366116.JavaMail.zimbra@efficios.com \
    --to=mathieu.desnoyers@efficios.com \
    --cc=David.Laight@ACULAB.COM \
    --cc=boqun.feng@gmail.com \
    --cc=carlos@redhat.com \
    --cc=christian.brauner@ubuntu.com \
    --cc=fw@deneb.enyo.de \
    --cc=hpa@zytor.com \
    --cc=linux-api@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).