[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20250530100916._unhdZoo@linutronix.de>
Date: Fri, 30 May 2025 12:09:16 +0200
From: Sebastian Andrzej Siewior <bigeasy@...utronix.de>
To: Alejandro Colomar <alx@...nel.org>
Cc: linux-kernel@...r.kernel.org, linux-man@...r.kernel.org,
André Almeida <andrealmeid@...lia.com>,
Darren Hart <dvhart@...radead.org>,
Davidlohr Bueso <dave@...olabs.net>, Ingo Molnar <mingo@...hat.com>,
Juri Lelli <juri.lelli@...hat.com>,
Peter Zijlstra <peterz@...radead.org>,
Thomas Gleixner <tglx@...utronix.de>,
Valentin Schneider <vschneid@...hat.com>,
Waiman Long <longman@...hat.com>
Subject: Re: [[PATCH v3] 1/4] man/man2/prctl.2,
man/man2const/PR_FUTEX_HASH.2const: Document PR_FUTEX_HASH
On 2025-05-30 11:51:58 [+0200], Alejandro Colomar wrote:
> Hi Sebastian,
Hi Alejandro,
> > diff --git a/man/man2const/PR_FUTEX_HASH.2const b/man/man2const/PR_FUTEX_HASH.2const
> > new file mode 100644
> > index 0000000000000..c27adcb73d079
> > --- /dev/null
> > +++ b/man/man2const/PR_FUTEX_HASH.2const
…
> > +Unrelated requests are requests which are not related to one another
> > +because they use a different
> > +.I uaddr
> > +value of the syscall or the requests are issued by different processes
>
> I think 'use a different uaddr value of the syscall' is technically
> incorrect, because two processes may have a different address for the
> same futex word, as their address space is different, right?
A shared futex over shared memory. Yes.
> See futex(2):
>
> $ MANWIDTH=72 man futex | grep -B7 -A5 different.v
>
> A futex is a 32‐bit value——referred to below as a futex word——
> whose address is supplied to the futex() system call. (Futexes
> are 32 bits in size on all platforms, including 64‐bit systems.)
> All futex operations are governed by this value. In order to
> share a futex between processes, the futex is placed in a region
> of shared memory, created using (for example) mmap(2) or shmat(2).
> (Thus, the futex word may have different virtual addresses in dif‐
> ferent processes, but these addresses all refer to the same loca‐
> tion in physical memory.) In a multithreaded program, it is suf‐
> ficient to place the futex word in a global variable shared by all
> threads.
>
> Maybe say 'use a different futex word'?
Oh yes, this would make it simpler to express.
Sebastian
Powered by blists - more mailing lists