Skip to contentSkip to conversation

prctl: Add documentation for PR_FUTEX_HASH

PATCH Superseded Sebastian Andrzej Siewior 2 participants 6 messages May 16, 2025 – May 26, 2025 Man-pages: manual pages for Linux -- Sections 2, 3, 4, 5, and 7

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 prctl: Add documentation for PR_FUTEX_HASH

The prctl(PR_FUTEX_HASH) is queued for the v6.16 merge window. Add some documentation of the interface.

---
 man/man2/prctl.2                   |   3 +
 man/man2const/PR_FUTEX_HASH.2const | 112 +++++++++++++++++++++++++++++
 2 files changed, 115 insertions(+)
 create mode 100644 man/man2const/PR_FUTEX_HASH.2const
man/man2/prctl.2 +3 -0
index 7a6b73e25e7a8..30c868d051a0c 100644
@@ -150,6 +150,8 @@ with a significance depending on the first one.
 .B PR_GET_MDWE
 .TQ
 .B PR_RISCV_SET_ICACHE_FLUSH_CTX
+.TQ
+.B PR_FUTEX_HASH
 .SH RETURN VALUE
 On success,
 a nonnegative value is returned.
@@ -262,4 +264,5 @@ so these operations should be used with care.
 .BR PR_SET_MDWE (2const),
 .BR PR_GET_MDWE (2const),
 .BR PR_RISCV_SET_ICACHE_FLUSH_CTX (2const),
+.BR PR_FUTEX_HASH (2const),
 .BR core (5)
man/man2const/PR_FUTEX_HASH.2const new file +112 -0

112 lines not on this page · raw message

Signature · 1 line
2.49.0
#1 lore raw

Hi Sebastian,

Quoted 35 lines · Sebastian Andrzej Siewior

The prctl(PR_FUTEX_HASH) is queued for the v6.16 merge window. Add some documentation of the interface.

---
 man/man2/prctl.2                   |   3 +
 man/man2const/PR_FUTEX_HASH.2const | 112 +++++++++++++++++++++++++++++
 2 files changed, 115 insertions(+)
 create mode 100644 man/man2const/PR_FUTEX_HASH.2const
man/man2/prctl.2 +3 -0
index 7a6b73e25e7a8..30c868d051a0c 100644
@@ -150,6 +150,8 @@ with a significance depending on the first one.
 .B PR_GET_MDWE
 .TQ
 .B PR_RISCV_SET_ICACHE_FLUSH_CTX
+.TQ
+.B PR_FUTEX_HASH
 .SH RETURN VALUE
 On success,
 a nonnegative value is returned.
@@ -262,4 +264,5 @@ so these operations should be used with care.
 .BR PR_SET_MDWE (2const),
 .BR PR_GET_MDWE (2const),
 .BR PR_RISCV_SET_ICACHE_FLUSH_CTX (2const),
+.BR PR_FUTEX_HASH (2const),
 .BR core (5)
man/man2const/PR_FUTEX_HASH.2const new file +0 -0
new file mode 100644
index 0000000000000..c6a6396729770

man/man2const/PR_FUTEX_HASH.2const line 1

Quoted 1 line
man/man2const/PR_FUTEX_HASH.2const new file +1 -0
@@ -0,0 +1,112 @@
+.\" Copyright, The contributors to the Linux man-pages project

I've slightly changed the copyright notices this week. Please do

s/The contributors to/the authors of/

You can check any page for the extact current text. Sorry! :)

Quoted 12 lines
man/man2const/PR_FUTEX_HASH.2const new file +12 -0
+.\"
+.\" SPDX-License-Identifier: Linux-man-pages-copyleft
+.\"
+.TH PR_FUTEX_HASH 2const (date) "Linux man-pages (unreleased)"
+.SH NAME
+PR_FUTEX_HASH
+\-
+configure the private futex hash
+.SH LIBRARY
+Standard C library
+.RI ( libc ,\~ \-lc )
+.SH SYNOPSIS

