[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20160610122537.GA7776@redhat.com>
Date: Fri, 10 Jun 2016 14:26:18 +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, Oleg Nesterov 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.
and perhaps it would be better to eliminate this smp_read_barrier_depends()
altogether, we have a lot of helpers. I mean,
static unsigned long get_trampoline_vaddr(void)
{
struct xol_area *area;
area = lockless_dereference(current->mm->uprobes_state.xol_area);
if (area)
return area->vaddr;
return -1;
}
looks a bit more simple/clean. Note also another smp_read_barrier_depends()
in get_xol_area() which can be changed the same way.
What do you think?
Oleg.
Powered by blists - more mailing lists