[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20160610125904.GA8203@redhat.com>
Date: Fri, 10 Jun 2016 14:59:04 +0200
From: Oleg Nesterov <oleg@...hat.com>
To: Andrea Parri <parri.andrea@...il.com>
Cc: Peter Zijlstra <peterz@...radead.org>,
LKML <linux-kernel@...r.kernel.org>
Subject: Re: [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@...hat.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.
Powered by blists - more mailing lists