man/man2const/PR_FUTEX_HASH.2const line 23

Quoted 10 lines
man/man2const/PR_FUTEX_HASH.2const new file +10 -0
+.nf
+.BR "#include <linux/prctl.h>" "  /* Definition of " PR_* " constants */"
+.B #include <sys/prctl.h>
+.P
+.BI "int prctl(PR_FUTEX_HASH, long " op ", ...);"
+.fi
+.SH DESCRIPTION
+Configure the attributes for the underlying hash used by the
+.BR futex (2)
+family of operations. The Linux kernel uses a hash to distributes the

Please use semantic newlines. See man-pages(7):

$ MANWIDTH=72 man man-pages | sed -n '/Use semantic newlines/,/^$/p'
   Use semantic newlines
       In the source of a manual page, new sentences should be  started
       on  new  lines,  long  sentences  should  be split into lines at
       clause breaks (commas, semicolons, colons, and so on), and  long
       clauses  should be split at phrase boundaries.  This convention,
       sometimes known as "semantic newlines", makes it easier  to  see
       the effect of patches, which often operate at the level of indi‐
       vidual sentences, clauses, or phrases.

Also, thanks to semantic newlines, we don't need to think about the amount of spaces after a '.'. However, for *roff, you need to use two spaces in the source code after a period that ends a sentence; else it is interpreted as not ending a sentence, and the resulting document is clearly bad. I recommend reading this:

$ cat CONTRIBUTING.d/patches/description | sed -n '/inter-sentence/,/^$/p'
	The correct inter-sentence space amount is two.  See some
	history about this:
	<https://web.archive.org/web/20171217060354/http://www.heracliteanriver.com/?p=324>

man/man2const/PR_FUTEX_HASH.2const line 35

Quoted 12 lines
man/man2const/PR_FUTEX_HASH.2const new file +12 -0
+.BR futex (2)
+users on different data structures. The data structure holds the in-kernel
+representation of the operation and keeps track of the current users which are
+enqueued and wait for a wake up and those who perform a wake up. The size of
+the global hash is determined at boot time and is based on the number of CPUs
+in the system. Since the mapping from the provided
+.I uaddr
+value to the in-kernel representation is based on a hash, two unrelated tasks
+in the system can share the same hash bucket. This in turn can lead to delays
+of the due
+.BR futex (2)
+operation due to to lock contention of the data structure. These delays can be

The sentence above has some typos; please check.

man/man2const/PR_FUTEX_HASH.2const line 36

Quoted 1 line
man/man2const/PR_FUTEX_HASH.2const new file +1 -0
+problematic on a PREEMPT_RT system since random tasks can share in-kernel locks

References to PREEMPT_RT in existing pages use CONFIG_PREEMPT_RT. Should we do the same?

	$ grep -rn PREEMPT_RT man/
	man/man7/sched.7:969:.B CONFIG_PREEMPT_RT
	man/man2/futex.2:1326:.\" PREEMPT_RT-enabled Linux systems.
Quoted 11 lines
man/man2const/PR_FUTEX_HASH.2const new file +11 -0
+and it is not deterministic which tasks will be involved.
+.P
+Linux v6.16 implements a process wide private hash which is used by all
+.BR futex (2)
+operations which specify the
+.B FUTEX_PRIVATE_FLAG
+as part of the operation.
+Without any configuration the kernel will allocate 16 hash slots once the first
+thread has been created. If the process continues to create threads, the kernel
+will try to resize the private hash based on the number of threads and
+available CPUs in the system. The kernel will only increase the size and will

man/man2const/PR_FUTEX_HASH.2const line 57

Quoted 10 lines
man/man2const/PR_FUTEX_HASH.2const new file +10 -0
+make sure it does not exceed the size of the global hash.
+.P
+The user can configure the size of the private hash which will also disable the
+automatic resize provided by the kernel.
+.P
+The following values for
+.I op
+can be specified:
+.TP
+.BI "int prctl(PR_FUTEX_HASH, PR_FUTEX_HASH_SET_SLOTS, " hash_size ", " hash_flags ");

