From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
To: Alejandro Colomar <alx@kernel.org>
Cc: linux-man@vger.kernel.org, linux-kernel@vger.kernel.org,
"André Almeida" <andrealmeid@igalia.com>,
"Darren Hart" <dvhart@infradead.org>,
"Davidlohr Bueso" <dave@stgolabs.net>,
"Ingo Molnar" <mingo@redhat.com>,
"Juri Lelli" <juri.lelli@redhat.com>,
"Peter Zijlstra" <peterz@infradead.org>,
"Thomas Gleixner" <tglx@linutronix.de>,
"Valentin Schneider" <vschneid@redhat.com>,
"Waiman Long" <longman@redhat.com>
Subject: Re: [PATCH] prctl: Add documentation for PR_FUTEX_HASH
Date: Tue, 20 May 2025 12:40:02 +0200 [thread overview]
Message-ID: <20250520104002.UVH8Rg0B@linutronix.de> (raw)
In-Reply-To: <fuudjpar7kv7liwj4aucekktkzuhkalzkhsz5gv3mxzletlstk@tzokaret52cv>
On 2025-05-17 15:41:26 [+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..c6a6396729770
> > --- /dev/null
> > +++ b/man/man2const/PR_FUTEX_HASH.2const
> > @@ -0,0 +1,112 @@
…
> > +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.
>
Understood.
> 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.
…
> > +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".
> $ 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.
> > +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.
> > +.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?
it is unsigned long as per prctl() prototype. I added it here.
Sebastian
next prev parent reply other threads:[~2025-05-20 10:40 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-05-16 16:14 Sebastian Andrzej Siewior
2025-05-17 13:41 ` Alejandro Colomar
2025-05-20 10:40 ` Sebastian Andrzej Siewior [this message]
2025-05-20 10:42 ` [PATCH v2] " Sebastian Andrzej Siewior
2025-05-22 12:22 ` Alejandro Colomar
2025-05-26 15:55 ` Sebastian Andrzej Siewior
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=20250520104002.UVH8Rg0B@linutronix.de \
--to=bigeasy@linutronix.de \
--cc=alx@kernel.org \
--cc=andrealmeid@igalia.com \
--cc=dave@stgolabs.net \
--cc=dvhart@infradead.org \
--cc=juri.lelli@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-man@vger.kernel.org \
--cc=longman@redhat.com \
--cc=mingo@redhat.com \
--cc=peterz@infradead.org \
--cc=tglx@linutronix.de \
--cc=vschneid@redhat.com \
/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
all inboxes | Powered by JetHome®