From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756002AbbH0Mnk (ORCPT ); Thu, 27 Aug 2015 08:43:40 -0400 Received: from casper.infradead.org ([85.118.1.10]:49622 "EHLO casper.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753733AbbH0Mnj (ORCPT ); Thu, 27 Aug 2015 08:43:39 -0400 Date: Thu, 27 Aug 2015 14:43:34 +0200 From: Peter Zijlstra To: Michal Hocko Cc: LKML , Oleg Nesterov , David Howells , Linus Torvalds Subject: Re: wake_up_process implied memory barrier clarification Message-ID: <20150827124334.GY16853@twins.programming.kicks-ass.net> References: <20150827122727.GC27052@dhcp22.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150827122727.GC27052@dhcp22.suse.cz> User-Agent: Mutt/1.5.21 (2012-12-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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.