What's the type of hash_size and hash_flags?

Quoted 31 lines
man/man2const/PR_FUTEX_HASH.2const new file +31 -0
+Set the number of slots to use for the private hash.
+.P
+.RS
+.TP
+.I hash_size
+Specifies the size of private hash to allocate. Possible values are:
+.RS
+.TP
+.I 0
+Use the global hash. This is the behaviour used before v6.16. The operation can
+not be undone.
+.TP
+.I >0
+Specifies the number of slots to allocate. The value must be power of two and
+lowest possible value is 2. The upper limit depends on available memory in
+the system. Each slot requires 64bytes of memory. Kernels compiled with
+.I CONFIG_PROVE_LOCKING
+will consume more than that.
+.RE
+.TP
+.I hash_flags
+.RS
+The following flags can be specified:
+.TP
+.I FH_FLAG_IMMUTABLE
+The private hash can no longer be changed. By using an immutable privat hash
+the kernel can avoid some accounting for the data structure. This accounting
+is visible in benchmarks if many
+.BR futex (2)
+operations are invoked in parallel on different CPUs.
+.RE

man/man2const/PR_FUTEX_HASH.2const line 98

Quoted 10 lines
man/man2const/PR_FUTEX_HASH.2const new file +10 -0
+.RE
+.TP
+.BI "int prctl(PR_FUTEX_HASH, PR_FUTEX_HASH_GET_SLOTS);
+Returns the current size of the the private hash. A value of 0 means that a
+private has not been allocated or the global hash is used. A value >0 specifies
+the size of the private hash.
+.TP
+.BI "int prctl(PR_FUTEX_HASH, PR_FUTEX_HASH_GET_IMMUTABLE);
+Return 1 if the hash has been made immutable and not be changed. Otherwise 0.
+

Blank lines in man(7) input cause diagnostics. If you want to separate the source without affecting output, you can use a comment line with an empty comment:

	.\"

man/man2const/PR_FUTEX_HASH.2const line 101

Quoted 3 lines
man/man2const/PR_FUTEX_HASH.2const new file +3 -0
+.SH RETURN VALUE
+On success,
+these calls return a value >=0.

Let's say "a nonnegative value", for consistency with other pages.

Quoted 13 lines
man/man2const/PR_FUTEX_HASH.2const new file +11 -0
+On error, \-1 is returned, and
+.I errno
+is set to indicate the error.
+.SH STANDARDS
+Linux.
+.SH HISTORY
+Linux 6.16.
+.SH SEE ALSO
+.BR prctl (2) ,
+.BR futex (2) ,
+.BR futex (7)
Signature · 1 line
2.49.0

Have a lovely day!
Alex

Signature · 1 line
<https://www.alejandro-colomar.es/>
#2 lore raw
Quoted 1 line · Alejandro Colomar

Hi Sebastian,

Hi Alejandro,

Quoted 6 lines
Quoted 6 lines
man/man2const/PR_FUTEX_HASH.2const new file +0 -0
new file mode 100644
index 0000000000000..c6a6396729770
@@ -0,0 +1,112 @@

…

Quoted 6 lines

man/man2const/PR_FUTEX_HASH.2const line 23

Quoted 3 lines
man/man2const/PR_FUTEX_HASH.2const new file +3 -0
+Configure the attributes for the underlying hash used by the
+.BR futex (2)
+family of operations. The Linux kernel uses a hash to distributes the

Please use semantic newlines. See man-pages(7):

Quoted 10 lines
$ MANWIDTH=72 man man-pages | sed -n '/Use semantic newlines/,/^$/p'
   Use semantic newlines
       In the source of a manual page, new sentences should be  started
       on  new  lines,  long  sentences  should  be split into lines at
       clause breaks (commas, semicolons, colons, and so on), and  long
       clauses  should be split at phrase boundaries.  This convention,
       sometimes known as "semantic newlines", makes it easier  to  see
       the effect of patches, which often operate at the level of indi‐
       vidual sentences, clauses, or phrases.

