All of lore.kernel.org
 help / color / mirror / Atom feed
From: Frederic Weisbecker <frederic@kernel.org>
To: Alan Stern <stern@rowland.harvard.edu>
Cc: Thomas Gleixner <tglx@kernel.org>,
	Peter Zijlstra <peterz@infradead.org>,
	boqun@kernel.org, LKML <linux-kernel@vger.kernel.org>,
	"Cc: Hyunwoo Kim" <imv4bel@gmail.com>,
	Oleg Nesterov <oleg@redhat.com>,
	Christian Brauner <brauner@kernel.org>,
	John Stultz <jstultz@google.com>, Ingo Molnar <mingo@kernel.org>,
	Alexander Viro <viro@zeniv.linux.org.uk>,
	"Eric W. Biederman" <ebiederm@xmission.com>,
	stable@vger.kernel.org
Subject: Re: [patch V2 1/8] signal: Prevent exec() race
Date: Wed, 16 Sep 2026 15:25:46 +0200	[thread overview]
Message-ID: <aqqY2hmuzOVVBFdQ@localhost.localdomain> (raw)
In-Reply-To: <3c6865d9-a4b0-4fd9-a6d2-c4f4e1f94d29@rowland.harvard.edu>

Le Fri, Sep 11, 2026 at 03:05:47PM -0400, Alan Stern a écrit :
> On Fri, Sep 11, 2026 at 02:27:56PM +0200, Frederic Weisbecker wrote:
> > What I would love to see documented for example is our case: acquire semantics,
> > which are described to apply one-way from a single memory target, are also
> > transferrable to other memory targets when there is a data dependency
> > involved between them.
> 
> "Transferrable" is not the word I would use, nor does it describe the 
> way you should think about this.
> 
> This is just an example of the fact that ordering is transitive.  So if:
> 
> 	write A is ordered before write B (by an intervening UNLOCK-LOCK 
> 	pair), and
> 
> 	write B is ordered before read C (because C reads from B and is
> 	on a different CPU), and
> 
> 	read C is ordered before read D (by an address dependency), and
> 
> 	read D is ordered before read E (because D happens to be a
> 	load-acquire)...
> 
> then of course A is ordered before E.

Right, transitive fits much better here.

> 
> The exact nature of the individual orderings -- such as the fact that 
> one of them is a dependency -- doesn't matter.  What matters is that in 
> terms of the times when these operations execute, we have A < B < C < D 
> < E.  Naturally this implies A < E.  As well as B < E, C < E, and so on.
> 
> As such, I don't think it's important to send much time on this in the 
> documentation.  It should be pretty obvious.

Ok

> The one thing to watch out for is the imprecision of the phrase "ordered 
> before".  When writes are involved, the order in which the writes occur 
> is not the only factor; you also have to consider the order in which 
> those writes become visible to other CPUs.  In the example above, we 
> know that the UNLOCK-LOCK pair causes write A to become visible to C's 
> CPU before write B does.  Therefore, since write B definitely is visible 
> to read C, it follows that any read on C's CPU that is ordered after C 
> will observe write A.

Right, heh, terminology indeed matters here more than anywhere :-)

Thanks for all the explanations!

-- 
Frederic Weisbecker
SUSE Labs

  reply	other threads:[~2026-09-16 13:25 UTC|newest]

