From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965029AbbLCN3o (ORCPT ); Thu, 3 Dec 2015 08:29:44 -0500 Received: from casper.infradead.org ([85.118.1.10]:58518 "EHLO casper.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750922AbbLCN3n (ORCPT ); Thu, 3 Dec 2015 08:29:43 -0500 Date: Thu, 3 Dec 2015 14:29:38 +0100 From: Peter Zijlstra To: Boqun Feng Cc: mingo@kernel.org, oleg@redhat.com, linux-kernel@vger.kernel.org, paulmck@linux.vnet.ibm.com, corbet@lwn.net, mhocko@kernel.org, dhowells@redhat.com, torvalds@linux-foundation.org, will.deacon@arm.com, waiman.long@hpe.com, pjt@google.com Subject: Re: [PATCH 4/4] sched: Document Program-Order guarantees Message-ID: <20151203132938.GB3816@twins.programming.kicks-ass.net> References: <20151203124010.627312076@infradead.org> <20151203124339.665446482@infradead.org> <20151203131648.GA2460@fixme-laptop> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20151203131648.GA2460@fixme-laptop> 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, Dec 03, 2015 at 09:16:48PM +0800, Boqun Feng wrote: > On Thu, Dec 03, 2015 at 01:40:14PM +0100, Peter Zijlstra wrote: > [snip] > > + * > > + * CPU0 (schedule) CPU1 (try_to_wake_up) CPU2 (schedule) > > + * > > + * LOCK rq(0)->lock LOCK X->pi_lock > > + * dequeue X > > + * sched-out X > > + * smp_store_release(X->on_cpu, 0); > > + * > > + * smp_cond_acquire(!X->on_cpu); > > + * X->state = WAKING > > + * set_task_cpu(X,2) > > + * > > + * LOCK rq(2)->lock > > + * enqueue X > > + * X->state = RUNNING > > + * UNLOCK rq(2)->lock > > + * > > + * LOCK rq(2)->lock // orders against CPU1 > > + * sched-out Z > > + * sched-in X > > + * UNLOCK rq(1)->lock > ^^^^^^^^^^^^^^^ > > This is a typo, right? Should be "UNLOCK rq(2)->lock". Duh, yes. Fixed. Thanks.