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 49BB23321A2 for ; Fri, 29 May 2026 08:51:04 +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=1780044666; cv=none; b=bs23zZdfPCJZDt9DqeE8bAjGNLzSGTf3iyJCk3TqbQOl7mdYiocnJxz+RT0WpLOj3EcRS6mYVLQNGOi/umUK1Sy4sfNfb3X3OjHqS6v6DqzQNWqwYEzHrGaTuzIQsG77Hi5058gDIFp4ljQhPJYR0d/Oe1KCDFp2PMlsGl161yA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780044666; c=relaxed/simple; bh=EtNjB7J9hlW9nqAl/85LJgJMF21Tr7sXS/lhL4HlTKk=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=OQCz6JU+6XO3HVfAKRwGy+iv+6w8mUC5iWFXY7kgZCiFNqxJyuhlyiG28IoUOOdhuUVLyESkwP/xuFpG4uO1XAEyHObNy7hOklCCIAREq/FtGDDpx8RqbU+DcBfptUL1CTF4mvwDUI474IjjDlZqHtqiRjM9b6NcRzrfs74bj3A= 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=VFQYbaNU; 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="VFQYbaNU" 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=8pR6V2fJeDudSw0dFEGlTCzJ+SjK9unpTNcURKVCQyM=; b=VFQYbaNUsU3vYdFgelrqCcbGt6 AAEMrwWGZsGfSgw9vvn2YVOM97211EcwpnJ0X+gQBmdYCUyHRSRsW/JElYezK2geZN3kW+DsrcOH/ 4Uic3vh3ARbOHyqSWLDLsS0dCv1OgJbPMY0rzycClro400g5O8p6dCSFmwm5pK5DFC5KQX588iaSp fuzbT8JrdNpzkpJylgjHUPwVsUs31iNBWj/AS1hWjcXn5M2FZ+k7+36azvqBs7ZoCB23Mc3t/Z3tk gG5wDzC8DqzAwzkVtpcTCUf9Yh027Sz1Yd2QrTUC0eCVFO5/pgIXUJpyd6Zi7cCuVRcAwPom0g3SF 81gEJAUA==; 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 1wSsvd-00000000pG4-1fig; Fri, 29 May 2026 08:50:53 +0000 Received: by noisy.programming.kicks-ass.net (Postfix, from userid 1000) id 0F6E4300673; Fri, 29 May 2026 10:50:53 +0200 (CEST) Date: Fri, 29 May 2026 10:50:53 +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: <20260529085053.GA3568911@noisy.programming.kicks-ass.net> References: <20260526111609.433880331@infradead.org> <20260526113322.120970670@infradead.org> <20260529084712.GL343181@noisy.programming.kicks-ass.net> 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: <20260529084712.GL343181@noisy.programming.kicks-ass.net> On Fri, May 29, 2026 at 10:47:12AM +0200, Peter Zijlstra wrote: > 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. Argh, github is such an absolute terrible piece of shit :-( It won't even let me browse git trees because of rate-limiting or something stupid -- I've done less than 10 clicks on the site and it says I hit a limit and should wait and/or log in. Fuckers.