Understood.

Quoted 10 lines

Also, thanks to semantic newlines, we don't need to think about the amount of spaces after a '.'. However, for *roff, you need to use two spaces in the source code after a period that ends a sentence; else it is interpreted as not ending a sentence, and the resulting document is clearly bad. I recommend reading this:

$ cat CONTRIBUTING.d/patches/description | sed -n '/inter-sentence/,/^$/p'
	The correct inter-sentence space amount is two.  See some
	history about this:
	<https://web.archive.org/web/20171217060354/http://www.heracliteanriver.com/?p=324>

Okay. In the source code. Otherwise new line.

…

Quoted 4 lines
Quoted 1 line

+problematic on a PREEMPT_RT system since random tasks can share in-kernel locks

References to PREEMPT_RT in existing pages use CONFIG_PREEMPT_RT. Should we do the same?

After looking through it, I switched to "real-time".

Quoted 3 lines
	$ grep -rn PREEMPT_RT man/
	man/man7/sched.7:969:.B CONFIG_PREEMPT_RT
	man/man2/futex.2:1326:.\" PREEMPT_RT-enabled Linux systems.

but looking here, it could be updated that the major piece of the patches has been merged and the mentioned config option is available.

Quoted 15 lines
Quoted 15 lines
man/man2const/PR_FUTEX_HASH.2const new file +15 -0
+and it is not deterministic which tasks will be involved.
+.P
+Linux v6.16 implements a process wide private hash which is used by all
+.BR futex (2)
+operations which specify the
+.B FUTEX_PRIVATE_FLAG
+as part of the operation.
+Without any configuration the kernel will allocate 16 hash slots once the first
+thread has been created. If the process continues to create threads, the kernel
+will try to resize the private hash based on the number of threads and
+available CPUs in the system. The kernel will only increase the size and will
+make sure it does not exceed the size of the global hash.
+.P
+The user can configure the size of the private hash which will also disable the
+automatic resize provided by the kernel.
Quoted 8 lines

man/man2const/PR_FUTEX_HASH.2const line 57

Quoted 6 lines

+.P

man/man2const/PR_FUTEX_HASH.2const new file +5 -0
+The following values for
+.I op
+can be specified:
+.TP
+.BI "int prctl(PR_FUTEX_HASH, PR_FUTEX_HASH_SET_SLOTS, " hash_size ", " hash_flags ");

What's the type of hash_size and hash_flags?

it is unsigned long as per prctl() prototype. I added it here.

Sebastian

#3 lore raw

PATCH v2 1/1 prctl: Add documentation for PR_FUTEX_HASH

In reply to Alejandro Colomar

The prctl(PR_FUTEX_HASH) is queued for the v6.16 merge window. Add some documentation of the interface.

---
v1…v2: https://lore.kernel.org/all/[email protected]/
- Partly reword
- Use "semantic newlines"

 man/man2/prctl.2                   |   3 +
 man/man2const/PR_FUTEX_HASH.2const | 122 +++++++++++++++++++++++++++++
 2 files changed, 125 insertions(+)
 create mode 100644 man/man2const/PR_FUTEX_HASH.2const
man/man2/prctl.2 +3 -0
index f29b745b12578..a884064a40b7d 100644
@@ -150,6 +150,8 @@ with a significance depending on the first one.
 .B PR_GET_MDWE
 .TQ
 .B PR_RISCV_SET_ICACHE_FLUSH_CTX
+.TQ
+.B PR_FUTEX_HASH
 .SH RETURN VALUE
 On success,
 a nonnegative value is returned.
@@ -262,4 +264,5 @@ so these operations should be used with care.
 .BR PR_SET_MDWE (2const),
 .BR PR_GET_MDWE (2const),
 .BR PR_RISCV_SET_ICACHE_FLUSH_CTX (2const),
