Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751535AbdFIHUK (ORCPT ); Fri, 9 Jun 2017 03:20:10 -0400 Received: from bombadil.infradead.org ([65.50.211.133]:55406 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751505AbdFIHUI (ORCPT ); Fri, 9 Jun 2017 03:20:08 -0400 Date: Fri, 9 Jun 2017 09:19:57 +0200 From: Peter Zijlstra To: Krister Johansen Cc: Ingo Molnar , "Paul E. McKenney" , linux-kernel@vger.kernel.org, Steven Rostedt , Paul Gortmaker , Thomas Gleixner Subject: Re: [PATCH tip/sched/core] Add comments to aid in safer usage of swake_up. Message-ID: <20170609071957.GJ8337@worktop.programming.kicks-ass.net> References: <20170609032546.GF2553@templeofstupid.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20170609032546.GF2553@templeofstupid.com> User-Agent: Mutt/1.5.22.1 (2013-10-16) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 512 Lines: 9 On Thu, Jun 08, 2017 at 08:25:46PM -0700, Krister Johansen wrote: > The behavior of swake_up() differs from that of wake_up(), and from the > swake_up() that came from RT linux. A memory barrier, or some other > synchronization, is needed prior to a swake_up so that the waiter sees > the condition set by the waker, and so that the waker does not see an > empty wait list. Urgh.. let me stare at that. But it sounds like the wrong solution since we wanted to keep the wait and swait APIs as close as possible.