Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1328260

Re: [PATCH v5] futex: Remove requirement for lock_page in get_futex_key

From Ingo Molnar <mingo@kernel.org>
Newsgroups linux.kernel
Subject Re: [PATCH v5] futex: Remove requirement for lock_page in get_futex_key
Date 2016-02-06 09:30 +0100
Message-ID <qZ6pH-4By-1@gated-at.bofh.it> (permalink)
References (1 earlier) <qYo5k-6yj-7@gated-at.bofh.it> <qYwcx-5aH-13@gated-at.bofh.it> <qYwmf-5e9-27@gated-at.bofh.it> <qYLbz-6TD-1@gated-at.bofh.it> <qYSZr-3G7-1@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


* Davidlohr Bueso <dave@stgolabs.net> wrote:

> On Fri, 05 Feb 2016, Ingo Molnar wrote:
> 
> >So I too didn't understand that sentence at first, because the capitalization
> >really throws off quick parsing of that comment, as 'MB' ususally denotes
> >megabytes.
> 
> Sure, fair enough.
> 
> >
> >So please change it to "mb(); (A)" or so - and I think all of these comments
> >should be changed to use a standard API name for the barrier they imply, as the
> >head of futex.c does:
> >
> >*   waiters++; (a)
> >*   mb(); (A) <-- paired with -.
> >*                              |
> >*   lock(hash_bucket(futex));  |
> >*                              |
> >*   uval = *futex;             |
> >*                              |        *futex = newval;
> >*                              |        sys_futex(WAKE, futex);
> >*                              |          futex_wake(futex);
> >*                              |
> >*                              `------->  mb(); (B)
> >
> >Btw., pedantic: shouldn't that be smp_mb()? Futexes don't operate on IO spaces, so
> >on UP they only need compiler barriers.
> 
> Right, but we do in fact use smp barriers in this cases in the real code, that 
> mb() is just in the comments, I guess it would be desirable to change it to 
> smp_mb nonetheless.
> 
> However, could these changes be in a followup? Mainly because the barrier B 
> references will be updated across all futex.c... unless there are still concerns 
> about this particular patch, of course.

How about doing it first in a preparatory patch? So that reviews of patches 
actually making substantial changes don't get derailed by hard to read comments 
and so.

Thanks,

	Ingo

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

[PATCH v5] futex: Remove requirement for lock_page in get_futex_key Davidlohr Bueso <dave@stgolabs.net> - 2016-02-04 07:40 +0100
  Re: [PATCH v5] futex: Remove requirement for lock_page in  get_futex_key Thomas Gleixner <tglx@linutronix.de> - 2016-02-04 10:10 +0100
    Re: [PATCH v5] futex: Remove requirement for lock_page in  get_futex_key Davidlohr Bueso <dave@stgolabs.net> - 2016-02-04 18:50 +0100
      Re: [PATCH v5] futex: Remove requirement for lock_page in  get_futex_key Thomas Gleixner <tglx@linutronix.de> - 2016-02-04 19:00 +0100
        Re: [PATCH v5] futex: Remove requirement for lock_page in  get_futex_key Ingo Molnar <mingo@kernel.org> - 2016-02-05 10:50 +0100
          Re: [PATCH v5] futex: Remove requirement for lock_page in  get_futex_key Davidlohr Bueso <dave@stgolabs.net> - 2016-02-05 19:10 +0100
            Re: [PATCH v5] futex: Remove requirement for lock_page in  get_futex_key Ingo Molnar <mingo@kernel.org> - 2016-02-06 09:30 +0100

csiph-web