+.BR PR_FUTEX_HASH (2const),
 .BR core (5)
man/man2const/PR_FUTEX_HASH.2const new file +122 -0

122 lines not on this page · raw message

Signature · 1 line
2.49.0
#4 lore raw

Hi Sebastian,

Quoted 1 line

Subject: Re: [PATCH v2] prctl: Add documentation for PR_FUTEX_HASH

Please change the subject to

man/man2/prctl.2, man/man2const/PR_FUTEX_HASH.2const: Document PR_FUTEX_HASH

Quoted 39 lines · Sebastian Andrzej Siewior

The prctl(PR_FUTEX_HASH) is queued for the v6.16 merge window. Add some documentation of the interface.

---
v1…v2: https://lore.kernel.org/all/[email protected]/
- Partly reword
- Use "semantic newlines"

 man/man2/prctl.2                   |   3 +
 man/man2const/PR_FUTEX_HASH.2const | 122 +++++++++++++++++++++++++++++
 2 files changed, 125 insertions(+)
 create mode 100644 man/man2const/PR_FUTEX_HASH.2const
man/man2/prctl.2 +3 -0
index f29b745b12578..a884064a40b7d 100644
@@ -150,6 +150,8 @@ with a significance depending on the first one.
 .B PR_GET_MDWE
 .TQ
 .B PR_RISCV_SET_ICACHE_FLUSH_CTX
+.TQ
+.B PR_FUTEX_HASH
 .SH RETURN VALUE
 On success,
 a nonnegative value is returned.
@@ -262,4 +264,5 @@ so these operations should be used with care.
 .BR PR_SET_MDWE (2const),
 .BR PR_GET_MDWE (2const),
 .BR PR_RISCV_SET_ICACHE_FLUSH_CTX (2const),
+.BR PR_FUTEX_HASH (2const),
 .BR core (5)
man/man2const/PR_FUTEX_HASH.2const new file +0 -0
new file mode 100644
index 0000000000000..c7aa36064b79e

man/man2const/PR_FUTEX_HASH.2const line 1

Quoted 1 line
man/man2const/PR_FUTEX_HASH.2const new file +1 -0
@@ -0,0 +1,122 @@
+.\" Copyright, The authors of the Linux man-pages project

Please use lowercase 'the'.

Quoted 13 lines
man/man2const/PR_FUTEX_HASH.2const new file +13 -0
+.\"
+.\" SPDX-License-Identifier: Linux-man-pages-copyleft
+.\"
+.TH PR_FUTEX_HASH 2const (date) "Linux man-pages (unreleased)"
+.SH NAME
+PR_FUTEX_HASH
+\-
+configure the private futex hash
+.SH LIBRARY
+Standard C library
+.RI ( libc ,\~ \-lc )
+.SH SYNOPSIS
+.nf

man/man2const/PR_FUTEX_HASH.2const line 24

Quoted 10 lines
man/man2const/PR_FUTEX_HASH.2const new file +10 -0
+.BR "#include <linux/prctl.h>" "  /* Definition of " PR_* " constants */"
+.B #include <sys/prctl.h>
+.P
+.BI "int prctl(PR_FUTEX_HASH, unsigned long " op ", ...);"
+.fi
+.SH DESCRIPTION
+Configure the attributes for the underlying hash used by the
+.BR futex (2)
+family of operations.
+The Linux kernel uses a hash to distributes the

s/distributes/distribute/

man/man2const/PR_FUTEX_HASH.2const line 30

Quoted 6 lines
man/man2const/PR_FUTEX_HASH.2const new file +6 -0
+.BR futex (2)
+users on different data structures.
+The data structure holds the in-kernel representation of the operation and
+keeps track of the current users which are enqueued and wait for a wake up.
+It also provides synchronisation with users who perform a wake up.
+The size of the global hash is determined at boot time and is based on the

Please don't break the line at a random point; I'd break after 'time'.

