From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D5FC73BAD91 for ; Fri, 29 May 2026 08:47:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=90.155.92.199 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780044473; cv=none; b=ehM/RA6zg1kPKSBbCn72/NGY7FIFhF3Yo7gNAXwByWYixguvgFqv5gb3s4pnlmiMcqAjD5sYTxFESPWzGZqIL5rMPig21tnv3mG2uQ08zSlWemAFh2o/f+MwB+gkKkPDsGomMvqEqKML5hAo/rR4Qc5cerummtB7Rf46FAnYKOM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780044473; c=relaxed/simple; bh=4c1dRSqAs48CVy/E/BS1yBhnNpViB84GhTtRGy+m9I4=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=Nw3xtDuKuy1cPep+Ce9RxhHyB0kp6AZn3WMl4D7U19qIFKUu1sKrQRi/jkZA/QJ+P4d4aKKda3DusjCkO+2YwMGS3e5rSPG46BhmNAxzED1hevHX0n2lBljv3BzehgD+MrbT0V9aQEAvCA9M2wRucg80TA/AJFk60+UCbEsal8E= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=infradead.org; spf=none smtp.mailfrom=infradead.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b=Pjx5NFWB; arc=none smtp.client-ip=90.155.92.199 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=infradead.org Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=infradead.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="Pjx5NFWB" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=ulpgvkoKeQ+mS3zSW4t4SgrZkiMulHQnswAyUYw0ROY=; b=Pjx5NFWBiAhwH9WtIjyGqY3+Ub HFF1MGduibsFsDEU+dbldCJFtTjERiBiR3bmOC+6TB77PQWRwYN9lk3Q84ue6mPgKtxdDCVz9dbiP 8sWDDslKkUVk7GWhN3zkkFqzGYa+RDe7ViHtfQ9mPUDzOgaFVDbIXdiYw6xU2sz2zp0FtKM4Ue7JP poeB37OXDPBIIVOwFyM0AeowQwoZoslWkaJ/aIlJxqWZ1y4MDxJudQKo7WJEvmBFeLFpUA/2CQcqv GE22BMkv8nkvIlC6zFWexa+gEH+JohGBS0G85q6bJ43rQ00btRffqdqt2kvNdMNG2Bi3V+0cF0MU3 N1fSedng==; Received: from 77-249-17-252.cable.dynamic.v4.ziggo.nl ([77.249.17.252] helo=noisy.programming.kicks-ass.net) by desiato.infradead.org with esmtpsa (Exim 4.99.1 #2 (Red Hat Linux)) id 1wSssQ-00000000ofn-3RSD; Fri, 29 May 2026 08:47:35 +0000 Received: by noisy.programming.kicks-ass.net (Postfix, from userid 1000) id 5D23A300673; Fri, 29 May 2026 10:47:12 +0200 (CEST) Date: Fri, 29 May 2026 10:47:12 +0200 From: Peter Zijlstra To: K Prateek Nayak Cc: John Stultz , Joel Fernandes , Qais Yousef , Ingo Molnar , Juri Lelli , Vincent Guittot , Dietmar Eggemann , Valentin Schneider , Steven Rostedt , Ben Segall , Zimuzo Ezeozue , Will Deacon , Waiman Long , Boqun Feng , "Paul E. McKenney" , Metin Kaya , Xuewen Yan , Thomas Gleixner , Daniel Lezcano , Suleiman Souhlal , kuyo chang , hupu , linux-kernel@vger.kernel.org, Mike Galbraith Subject: Re: [PATCH 1/6] sched/proxy: Remove superfluous clear_task_blocked_in() Message-ID: <20260529084712.GL343181@noisy.programming.kicks-ass.net> References: <20260526111609.433880331@infradead.org> <20260526113322.120970670@infradead.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: On Fri, May 29, 2026 at 12:15:09PM +0530, K Prateek Nayak wrote: > diff --git a/kernel/sched/core.c b/kernel/sched/core.c > index a125e65c35bb..fe903976fd09 100644 > --- a/kernel/sched/core.c > +++ b/kernel/sched/core.c > @@ -3764,28 +3764,28 @@ static inline void proxy_reset_donor(struct rq *rq) > */ > static inline bool proxy_needs_return(struct rq *rq, struct task_struct *p) > { > - if (!p->is_blocked) > - return false; > - > - /* > - * Typically per __set_task_cpu(), task_cpu(p) == p->wake_cpu. > - * > - * However, proxy_set_task_cpu() is such that it preserves the > - * original cpu in p->wake_cpu while migrating p for proxy reasons > - * (possibly outside of the allowed p->cpus_ptr). > - * > - * Furthermore, migration_cpu_stop() / __migrate_swap_task(), will > - * only set p->wake_cpu when !p->on_rq, and since here p->on_rq, this > - * will not apply. But if it did, this check is the safe way around > - * and would migrate. > - */ > - if (task_cpu(p) == p->wake_cpu) > + if (!task_is_blocked(p)) > return false; > > scoped_guard(raw_spinlock, &p->blocked_lock) { > /* Task is waking up; clear any blocked_on relationship */ > __clear_task_blocked_on(p, NULL); > > + /* > + * Typically per __set_task_cpu(), task_cpu(p) == p->wake_cpu. > + * > + * However, proxy_set_task_cpu() is such that it preserves the > + * original cpu in p->wake_cpu while migrating p for proxy reasons > + * (possibly outside of the allowed p->cpus_ptr). > + * > + * Furthermore, migration_cpu_stop() / __migrate_swap_task(), will > + * only set p->wake_cpu when !p->on_rq, and since here p->on_rq, this > + * will not apply. But if it did, this check is the safe way around > + * and would migrate. > + */ > + if (task_cpu(p) == p->wake_cpu) > + return false; > + > /* If already current, don't need to return migrate */ > if (task_current(rq, p)) > return false; Egads, this is terrible. This means all is_blocked tasks always end up taking blocked_lock. The other suggestion (in the other subthread) was to simply delay this patch until the end. That seems far more sensible. Anyway, let me go try and find your git tree and see what you ended up with.