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


Groups > linux.kernel > #1214541

Re: wake_up_process implied memory barrier clarification

From Peter Zijlstra <peterz@infradead.org>
Newsgroups linux.kernel
Subject Re: wake_up_process implied memory barrier clarification
Date 2015-08-27 14:50 +0200
Message-ID <q24MY-4IH-43@gated-at.bofh.it> (permalink)
References <q24tA-4lT-9@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Thu, Aug 27, 2015 at 02:27:27PM +0200, Michal Hocko wrote:
> Hi,
> I have just stumbled over the comment above wake_up_process which
> claims:
> "
>  * It may be assumed that this function implies a write memory barrier before
>  * changing the task state if and only if any tasks are woken up.
> "
> 
> but try_to_wake_up does smp_mb__before_spinlock and did smp_wmb
> since 04e2f1741d235 unconditionally. The comment was added when the
> smp_wmb was in place already so I am wondering whether the comment is
> wrong/misleading.
> 
> Could somebody clarify please?

Its true for wake_up(), since that bails early if the waitqueue list is
empty.

I suspect there was no exception made for wake_up_process() to simplify
the rules.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

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


Thread

wake_up_process implied memory barrier clarification Michal Hocko <mhocko@kernel.org> - 2015-08-27 14:30 +0200
  Re: wake_up_process implied memory barrier clarification Peter Zijlstra <peterz@infradead.org> - 2015-08-27 14:50 +0200
    Re: wake_up_process implied memory barrier clarification Michal Hocko <mhocko@kernel.org> - 2015-08-27 15:20 +0200
      Re: wake_up_process implied memory barrier clarification Oleg Nesterov <oleg@redhat.com> - 2015-08-27 20:30 +0200
        Re: wake_up_process implied memory barrier clarification Michal Hocko <mhocko@kernel.org> - 2015-08-28 17:00 +0200
          Re: wake_up_process implied memory barrier clarification Oleg Nesterov <oleg@redhat.com> - 2015-08-28 18:10 +0200
            Re: wake_up_process implied memory barrier clarification Boqun Feng <boqun.feng@gmail.com> - 2015-08-29 11:30 +0200
              Re: wake_up_process implied memory barrier clarification Oleg Nesterov <oleg@redhat.com> - 2015-08-29 16:40 +0200
                Re: wake_up_process implied memory barrier clarification Boqun Feng <boqun.feng@gmail.com> - 2015-08-31 02:40 +0200
                Re: wake_up_process implied memory barrier clarification Oleg Nesterov <oleg@redhat.com> - 2015-08-31 20:40 +0200
                Re: wake_up_process implied memory barrier clarification "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> - 2015-08-31 22:50 +0200
                Re: wake_up_process implied memory barrier clarification Boqun Feng <boqun.feng@gmail.com> - 2015-09-01 05:50 +0200
                Re: wake_up_process implied memory barrier clarification "Paul E. McKenney" <paulmck@linux.vnet.ibm.com> - 2015-09-01 06:10 +0200
                Re: wake_up_process implied memory barrier clarification Oleg Nesterov <oleg@redhat.com> - 2015-09-01 12:10 +0200
                Re: wake_up_process implied memory barrier clarification Boqun Feng <boqun.feng@gmail.com> - 2015-09-01 17:00 +0200
                Re: wake_up_process implied memory barrier clarification Oleg Nesterov <oleg@redhat.com> - 2015-09-01 18:50 +0200
                Re: wake_up_process implied memory barrier clarification Boqun Feng <boqun.feng@gmail.com> - 2015-09-02 03:20 +0200
                Re: wake_up_process implied memory barrier clarification Oleg Nesterov <oleg@redhat.com> - 2015-09-01 11:50 +0200

csiph-web