man/man2const/PR_FUTEX_HASH.2const line 33

Quoted 3 lines
man/man2const/PR_FUTEX_HASH.2const new file +3 -0
+number of CPUs in the system.
+Since the mapping from the provided
+.I uaddr

This is the only reference in the entire page, and is also not mentioned in prctl(2). I guess it refers to the one passed to futex(2), but I think that should be mentioned.

man/man2const/PR_FUTEX_HASH.2const line 34

Quoted 1 line
man/man2const/PR_FUTEX_HASH.2const new file +1 -0
+value to the in-kernel representation is based on a hash, two unrelated tasks

Please break after ','. (Semantic newlines)

man/man2const/PR_FUTEX_HASH.2const line 39

Quoted 5 lines
man/man2const/PR_FUTEX_HASH.2const new file +5 -0
+in the system can share the same hash bucket.
+This in turn can lead to delays of the
+.BR futex (2)
+operation due to lock contention of the data structure.
+These delays can be problematic on a real-time system since random tasks can

Break before 'since'.

man/man2const/PR_FUTEX_HASH.2const line 40

Quoted 1 line
man/man2const/PR_FUTEX_HASH.2const new file +1 -0
+share in-kernel locks and it is not deterministic which tasks will be involved.

Break before 'and'.

man/man2const/PR_FUTEX_HASH.2const line 42

Quoted 2 lines
man/man2const/PR_FUTEX_HASH.2const new file +2 -0
+.P
+Linux v6.16 implements a process wide private hash which is used by all

s/v6.16/6.16/

$ grep -rho 'Linux v\?6\.[0-9]*' man/ | sort | uniq -c
      1 Linux 6.
      2 Linux 6.0
      6 Linux 6.1
      7 Linux 6.10
     10 Linux 6.11
      1 Linux 6.12
      8 Linux 6.13
      6 Linux 6.14
      2 Linux 6.15
      5 Linux 6.2
      6 Linux 6.3
      3 Linux 6.4
      3 Linux 6.5
      3 Linux 6.6
      9 Linux 6.7
      6 Linux 6.8
      7 Linux 6.9
      1 Linux v6.14

s/process wide/process-wide/

man/man2const/PR_FUTEX_HASH.2const line 47

Quoted 5 lines
man/man2const/PR_FUTEX_HASH.2const new file +5 -0
+.BR futex (2)
+operations which specify the
+.B FUTEX_PRIVATE_FLAG
+as part of the operation.
+Without any configuration the kernel will allocate 16 hash slots once the first

s/configuration/&\n/

s/slots/&\n/

man/man2const/PR_FUTEX_HASH.2const line 49

Quoted 2 lines
man/man2const/PR_FUTEX_HASH.2const new file +2 -0
+thread has been created.
+If the process continues to create threads, the kernel will try to resize the

s/,/&\n/

man/man2const/PR_FUTEX_HASH.2const line 50

Quoted 1 line
man/man2const/PR_FUTEX_HASH.2const new file +1 -0
+private hash based on the number of threads and available CPUs in the system.

s/hash/&\n/

man/man2const/PR_FUTEX_HASH.2const line 51

Quoted 1 line
man/man2const/PR_FUTEX_HASH.2const new file +1 -0
+The kernel will only increase the size and will make sure it does not exceed

s/size/&\n/

man/man2const/PR_FUTEX_HASH.2const line 54

Quoted 3 lines
man/man2const/PR_FUTEX_HASH.2const new file +3 -0
+the size of the global hash.
+.P
+The user can configure the size of the private hash which will also disable the

s/hash/&\n/

man/man2const/PR_FUTEX_HASH.2const line 61

Quoted 7 lines
man/man2const/PR_FUTEX_HASH.2const new file +7 -0
+automatic resize provided by the kernel.
+.P
+The following values for
+.I op
+can be specified:
+.TP
+.BI "int prctl(PR_FUTEX_HASH, PR_FUTEX_HASH_SET_SLOTS, unsigned long " hash_size ", unsigned long " hash_flags ");

