mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Davidlohr Bueso <dave@stgolabs.net>
To: Jann Horn <jannh@google.com>
Cc: "Thomas Gleixner" <tglx@kernel.org>,
	"Peter Zijlstra" <peterz@infradead.org>,
	"Hyunwoo Kim" <imv4bel@gmail.com>,
	"Ingo Molnar" <mingo@redhat.com>,
	"Darren Hart" <dvhart@infradead.org>,
	"Andr� Almeida" <andrealmeid@igalia.com>,
	"kernel list" <linux-kernel@vger.kernel.org>,
	"Sebastian Andrzej Siewior" <bigeasy@linutronix.de>
Subject: Re: [BUG] futex: scheduling-while-atomic because nested vfork can break guard(private_hash)
Date: Fri, 11 Sep 2026 10:51:12 -0700	[thread overview]
Message-ID: <20260911175112.uipptpp545u5v5qp@offworld> (raw)
In-Reply-To: <CAG48ez3Rsgzva+45hNrBjxwEONvNrDdq8W7vyzuhkXfehBHc4w@mail.gmail.com>

On Fri, 11 Sep 2026, Jann Horn wrote:

>On Fri, Sep 11, 2026 at 1:51???PM Thomas Gleixner <tglx@kernel.org> wrote:
>> On Fri, Sep 11 2026 at 11:04, Peter Zijlstra wrote:
>> > Per commit: ee9dce44362b ("futex: Drop CLONE_THREAD requirement for private default hash alloc")
>> > the reason for excluding vfork() was performance and thinking this
>> > would/could not matter, which you've proven to be clearly false.
>> >
>> > Thomas?
>>
>> I don't remember why we excluded VFORK in the first place. Sebastian?
>
>That was introduced in commit ee9dce44362b ("futex: Drop CLONE_THREAD
>requirement for private default hash alloc"), and the commit message
>says:
>
>| Loosen the check to cover any CLONE_VM clone, except vfork().  Excluding
>| vfork keeps the existing paths untouched (no overhead), and we can't
>| race in the first place: either the parent is suspended and the child
>| runs alone, or mm->futex_ref is already allocated from an earlier
>| CLONE_VM.
>
>So I think that was purely supposed to be a performance optimization
>for single-threaded processes that do vfork()+exec()?

Right, but didn't really measure anything and am certainly fine with
Peter's fixlet. Sorry for breaking things.

Thanks,
Davidlohr

  reply	other threads:[~2026-09-11 17:51 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-10 15:27 Jann Horn
2026-09-11  8:36 ` Peter Zijlstra
2026-09-11  9:04   ` Peter Zijlstra
2026-09-11 11:51     ` Thomas Gleixner
2026-09-11 15:28       ` Jann Horn
2026-09-11 17:51         ` Davidlohr Bueso [this message]
2026-09-15 11:06     ` Sebastian Andrzej Siewior
2026-09-15 11:37       ` Peter Zijlstra
2026-09-16 12:23     ` [tip: locking/urgent] futex: Also allocate private hash on vfork() tip-bot2 for Peter Zijlstra
2026-09-11 15:31   ` [BUG] futex: scheduling-while-atomic because nested vfork can break guard(private_hash) Jann Horn

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=20260911175112.uipptpp545u5v5qp@offworld \
    --to=dave@stgolabs.net \
    --cc=andrealmeid@igalia.com \
    --cc=bigeasy@linutronix.de \
    --cc=dvhart@infradead.org \
    --cc=imv4bel@gmail.com \
    --cc=jannh@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=tglx@kernel.org \
    /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®