mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andrea Parri <parri.andrea@gmail.com>
To: Oleg Nesterov <oleg@redhat.com>, Peter Zijlstra <peterz@infradead.org>
Cc: LKML <linux-kernel@vger.kernel.org>,
	Andrea Parri <parri.andrea@gmail.com>
Subject: [PATCH] events/uprobes: move smp_read_barrier_depends() where needed
Date: Thu,  9 Jun 2016 20:18:41 +0200	[thread overview]
Message-ID: <1465496321-10898-1-git-send-email-parri.andrea@gmail.com> (raw)

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@gmail.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

             reply	other threads:[~2016-06-09 18:19 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-09 18:18 Andrea Parri [this message]
2016-06-10  7:03 ` Oleg Nesterov
2016-06-10 12:26   ` Oleg Nesterov
     [not found]     ` <CAPZ9YJY_6mB797YRG4=byTbz6WTH91GZjba9zDQhZ+J0C-khSg@mail.gmail.com>
2016-06-10 13:07       ` Oleg Nesterov
2016-06-10 14:39         ` Oleg Nesterov
     [not found]           ` <CAPZ9YJYPynX2vGgFarhiyUN0GF--h6r2kbhJ4pRt2NMY1qCODg@mail.gmail.com>
2016-06-10 19:36             ` Oleg Nesterov
     [not found]   ` <CAPZ9YJaxdqpCh9DyD7ubrTEhCL9jEdMzNN6zJHsOPYGN5NNPXg@mail.gmail.com>
2016-06-10 12:59     ` Oleg Nesterov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1465496321-10898-1-git-send-email-parri.andrea@gmail.com \
    --to=parri.andrea@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=oleg@redhat.com \
    --cc=peterz@infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®