Received: from sender4-pp-o94.zoho.com (sender4-pp-o94.zoho.com [136.143.188.94]) (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 07ECD381B1D for ; Mon, 13 Jul 2026 06:22:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=pass smtp.client-ip=136.143.188.94 ARC-Seal:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783923752; cv=pass; b=pz6ade4a4FVEeFYpVFtmUeu+9tjf7bvwBzDQZJ+mwmeV9cNxDnldOcerGSf1REyj6d5auqn24BZYvOCpvkweORM4xCay6xRcvULxTl+DM0lghBuhYazP4PKO29CTmrSpAJ6mkCZ937RpuTnFT2mhu6M6SrLERLdpSU7ujvBulhk= ARC-Message-Signature:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783923752; c=relaxed/simple; bh=qZplGQYOwEQLiRuxXWYoV3WabZI8cszfZRq1xNX7iCY=; h=From:Subject:Date:Message-Id:MIME-Version:Content-Type:To:Cc; b=ClaVrn4RCZYnWAESA0FLxH9y5Fls9Idi3EmN7rVK4eF3wkRZBT9NyrYR20YYIswMV7FUN0Ha1Suf0E+/2rC3jVp/jsURSHOoxkC0GMCaa+gPBAo9jpd4erAf2hQOHE+6d5X1xwFgN0FmrBG+93CE8v+L4aw7FrTMcnVbHkhzuPA= ARC-Authentication-Results:i=2; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=zohomail.com; spf=pass smtp.mailfrom=zohomail.com; dkim=pass (1024-bit key) header.d=zohomail.com header.i=kingxukai@zohomail.com header.b=byjaxGz3; arc=pass smtp.client-ip=136.143.188.94 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=zohomail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=zohomail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=zohomail.com header.i=kingxukai@zohomail.com header.b="byjaxGz3" ARC-Seal: i=1; a=rsa-sha256; t=1783923728; cv=none; d=zohomail.com; s=zohoarc; b=ig2CE/nNFu2LjC5Q2Sp1HRFsnIgmGN+nbtfTe4zeXtlw+YesSgjod+K6jjSu9ufGxx3v4p4oHY4ClcqbfWqXZ9pZTm9eNDNs/McbzGHbRsEH8urCJiFxQcybR8b2S0OXh+rEzo/GrEVZysEo7EACn3lYHMAa/jtIQANOv6eginw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1783923728; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:MIME-Version:Message-ID:Subject:Subject:To:To:Message-Id:Reply-To; bh=v59M8CAvQYlAEgtbxkYVxipUEPWh7zaXZj4d9rUVbvo=; b=VvlKvKX4P9DlWrtFRBwUadM8xJKhyVIniNR1mHb03tz3fEU/RIOk+lv2NKMZdf0aVu56ODslb0a9OD0i07jOHOARj/rToHl6wRCSHtdcXx2ejWZx/g4eot65Pr6yJJwxvERfTlKmW5GNsuy6proeoHZNFlNj69L1n+YL2Ug9fIo= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass header.i=zohomail.com; spf=pass smtp.mailfrom=kingxukai@zohomail.com; dmarc=pass header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1783923728; s=zm2022; d=zohomail.com; i=kingxukai@zohomail.com; h=From:From:Subject:Subject:Date:Date:Message-Id:Message-Id:MIME-Version:Content-Type:Content-Transfer-Encoding:To:To:Cc:Cc:Feedback-ID:Reply-To; bh=v59M8CAvQYlAEgtbxkYVxipUEPWh7zaXZj4d9rUVbvo=; b=byjaxGz3oxJueh4fSWeLgPH2oYPqlR/XUH8SUv+ghuawtZgioqIOKGGIRMirwWys vNWRwUzDbVkC5ChtTMTz1jVM3lKEOei/TUUi4k4IPQLXj/ONyB3EVT1J5qls58LXyNM cLx1BCTtE5kLYOz8UI7i+JYIg3FCZzb4v2WGy9jE= Received: by mx.zohomail.com with SMTPS id 1783923725624471.84771470327576; Sun, 12 Jul 2026 23:22:05 -0700 (PDT) From: Xukai Wang Subject: [PATCH RFC v2] sched/proxy: Defer donor commit until proxy resolution Date: Mon, 13 Jul 2026 14:21:33 +0800 Message-Id: <20260713-sched-proxy-v2-0-729170082633@zohomail.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="utf-8" Content-Transfer-Encoding: 7bit X-B4-Tracking: v=1; b=H4sIAO2DVGoC/22OzQ6CMBCEX4Xs2ZpSfmo5mZj4AF4Nh/4sUiNUW yQq4d2t6NHLJrOZ+WYmCOgtBqiSCTyONljXR8FWCehW9ick1kQNjLKScspJ0C0acvXu8SR5TnN VouDSCIiJq8fGPhbaEQ77HdTfZ7irM+rhw/nZPN7usWv4eZUMSLTrOjtUSSoUV0ZnMi0KKhWLN 2dcZ1kmCoWaa4my4cws9NaGwfnnsn9MF9jfqWNKKCkE26imNGgaun251nXSXtaxF+p5nt+8Eyz 3DAEAAA== X-Change-ID: 20260707-sched-proxy-4404b6e97ad9 To: Ingo Molnar , John Stultz , Peter Zijlstra , Juri Lelli , Vincent Guittot , Dietmar Eggemann , Steven Rostedt , Ben Segall , Mel Gorman , Valentin Schneider , K Prateek Nayak Cc: linux-kernel@vger.kernel.org, Xukai Wang X-Mailer: b4 0.15.2 Feedback-ID: zu0801122732b483cbe5b006191baf3eff0000547b85e8f1df101dfa047398e8aab835bfd9c7488fe8afeaef:ZohoMail X-Zoho-CM-AccountID: 2ee5dd3c83366259b2ba1e9826250ffebed1ef2dd213857d649ad25aba73b429 X-ZohoMailClient: External Hi, This RFC tries to decouple proxy candidate selection from donor commit in the scheduler core. Currently pick_next_task() does not only select a task. It also commits the selected task into the scheduling class state through put_prev_set_next_task(). With proxy execution enabled, the selected task may be a blocked donor, and __schedule() then calls find_proxy_task() to resolve the proxy chain and find the task that should actually run. If find_proxy_task() returns NULL, __schedule() goes back to pick_again. However, the picked donor has already been committed into the class current state. This means the scheduler may first set_next() a blocked donor and then immediately abandon that choice when proxy resolution fails. This patch changes the model so that pick_next_task() only returns a candidate. The actual class commit is moved to __schedule(), after proxy resolution. I am keeping this as RFC and including John, as discussed in the v1 thread, to check whether find_proxy_task() or the wider proxy series relies on rq->donor being updated to the picked donor before proxy-chain resolution. Signed-off-by: Xukai Wang --- Changes in v2: - Move the final put_prev_set_next_task()/rq_set_donor() after the proxy/non-proxy branches. - Move zap_balance_callbacks() from the NULL/idle proxy-resolution paths into proxy_resched_idle(), next to the idle commit. - Link to v1: https://patch.msgid.link/20260707-sched-proxy-v1-0-5928bf6dedf0@zohomail.com --- Xukai Wang (1): sched/proxy: Defer donor commit until after proxy resolution kernel/sched/core.c | 90 +++++++++++++++++++++++++++++------------------------ 1 file changed, 49 insertions(+), 41 deletions(-) --- base-commit: 19b7bdc3a1550ab2550427c33395bec7caeaf72d change-id: 20260707-sched-proxy-4404b6e97ad9 Best regards, -- Xukai Wang