From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751331AbcBMMKW (ORCPT ); Sat, 13 Feb 2016 07:10:22 -0500 Received: from casper.infradead.org ([85.118.1.10]:55964 "EHLO casper.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750858AbcBMMKV (ORCPT ); Sat, 13 Feb 2016 07:10:21 -0500 Date: Sat, 13 Feb 2016 13:09:53 +0100 From: Peter Zijlstra To: Waiman Long Cc: Ingo Molnar , linux-kernel@vger.kernel.org, Linus Torvalds , Ding Tianhong , Jason Low , Davidlohr Bueso , "Paul E. McKenney" , Thomas Gleixner , Will Deacon , Tim Chen , Waiman Long Subject: Re: [PATCH v2 4/4] sched/fair: Abort wakeup when task is no longer in a sleeping state Message-ID: <20160213120953.GA6357@twins.programming.kicks-ass.net> References: <1455298335-53229-1-git-send-email-Waiman.Long@hpe.com> <1455298335-53229-5-git-send-email-Waiman.Long@hpe.com> <20160212201845.GX6357@twins.programming.kicks-ass.net> <56BE4D15.4000002@hpe.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <56BE4D15.4000002@hpe.com> 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 Fri, Feb 12, 2016 at 04:22:29PM -0500, Waiman Long wrote: > >>+ smp_cond_acquire(!p->on_cpu || !(p->state& state)); > >>+ if (!(p->state& state)) { > >>+ success = 0; > >>+ goto out; > >>+ } > >This doesn't make sense, if we managed to get here, p->on_rq must be > >false, which means the other side is already in the middle of > >schedule(). > Yes, you are right. It is my bad that I miss the on_rq check earlier. Just > scrap the last patch. No worries, that is tricky code :-)