lkml.org 
[lkml]   [2016]   [Jun]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] events/uprobes: move smp_read_barrier_depends() where needed
On 06/10, Andrea Parri wrote:
>
> On Fri, Jun 10, 2016 at 9:03 AM, Oleg Nesterov <oleg@redhat.com> wrote:
>
> > On 06/09, Andrea Parri wrote:
> > >
> > > There is no need to use the barrier if there is no dereference/
> > > memory access; move it where needed (currently, affecting only
> > > Alpha).
> >
> > OK, although area == NULL is unlikely case,
> >
> > > While touching this, also make the reads _ONCE().
> >
> > Why? both xol_area/vaddr can't change.
> >
>
> This is to ensure current (and future) compiler transformations
> won't optimize out or reorder the reads (do not ask me how ...,
> IAC the volatile casts will prevent this to happen).
>
> AFAICT, xol_area can be "== NULL" and "!= NULL" ...

Yes, but it can't change if it is not NULL. So we do not care if gcc
reads xol_area/vaddr twice or reorderes this with other LOADs.

Oleg.

\
 
 \ /
  Last update: 2016-06-10 15:41    [W:0.091 / U:0.356 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site