[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1465496321-10898-1-git-send-email-parri.andrea@gmail.com>
Date: Thu, 9 Jun 2016 20:18:41 +0200
From: Andrea Parri <parri.andrea@...il.com>
To: Oleg Nesterov <oleg@...hat.com>,
Peter Zijlstra <peterz@...radead.org>
Cc: LKML <linux-kernel@...r.kernel.org>,
Andrea Parri <parri.andrea@...il.com>
Subject: [PATCH] events/uprobes: move smp_read_barrier_depends() where needed
There is no need to use the barrier if there is no dereference/
memory access; move it where needed (currently, affecting only
Alpha). While touching this, also make the reads _ONCE().
Signed-off-by: Andrea Parri <parri.andrea@...il.com>
---
kernel/events/uprobes.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/kernel/events/uprobes.c b/kernel/events/uprobes.c
index b7a525ab2083..b1364acd683e 100644
--- a/kernel/events/uprobes.c
+++ b/kernel/events/uprobes.c
@@ -1520,10 +1520,11 @@ static unsigned long get_trampoline_vaddr(void)
struct xol_area *area;
unsigned long trampoline_vaddr = -1;
- area = current->mm->uprobes_state.xol_area;
- smp_read_barrier_depends();
- if (area)
- trampoline_vaddr = area->vaddr;
+ area = READ_ONCE(current->mm->uprobes_state.xol_area);
+ if (area) {
+ smp_read_barrier_depends();
+ trampoline_vaddr = READ_ONCE(area->vaddr);
+ }
return trampoline_vaddr;
}
--
1.9.1
Powered by blists - more mailing lists