Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1419368
| Path | csiph.com!feeder.erje.net!1.us.feeder.erje.net!newsfeed.fsmpi.rwth-aachen.de!newsfeed.straub-nv.de!news.mixmin.net!aioe.org!gothmog.csi.it!bofh.it!news.nic.it!robomod |
|---|---|
| From | Oleg Nesterov <oleg@redhat.com> |
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH] events/uprobes: move smp_read_barrier_depends() where needed |
| Date | Fri, 10 Jun 2016 15:10:02 +0200 |
| Message-ID | <rIume-4YI-5@gated-at.bofh.it> (permalink) |
| References | <rIcIF-1zJ-1@gated-at.bofh.it> <rIoJP-1vU-21@gated-at.bofh.it> <rItJx-4w2-45@gated-at.bofh.it> <rIume-4YI-7@gated-at.bofh.it> |
| MIME-Version | 1.0 |
| Content-Type | text/plain; charset=us-ascii |
| Content-Disposition | inline |
| User-Agent | Mutt/1.5.24 (2015-08-30) |
| X-Scanned-By | MIMEDefang 2.68 on 10.5.11.26 |
| X-Greylist | Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Fri, 10 Jun 2016 13:07:37 +0000 (UTC) |
| Sender | robomod@news.nic.it |
| List-ID | <linux-kernel.vger.kernel.org> |
| X-Mailing-List | linux-kernel@vger.kernel.org |
| Approved | robomod@news.nic.it |
| Lines | 55 |
| Organization | linux.* mail to news gateway |
| X-Original-Cc | Peter Zijlstra <peterz@infradead.org>, LKML <linux-kernel@vger.kernel.org> |
| X-Original-Date | Fri, 10 Jun 2016 15:07:33 +0200 |
| X-Original-Message-ID | <20160610130733.GB8203@redhat.com> |
| X-Original-References | <1465496321-10898-1-git-send-email-parri.andrea@gmail.com> <20160610070310.GA6843@redhat.com> <20160610122537.GA7776@redhat.com> <CAPZ9YJY_6mB797YRG4=byTbz6WTH91GZjba9zDQhZ+J0C-khSg@mail.gmail.com> |
| X-Original-Sender | linux-kernel-owner@vger.kernel.org |
| Xref | csiph.com linux.kernel:1419368 |
Show key headers only | View raw
On 06/10, Andrea Parri wrote:
>
> On Fri, Jun 10, 2016 at 2:26 PM, Oleg Nesterov <oleg@redhat.com> wrote:
>
> > 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?
> >
>
> More simply/clean, as you said, maybe; one advantage of keeping
> the "raw" smp_read_barrier_depends() in get_trampoline_vaddr() is
> that we can avoid it when area is NULL;
Do you really think it makes sense to optimize out read_barrier_depends here?
It can only be NULL in handle_swbp(), and in this case we are going to do a
lot of work, and in particular install this xol vma,
> a similar solution is adopt-
> ed in kernel/task_work.c:task_work_cancel().
Heh ;) this code was written before we had lockless_dereference(). And I do
remember I thought that we need such a helper when read_barrier_depends()
was added.
Oleg.
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH] events/uprobes: move smp_read_barrier_depends() where needed Andrea Parri <parri.andrea@gmail.com> - 2016-06-09 20:20 +0200
Re: [PATCH] events/uprobes: move smp_read_barrier_depends() where needed Oleg Nesterov <oleg@redhat.com> - 2016-06-10 09:10 +0200
Re: [PATCH] events/uprobes: move smp_read_barrier_depends() where needed Oleg Nesterov <oleg@redhat.com> - 2016-06-10 14:30 +0200
Re: [PATCH] events/uprobes: move smp_read_barrier_depends() where needed Oleg Nesterov <oleg@redhat.com> - 2016-06-10 15:10 +0200
Re: [PATCH] events/uprobes: move smp_read_barrier_depends() where needed Oleg Nesterov <oleg@redhat.com> - 2016-06-10 16:50 +0200
Re: [PATCH] events/uprobes: move smp_read_barrier_depends() where needed Oleg Nesterov <oleg@redhat.com> - 2016-06-10 21:40 +0200
Re: [PATCH] events/uprobes: move smp_read_barrier_depends() where needed Oleg Nesterov <oleg@redhat.com> - 2016-06-10 15:00 +0200
csiph-web