I prefer if the suboperations get their own manual page:

PR_FUTEX_HASH_SET_SLOTS(2const)
PR_FUTEX_HASH_GET_SLOTS(2const)
PR_FUTEX_HASH_GET_IMMUTABLE(2const)

You can use a single page for all the suboperations, or separate them in two or three pages, as you see fit, but I'd like this page to only document the main operation, and the things that are common to all of them.

See for example:

	PR_SET_MM(2const)

and its suboperations, which include PR_SET_MM_ARG_START(2const) among others. You can base these pages on those.

Please use one patch for each of the pages. The first one should document the main operation, and then you can send one patch per page that you write for the subops.

Quoted 20 lines
man/man2const/PR_FUTEX_HASH.2const new file +20 -0
+Set the number of slots to use for the private hash.
+.P
+.RS
+.TP
+.I hash_size
+Specifies the size of private hash to allocate. Possible values are:
+.RS
+.TP
+.I 0
+Use the global hash.
+This is the behaviour used before v6.16.
+The operation can not be undone.
+.TP
+.I >0
+Specifies the number of slots to allocate.
+The value must be power of two and the lowest possible value is 2.
+The upper limit depends on the available memory in the system.
+Each slot requires 64bytes of memory.
+Kernels compiled with
+.I CONFIG_PROVE_LOCKING

man/man2const/PR_FUTEX_HASH.2const line 91

Quoted 10 lines
man/man2const/PR_FUTEX_HASH.2const new file +10 -0
+will consume more than that.
+.RE
+.TP
+.I hash_flags
+.RS
+The following flags can be specified:
+.TP
+.I FH_FLAG_IMMUTABLE
+The private hash can no longer be changed.
+By using an immutable privat hash the kernel can avoid some accounting for the

s/privat/private/

s/hash/&\n/ (semantic newlines)

Have a lovely day!
Alex

Quoted 34 lines
man/man2const/PR_FUTEX_HASH.2const new file +31 -0
+data structure.
+This accounting is visible in benchmarks if many
+.BR futex (2)
+operations are invoked in parallel on different CPUs.
+.RE
+.RE
+.TP
+.BI "int prctl(PR_FUTEX_HASH, PR_FUTEX_HASH_GET_SLOTS);
+Returns the current size of the the private hash.
+A value of 0 means that a private hash has not been allocated and the global
+hash is in use.
+A value >0 specifies the size of the private hash.
+.TP
+.BI "int prctl(PR_FUTEX_HASH, PR_FUTEX_HASH_GET_IMMUTABLE);
+Return 1 if the hash has been made immutable and not be changed.
+Otherwise 0.
+.\"
+.SH RETURN VALUE
+On success,
+these calls return a nonnegative value.
+On error, \-1 is returned, and
+.I errno
+is set to indicate the error.
+.SH STANDARDS
+Linux.
+.SH HISTORY
+Linux 6.16.
+.SH SEE ALSO
+.BR prctl (2) ,
+.BR futex (2) ,
+.BR futex (7)
Signature · 1 line
2.49.0
Signature · 1 line
<https://www.alejandro-colomar.es/>
#5 lore raw
Quoted 1 line · Alejandro Colomar

Hi Sebastian,

Hi Alejandro,

…

Quoted 2 lines
Quoted 2 lines
man/man2const/PR_FUTEX_HASH.2const new file +0 -0

…

Quoted 7 lines

man/man2const/PR_FUTEX_HASH.2const line 33

Quoted 3 lines
man/man2const/PR_FUTEX_HASH.2const new file +3 -0
+number of CPUs in the system.
+Since the mapping from the provided
+.I uaddr

This is the only reference in the entire page, and is also not mentioned in prctl(2). I guess it refers to the one passed to futex(2), but I think that should be mentioned.

I reworded the sentence and hopefully improved it. And yes, it refers to the argument passed to futex(2).

Sebastian