From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752885AbbHaUk5 (ORCPT ); Mon, 31 Aug 2015 16:40:57 -0400 Received: from e36.co.us.ibm.com ([32.97.110.154]:55042 "EHLO e36.co.us.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752853AbbHaUkz (ORCPT ); Mon, 31 Aug 2015 16:40:55 -0400 X-Helo: d03dlp03.boulder.ibm.com X-MailFrom: paulmck@linux.vnet.ibm.com X-RcptTo: linux-kernel@vger.kernel.org Date: Mon, 31 Aug 2015 13:37:39 -0700 From: "Paul E. McKenney" To: Oleg Nesterov Cc: Boqun Feng , Michal Hocko , Peter Zijlstra , LKML , David Howells , Linus Torvalds , Jonathan Corbet Subject: Re: wake_up_process implied memory barrier clarification Message-ID: <20150831203739.GX4029@linux.vnet.ibm.com> Reply-To: paulmck@linux.vnet.ibm.com References: <20150827122727.GC27052@dhcp22.suse.cz> <20150827124334.GY16853@twins.programming.kicks-ass.net> <20150827131444.GE27052@dhcp22.suse.cz> <20150827182654.GA12191@redhat.com> <20150828145121.GG5301@dhcp22.suse.cz> <20150828160637.GA4393@redhat.com> <20150829092514.GA3240@fixme-laptop.cn.ibm.com> <20150829142707.GA19263@redhat.com> <20150831003719.GC924@fixme-laptop.cn.ibm.com> <20150831183335.GA26333@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150831183335.GA26333@redhat.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 15083120-0021-0000-0000-0000122AC6D7 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Aug 31, 2015 at 08:33:35PM +0200, Oleg Nesterov wrote: > On 08/31, Boqun Feng wrote: > > > > Fair enough, I went too far. How about just a single paragraph saying > > that: > > > > The wake_up(), wait_event() and their friends have proper barriers in > > them, but these implicity barriers are only for the correctness for > > sleep and wakeup. So don't rely on these barriers for things that are > > neither wait-conditons nor task states. > > > > Is that OK to you? > > Ask Paul ;) but personally I agree. > > To me, the only thing a user should know about wake_up/try_to_wake_up > and barriers is that you do not need another barrier between setting > condition and waking up. Sounds like an excellent idea in general. But could you please show me a short code snippet illustrating where you don't need the additional barrier, even if the fastpaths are taken so that there is no sleep and no wakeup? Thanx, Paul