lkml.org 
[lkml]   [2023]   [Jul]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 0/2] fix vma->anon_vma check for per-VMA locking; fix anon_vma memory ordering
On Thu, Jul 27, 2023 at 10:11:29AM -0700, Linus Torvalds wrote:
> On Thu, 27 Jul 2023 at 08:44, Alan Stern <stern@rowland.harvard.edu> wrote:
> >
> > This reads a little oddly, perhaps because it's a fragment from a larger
> > piece of code.
>
> Yes. As Jann already said, this is basically a preparatory step in a
> much longer sequence, and the code simply wants to make sure that any
> later code (possibly quite a bit later) will not see a NULL value.

...

> Do we even have the same-location rule in the LKMM?

Yes. The comment in the source file calls it "Sequential Consistency
Per Variable", under the category of "Fundamental coherence ordering".
It applies even to plain accesses, not just to READ_ONCE or stronger.

But in the presence of data races (as in the example that Will posted
earlier), all bets are off. So if you want to use a plain access rather
than READ_ONCE, you need to be certain that it won't race with anything.

Alan Stern

\
 
 \ /
  Last update: 2023-07-27 19:43    [W:0.047 / U:0.560 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site