Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=52.101.52.10 ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass; t=1796193570; b=pJjogfpaFDyFwrmC3GUqqhE6EeUTSNkkpMcLu772V8umOW9RQphcDOcg78L+4Dbg2tHx 10tlkG/dz1+XbDPmdkcO5V7GjzM4cispCBQJKg2Oy3HG/fAYmIBTDKt5b48H+mDu5bbfO KYIjGtgvcwzrf4no+juVY6KlRf/HtqgLWCShpvSbwVe63LRWZMDjUcqecXo6CtUnkxOVw x/+SaOej78OCXUB3DHXuVY8WldbJ49kMkCOaufXtliN15m85DSSkhx9k3QsnLC8EfC8I6 ZqhDcWA0LMhs7zECwoIBbtcd69Dm9WLY0YzH8eLMZl/flsSPo7ROraCcpXAs9eykj1Q== ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796193570; h=DMARC-Filter:DKIM-Signature:Received:Received: X-MS-Exchange-Authentication-Results:Received-SPF:Received:Received: Received:Message-ID:Date:MIME-Version:User-Agent:Subject:To:CC: References:Content-Language:From:In-Reply-To:Content-Type: Content-Transfer-Encoding:X-EOPAttributedMessage: X-MS-PublicTrafficType:X-MS-TrafficTypeDiagnostic: X-MS-Office365-Filtering-Correlation-Id:X-MS-Exchange-SenderADCheck: X-MS-Exchange-AntiSpam-Relay:X-Microsoft-Antispam: X-Microsoft-Antispam-Message-Info:X-Forefront-Antispam-Report: X-MS-Exchange-AntiSpam-MessageData-ChunkCount: X-MS-Exchange-AntiSpam-MessageData-0:X-OriginatorOrg: X-MS-Exchange-CrossTenant-OriginalArrivalTime: X-MS-Exchange-CrossTenant-Network-Message-Id: X-MS-Exchange-CrossTenant-Id: X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: X-MS-Exchange-CrossTenant-AuthSource:X-MS-Exchange-CrossTenant-AuthAs: X-MS-Exchange-CrossTenant-FromEntityHeader: X-MS-Exchange-Transport-CrossTenantHeadersStamped; bh=8Fa0vuRE7clAlgA2LcmXWHt+PsGrDsm37tHwPwey7/M=; b=GQ6Gs3tQr5lB+UCx0v10bNg/pp+39vsIM3jNievpAjbC2oON93DMRnfSW5nKn7OnuuTZ WkPtuRwrE6SphXiosVqkqKTZgPsUnfoQuhcnfrPZAl2+zEJqGPFMjSVoIpJEYG8kva9QI iO/FwFkmgPxh5GUO2qcICFRptN0kHAltWqzoj7NJhZGua1F5Xbp9UbvfysI1yWbKYcCYW kYGJke5QhKVq2l7WTx4kRI4SCc4rng6VeZAoVHHCVYyji3QopetQywxizM0v0nnvKBfhb ntIkXZaGBhZ/hUM21TPlUH64f4mstTedsxwNE00jEVBjZyGrFixluVMVdBmtMmh6n2g== ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass header.from=amd.com; spf=fail smtp.mailfrom=amd.com; dkim=pass header.d=amd.com header.i=@amd.com header.a=rsa-sha256 header.s=selector1 header.b=pgPrbNpT; arc=pass header.oldest-pass=0 smtp.remote-ip=52.101.52.10 Received: from BL2PR02CU003.outbound.protection.outlook.com (mail-eastusazon11011010.outbound.protection.outlook.com [52.101.52.10]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (secp384r1) server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2B8F1606A31A for ; Wed, 2 Dec 2026 06:39:29 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 2B8F1606A31A Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=amd.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key, unprotected) header.d=amd.com header.i=@amd.com header.a=rsa-sha256 header.s=selector1 header.b=pgPrbNpT ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=bONyO8LIKuRkeV4cByA9//BpGrmnrUJMNjK71Nzz87JgNEwZNJRULkAhN3GZYR2oLyOVc6wkcCcrri/LwsrcdZLksrPPjlR6XnmiL4sWa4sUZrod/5jNeh1Jma3keV5HqE9a9PYgsAgTE0QZugo9RDSUt1HNZ0iwxLwsHmxyO1VewkK62ubSnVP7VCoGvNDqlVZdSnypQcuXeL089jmhPu9tyU8mS8bpDvWI6KT8HgTIX0EOlVnbsB+Kpal9PkBSUxVXDBnMN14ZAL9J+p7mMWQWwzB9nhu+Y+7F+nfOskheCsrCx/CzCblojH4RBiOVqy+wE3nQ1sw/kTddKfSEew== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=8Fa0vuRE7clAlgA2LcmXWHt+PsGrDsm37tHwPwey7/M=; b=YCUbfhfst8bD/rUusCgOSqiWrDUax2fQwIoGjpxzYdkp0Goyg3i7NkOAixCKBCXmDdt1kqiexmbT6M6WQVp0XsmA9KW6XICLF30ldfMLgcmm/YgvsXARf8hYA3kYV7PmU/k7WRWHX1/RktyLC+p4hhOY3F7mAry+8+7EYklL+CXJFhSFpvVZy/ukmzinTR7e+zyN0VpE5sQKxg0QnOvNxI4uI4c+a3CWkrap/KfuR3vX74JW+FvvT0WPxyZ423+NBrGFqtyUaJKZVf9gWAALjp71DJUaOTjzWbYCd2dcrei7D+qgYAUZsye+WVF24BWEwUtZQ7SuxMDXGBTwL/03Wg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=google.com smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=8Fa0vuRE7clAlgA2LcmXWHt+PsGrDsm37tHwPwey7/M=; b=pgPrbNpTkTtdun45K47IQ0KOJXBvQbtqTJoTA6p7qbhVpFbNS9PI9NfHSc/m3j82IEA94XpsR9ODguvR81ifSsxEa/HVkTJxSJk89uZKhqHKKLyFmctBxWmvIAaS/97Ba0Jt0+6uuYnLUdrpHmvM+l9Wl0n209zF3UKr4ZQFuc4= Received: from BL3PEPF0000021D.NAMP221.PROD.OUTLOOK.COM (2603:10b6:20f:fc04::63a) by CH0PR12MB8529.namprd12.prod.outlook.com (2603:10b6:610:18d::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.662.12; Wed, 2 Dec 2026 06:39:23 +0000 Received: from BL6PEPF0006C3DF.namprd02.prod.outlook.com (2603:10b6:20f:fc04::a0a) by BL3PEPF0000021D.outlook.office365.com (2603:10b6:20f:fc04::63a) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.21.662.11 via Frontend Transport; Wed, 2 Dec 2026 06:39:23 +0000 X-MS-Exchange-Authentication-Results: mx.microsoft.com 1; spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=satlexmb07.amd.com; pr=C Received: from satlexmb07.amd.com (165.204.84.17) by BL6PEPF0006C3DF.mail.protection.outlook.com (10.167.249.234) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.688.5 via Frontend Transport; Wed, 2 Dec 2026 06:39:23 +0000 Received: from satlexmb08.amd.com (10.181.42.217) by satlexmb07.amd.com (10.181.42.216) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.57; Wed, 2 Dec 2026 00:39:23 -0600 Received: from [10.136.42.27] (10.180.168.240) by satlexmb08.amd.com (10.181.42.217) with Microsoft SMTP Server id 15.2.2562.57 via Frontend Transport; Wed, 2 Dec 2026 00:39:15 -0600 Message-ID: <40553a43-a60a-45c0-bc36-68f6df72d33a@amd.com> Date: Wed, 2 Dec 2026 12:09:09 +0530 X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v34 08/14] sched/proxy: Invoke migrate_task_rq() on proxy-migration To: John Stultz , LKML CC: Yu-Ting Tseng , Peter Zijlstra , Ingo Molnar , Thomas Gleixner , Juri Lelli , Vincent Guittot , Valentin Schneider , Suleiman Souhlal , Andrea Righi , Johannes Weiner , Metin Kaya , Dietmar Eggemann , Steven Rostedt , Zimuzo Ezeozue , Waiman Long , Boqun Feng , "Paul E. McKenney" , Joel Fernandes , Qais Yousef , Xuewen Yan , kuyo chang , hupu , Zhan Xusheng , "zhidao su (Xiaomi)" , Hui Su , "Shubhang Kaushik (Ampere)" , References: <20261202035248.1210026-1-jstultz@google.com> <20261202035248.1210026-9-jstultz@google.com> Content-Language: en-US From: K Prateek Nayak In-Reply-To: <20261202035248.1210026-9-jstultz@google.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BL6PEPF0006C3DF:EE_|CH0PR12MB8529:EE_ X-MS-Office365-Filtering-Correlation-Id: 730a487d-1a10-4e2d-b5c6-08df503f00ad X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|7416014|376014|82310400026|36860700016|1800799024|23010399003|4143699003|11063799006|261009223027099003|22082099003|18002099003|56012099006|261022075727099003|10067099003|261026121527099003; X-Microsoft-Antispam-Message-Info: kXxYTblEvT8JYxqYTAubBsC5L8ZyfOWzqhyS3kT0OnRuxv9DXZfbn9LjVrJ3CkhMnfvoSLMZXtu6OX6P/HuklBHo3yEelQKgcKtrZGCyYwRmDgqRikKuPIQ/rSMJTR8m11BeSjLw9aTaKmSmP7P+4I64wEssFEKhJ+OAhiMug26dNLThZuGWu3n0XDMxQ2Qup6qRDYPPaQGUDvSAlfZHJ8txal5FbLqLEyusQvEK4nsTnMwrbI+1pahw5LFhyGSRXBj+uvKGLij//sddl/7ucNB5Ic3YM6gMLBnXP7DQZfgp8sXfdk+/+C00P6DY5tsQXHRLGIpL9xMPPqPig2l0yJTtX2TG93K2RKll8ziGGPvX/95ZPv7XNUxfbdI6Lusx2iepqa46JmoE2+hkteDM7/3o+cfVdQLIjOs3hBleXCSokPRX5y1GlAVTAPP7zfaU0pbiR1dZRRjDpBWxsVopXXv/CDRcBy+eG50gtg9M+XH3ToOjjiuqXHWuuCZH2LTA0I0S2oUTjVfXQE3Ik0363+Eixda8wGBQgfgM8bJ5HHq+ennwBsJPfOCsoaJEQ4QzOoUuxAC/+t6ptmp/qjtVrOYvciSNCgGK5BtQXYmq8NH0vkfWsIuivxFrVZ6VWDuDUdiR/8982xZFPY+X3yuXi0zolFaZVvr8ii6Wz/nGUViNpuebUauGPGGnky8xGAWTHXzVsWWAXQo/bY1WQrjblA== X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:satlexmb07.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(7416014)(376014)(82310400026)(36860700016)(1800799024)(23010399003)(4143699003)(11063799006)(261009223027099003)(22082099003)(18002099003)(56012099006)(261022075727099003)(10067099003)(261026121527099003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: KVSMVNmwzecTxoAhzLJYMd0gx7wxVYXCEwn/Kh8LYXWcu0wc5kwZD6l0iCUppy3Fb9rk69MDw+HnD5fIPl2ZfyDdhoVWJ/K8eeXGZAOzSRGyxVHnrW6yWh4og7WBQu1JaVjr2niXs9DzMX7H2WXv9NId5msgWcwWGEJClU7KeZQ0mbD5cf8zu7ho6bDDu0943RgWZhcI3ublMVodSg7J851hYojNXYF2Fp2ie0H+lAmBD5Y93vf+QJZMbwEcsBrmbrEsuRZWdvxeyHpO4Lwwv3/b+W/g/Z3mUIWPIcgjqcWO7v14PCd5cElFIOxHSQTIRSibNhG0UbTnZ5iPvxh+kRed9FK2JZ+GsfSgvJf/4dw7zC+xF/uoAmWHOgr6m7rRKXrkiEj0+Lopk7h5vugUjcFfPrBAqpCenJvqyEUy1B1Rg+ZNCxYnjEVCbpQ3jQNk X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Dec 2026 06:39:23.4015 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 730a487d-1a10-4e2d-b5c6-08df503f00ad X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[satlexmb07.amd.com] X-MS-Exchange-CrossTenant-AuthSource: BL6PEPF0006C3DF.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH0PR12MB8529 Hello John, On 12/2/2026 9:22 AM, John Stultz wrote: > diff --git a/kernel/sched/core.c b/kernel/sched/core.c > index 6a9fec7a26f67..863f4e3a2051f 100644 > --- a/kernel/sched/core.c > +++ b/kernel/sched/core.c > @@ -3444,6 +3444,16 @@ void relax_compatible_cpus_allowed_ptr(struct task_struct *p) > > #ifdef CONFIG_SMP I think it is more cleaner to take set_task_cpu() out of CONFIG_SMP block since UP will just do a redundant __set_task_cpu() ... > > +static void __do_migrate_task_rq(struct task_struct *p, unsigned int new_cpu) > +{ > + if (task_cpu(p) != new_cpu) { > + if (p->sched_class->migrate_task_rq) > + p->sched_class->migrate_task_rq(p, new_cpu); > + p->se.nr_migrations++; > + perf_event_task_migrate(p); > + } > +} > + > void set_task_cpu(struct task_struct *p, unsigned int new_cpu) > { > unsigned int state = READ_ONCE(p->__state); > @@ -3493,15 +3503,11 @@ void set_task_cpu(struct task_struct *p, unsigned int new_cpu) > > trace_sched_migrate_task(p, new_cpu); > > - if (task_cpu(p) != new_cpu) { > - if (p->sched_class->migrate_task_rq) > - p->sched_class->migrate_task_rq(p, new_cpu); > - p->se.nr_migrations++; > - perf_event_task_migrate(p); > - } > - > + __do_migrate_task_rq(p, new_cpu); > __set_task_cpu(p, new_cpu); > } > +#else /* CONFIG_SMP */ > +static inline void __do_migrate_task_rq(struct task_struct *p, unsigned int new_cpu) {} > #endif /* CONFIG_SMP */ > > #ifdef CONFIG_NUMA_BALANCING > @@ -6929,6 +6935,7 @@ static inline void proxy_set_task_cpu(struct task_struct *p, int cpu) > * was previously runnable. > */ > wake_cpu = p->wake_cpu; > + __do_migrate_task_rq(p, cpu); > __set_task_cpu(p, cpu); ... and just convert this to use set_task_cpu(). We get the consistent sched_migrating traces to follow this task and if I'm not mistaken, all the checks in set_task_cpu() should be safe when called from all the proxy contexts after Andrea's fixes the. > p->wake_cpu = wake_cpu; > } -- Thanks and Regards, Prateek