From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753691AbbKBWMd (ORCPT ); Mon, 2 Nov 2015 17:12:33 -0500 Received: from bombadil.infradead.org ([198.137.202.9]:36957 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751968AbbKBWMa (ORCPT ); Mon, 2 Nov 2015 17:12:30 -0500 Date: Mon, 2 Nov 2015 23:12:22 +0100 From: Peter Zijlstra To: Paul Turner Cc: Ingo Molnar , Oleg Nesterov , LKML , Paul McKenney , boqun.feng@gmail.com, Jonathan Corbet , mhocko@kernel.org, dhowells@redhat.com, Linus Torvalds , will.deacon@arm.com Subject: Re: [PATCH 2/4] sched: Document Program-Order guarantees Message-ID: <20151102221222.GB17308@twins.programming.kicks-ass.net> References: <20151102132901.157178466@infradead.org> <20151102134940.883198067@infradead.org> <20151102203442.GW17308@twins.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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 Mon, Nov 02, 2015 at 02:09:20PM -0800, Paul Turner wrote: > If we went this route, we could do something like: > > + * So in this case the scheduler does not provide an obvious full barrier; but > + * the smp_store_release() in finish_lock_switch(), paired with the control-dep > + * and smp_rmb() in try_to_wake_up() form a release-acquire pair and fully > + * order things between CPU0 and CPU1. > > Instead of having this, which is complete, but hard to synchronize > with the points at which it actually matters. Just use acquire and > release above, then at the actual site, e.g. in try_to_wake_up() > document how we deliver the acquire required by the higher level > documentation/requirements. Right, which was most of the point of trying to introduce smp_cond_acquire(), abstract out the tricky cond-dep and rmb trickery so we can indeed talk about release+acquire like normal people ;-)