Thread overview: 57+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-05 18:58 [patch V2 0/8] exec/exit: POSIX timer related bugfixes and related cleanups Thomas Gleixner
2026-09-05 18:59 ` [patch V2 1/8] signal: Prevent exec() race Thomas Gleixner
2026-09-06 13:17   ` Oleg Nesterov
2026-09-06 22:39   ` Eric W. Biederman
2026-09-06 23:28     ` Oleg Nesterov
2026-09-07 11:26     ` Thomas Gleixner
2026-09-07 12:31   ` Frederic Weisbecker
2026-09-07 15:26     ` Thomas Gleixner
2026-09-07 20:15       ` Frederic Weisbecker
2026-09-07 22:28         ` Thomas Gleixner
2026-09-08 10:15           ` Frederic Weisbecker
2026-09-09  0:03             ` Oleg Nesterov
2026-09-09  9:17               ` Frederic Weisbecker
2026-09-09  8:04             ` Peter Zijlstra
2026-09-09  9:08               ` Thomas Gleixner
2026-09-09  9:55                 ` Peter Zijlstra
2026-09-09 10:20                   ` Peter Zijlstra
2026-09-09 11:31                   ` Thomas Gleixner
2026-09-09 12:13                   ` Frederic Weisbecker
2026-09-09 12:45                     ` Peter Zijlstra
2026-09-09 12:51                       ` Peter Zijlstra
2026-09-09 13:45                         ` Thomas Gleixner
2026-09-09 15:48                           ` Frederic Weisbecker
2026-09-09 16:00                           ` Frederic Weisbecker
2026-09-09 14:33                       ` Alan Stern
2026-09-09 14:45                       ` Frederic Weisbecker
2026-09-09 19:28                         ` Alan Stern
2026-09-09 20:49                           ` Thomas Gleixner
2026-09-09 21:11                             ` Alan Stern
2026-09-10 13:21                               ` Frederic Weisbecker
2026-09-10 13:28                                 ` Peter Zijlstra
2026-09-11  9:58                                   ` Frederic Weisbecker
2026-09-11 10:22                                     ` Peter Zijlstra
2026-09-11 12:36                                       ` Frederic Weisbecker
2026-09-11 14:52                                       ` Alan Stern
2026-09-10 15:26                                 ` Alan Stern
2026-09-11 12:27                                   ` Frederic Weisbecker
2026-09-11 19:05                                     ` Alan Stern
2026-09-16 13:25                                       ` Frederic Weisbecker [this message]
2026-09-09 10:18                 ` Frederic Weisbecker
2026-09-09  9:11               ` Frederic Weisbecker
2026-09-05 18:59 ` [patch V2 2/8] exec: Cleanup POSIX timers right after de_thread() Thomas Gleixner
2026-09-06 13:21   ` Oleg Nesterov
2026-09-07 22:13   ` Frederic Weisbecker
2026-09-05 18:59 ` [patch V2 3/8] posix-timers: Move posixtimer_exec_cleanup() out of exec.c Thomas Gleixner
2026-09-10 13:50   ` Frederic Weisbecker
2026-09-05 18:59 ` [patch V2 4/8] posix-timers: Move POSIX timer group exit related code out of do_exit() Thomas Gleixner
2026-09-10 13:59   ` Frederic Weisbecker
2026-09-05 18:59 ` [patch V2 5/8] posix-cpu-timers: Move inlines out of public header Thomas Gleixner
2026-09-10 14:00   ` Frederic Weisbecker
2026-09-05 18:59 ` [patch V2 6/8] posix-cpu-timers: Use PF_EXITING to indicate exit Thomas Gleixner
2026-09-05 18:59 ` [patch V2 7/8] posix-cpu-timers: Prevent enqueueing when PF_EXITING is set Thomas Gleixner
2026-09-06 16:26   ` Oleg Nesterov
2026-09-07 12:20     ` Thomas Gleixner
2026-09-05 18:59 ` [patch V2 8/8] posix-timers: Handle exit in do_exit() completely Thomas Gleixner
2026-09-06 16:40   ` Oleg Nesterov
2026-09-07 12:27     ` Thomas Gleixner

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=aqqY2hmuzOVVBFdQ@localhost.localdomain \
    --to=frederic@kernel.org \
    --cc=boqun@kernel.org \
    --cc=brauner@kernel.org \
    --cc=ebiederm@xmission.com \
    --cc=imv4bel@gmail.com \
    --cc=jstultz@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=oleg@redhat.com \
    --cc=peterz@infradead.org \
    --cc=stable@vger.kernel.org \
    --cc=stern@rowland.harvard.edu \
    --cc=tglx@kernel.org \
    --cc=viro@zeniv.linux.org.uk \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.