Thread (10 messages) 10 messages, 2 authors, 2025-05-30

Re: [[PATCH v3] 1/4] man/man2/prctl.2, man/man2const/PR_FUTEX_HASH.2const: Document PR_FUTEX_HASH

From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Date: 2025-05-30 10:09:25
Also in: lkml

On 2025-05-30 11:51:58 [+0200], Alejandro Colomar wrote:
Hi Sebastian,
Hi Alejandro,
quoted
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
quoted
+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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help