From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) (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 0D45F339872 for ; Wed, 18 Mar 2026 12:59:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=90.155.50.34 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773838804; cv=none; b=lGhe8FxhpvntUSjM+Odhp+JsgMbMu2t3LTSIxbPYFUJBForITAM25Jn9pOykBMHGBzsspK8M7RD33h2ZYNLJ0uBtQ4FQ3tOaCyKMJ3eBkOlKRrVWerwepoqVqjYZnfgUL4/yqskZzGLW/ZHv7S4f/HObyPFr/DZAziRxX8MD6t8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773838804; c=relaxed/simple; bh=N8dF0Qmo3hgcv/6zLatrQWicfDNOvmobGKmQlfft0Do=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=bof3IWs7CAqdz5adYNb3iaNhOQ7htyK1NztcTUqLePUqOg2h/ObyzBlZKDSc43qW7lvjJoSxKSvIorTP1tcdSqs1R+iawcOCo/8fx7VArnmB6Qmx1QApGBLqS3bVSBNT97kuNisLpWBmY1V+6nxiNLXABecDiROaAMKY1Dax25U= 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=j72tiH0a; arc=none smtp.client-ip=90.155.50.34 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="j72tiH0a" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; 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=C56YPVkRV8wqrHyLaY6ug7hqZERlptwRBKZg/QGVG0s=; b=j72tiH0apnqGjun2WIzHd+Plp+ jE4LdW8s9KyvoAlJWebqmco0CG9AVIjsqM0sD8te8BWYQpx18iy7eIk3CkIJW/86LQd6sDEhh5xDo /8w+wPeZbsTFpZdiTjZXIKwldoqPo1eaMZJfPsKx6CehO4R+HfjPgCiSDEPXssz0vhNP0tQP3ksBX fUgMG6XGWModEE2CdLZJFb18bb0kD+XX82AVnukaL3HO9r2HIG4kkjLmI01pgU4LtrVTp5Rlc6Uzt 18bro23qJOgu04T85nRhcOW7YlAT3+yo+G2+yxB04v3HKy3F4/4Nrah+nBK9Sos3xJdnHdv7OUfNO WwY4fSAw==; Received: from 77-249-17-252.cable.dynamic.v4.ziggo.nl ([77.249.17.252] helo=noisy.programming.kicks-ass.net) by casper.infradead.org with esmtpsa (Exim 4.98.2 #2 (Red Hat Linux)) id 1w2qUx-00000004Pr4-1cl0; Wed, 18 Mar 2026 12:59:43 +0000 Received: by noisy.programming.kicks-ass.net (Postfix, from userid 1000) id 3D6533007C4; Wed, 18 Mar 2026 13:59:42 +0100 (CET) Date: Wed, 18 Mar 2026 13:59:42 +0100 From: Peter Zijlstra To: John Stultz Cc: LKML , Joel Fernandes , Qais Yousef , Ingo Molnar , Juri Lelli , Vincent Guittot , Dietmar Eggemann , Valentin Schneider , Steven Rostedt , Ben Segall , Zimuzo Ezeozue , Mel Gorman , Will Deacon , Waiman Long , Boqun Feng , "Paul E. McKenney" , Metin Kaya , Xuewen Yan , K Prateek Nayak , Thomas Gleixner , Daniel Lezcano , Suleiman Souhlal , kuyo chang , hupu , kernel-team@android.com Subject: Re: [PATCH v25 9/9] sched: Handle blocked-waiter migration (and return migration) Message-ID: <20260318125942.GI3738010@noisy.programming.kicks-ass.net> References: <20260313023022.2902479-1-jstultz@google.com> <20260313023022.2902479-10-jstultz@google.com> 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: <20260313023022.2902479-10-jstultz@google.com> On Fri, Mar 13, 2026 at 02:30:10AM +0000, John Stultz wrote: > Add logic to handle migrating a blocked waiter to a remote > cpu where the lock owner is runnable. > > Additionally, as the blocked task may not be able to run > on the remote cpu, add logic to handle return migration once > the waiting task is given the mutex. > > Because tasks may get migrated to where they cannot run, also > modify the scheduling classes to avoid sched class migrations on > mutex blocked tasks, leaving find_proxy_task() and related logic > to do the migrations and return migrations. > > This was split out from the larger proxy patch, and > significantly reworked. > > Credits for the original patch go to: > Peter Zijlstra (Intel) > Juri Lelli > Valentin Schneider > Connor O'Brien > > Signed-off-by: John Stultz This patch wants the below.. Otherwise clang-22+ builds will be sad. --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -6676,6 +6676,7 @@ static bool proxy_deactivate(struct rq * */ static void proxy_migrate_task(struct rq *rq, struct rq_flags *rf, struct task_struct *p, int target_cpu) + __must_hold(__rq_lockp(rq)) { struct rq *target_rq = cpu_rq(target_cpu); @@ -6718,6 +6719,7 @@ static void proxy_migrate_task(struct rq static void proxy_force_return(struct rq *rq, struct rq_flags *rf, struct task_struct *p) + __must_hold(__rq_lockp(rq)) { struct rq *this_rq, *target_rq; struct rq_flags this_rf; @@ -6811,6 +6813,7 @@ static void proxy_force_return(struct rq */ static struct task_struct * find_proxy_task(struct rq *rq, struct task_struct *donor, struct rq_flags *rf) + __must_hold(__rq_lockp(rq)) { enum { FOUND, DEACTIVATE_DONOR, MIGRATE, NEEDS_RETURN } action = FOUND; struct task_struct *owner = NULL;