From nobody Tue Dec 2 02:51:17 2025 Received: from CH5PR02CU005.outbound.protection.outlook.com (mail-northcentralusazon11012005.outbound.protection.outlook.com [40.107.200.5]) (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 1AA7F340DBE for ; Mon, 17 Nov 2025 18:56:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.200.5 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763405793; cv=fail; b=NkQiicdt9kuOQEynNbTQsrr+N31cbar6yiCB73e+pUx7vL7XTqBelFfZasvjk4lDIJBNCgtPt0FyKm0S1Uxn7Yf8IQTUXizSHDj/kIEW+Q0NOLFaJDpDJ/JJQsdNPcCbvUFJ3rotN4nyEFOJL0aWjdU3nu+ptzwhIVylRIlpZxQ= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763405793; c=relaxed/simple; bh=fDDFP51Nv+NKWG6fVMbEkzsoOdCWvNmfphIDWPx+jqY=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=Zx/14W6E6mmgWya131qtA3imAK2/MuidQgk/JQhLmH78I3OumjyYk1BomatMdtuSxaLJgurGIbzFwrB9gQTzFmLNliNfR1pE6OG0e2P40NFzps5GYj63NCB1ZBK0tBUOK8Gv9H1vJQ+TkOScJQcfAdprNUHbG3hEyvfyKlgJvqQ= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com; spf=fail smtp.mailfrom=amd.com; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b=Y6FFo1XJ; arc=fail smtp.client-ip=40.107.200.5 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) header.d=amd.com header.i=@amd.com header.b="Y6FFo1XJ" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=gookFXKMQe++KOkhHWUZ0TXTXSZBsuGJI9SISBClvqJPjgapyoMg8VQ+jdFh1mgkNB8VfBRdnTt55Hg1aRHN9rQLrzfzhEO9eV9J3ZDDqz/aJQDgeLPp+mQjWnlIW1Vq3hryYae9j3qe+YNlsVIgylW48HqQIPjvLZG5coIKKht2XQEmcIVGARvvRK8ZstPlXKkYprD9IRXNuACBph/Ztmcsc6KS/mr/anqMUplVc4KN/6yxYt66FVqjO9Z1Tho7xU5ej5b/L2ey90NJxWSNf+dAXigHFvMCvNQf/cKMXWal0YPR3I+/aXf+qJE2jXbkZkwNzMaiAHBwJAJKMd/H5g== 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=Ni2dfh5+BDCYvFcsG0PlCDV+D2GLhrTVz+J0MjkunhQ=; b=nx5SL+eEV+dMt9CUKNpkjq2jhpJAQ7RWtLoucFlKpZL/zte5cFXHhUCptA9cQLb2JqXgncTO7mmJy2EKTWMkb0KUkoVkOzqbDFFzCujvcvh9GhghZocOqQlGsQlCaygpRon+KgGsj6yZN0YqFF4f5A+UEdgjnsl46foZOSfyS6727Pdc+0obgJX6/QBtGyV9yyofZte6sh31w3CH5BBCM7C2dsdn29IMNgiH6vfzAIs2ZnUpmd/o1reDdbF8pOpXoRzDaBOLkn0huvErD6PdVD9Q8ZUieKWMwEsl3WhwO5QjkQpf3J3cNgUNmgcefuT1TkdJNeVPJygaLW71MjHPHQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=redhat.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=Ni2dfh5+BDCYvFcsG0PlCDV+D2GLhrTVz+J0MjkunhQ=; b=Y6FFo1XJ8vclQRdpoiFNBkC/ZZSrdoqlagC/eb0mSGHPvYgSt/TLVZSFpYumrCsIWkbiYRQToq3zmv4T8mx00b81vTHw02V/HVxDeztHH3SO6+AcRd75quWiNLUfogvjIl7GuTRYInskBAaqfBr/dWpXrflEU36luRCjuOzaxc4= Received: from SA9PR13CA0104.namprd13.prod.outlook.com (2603:10b6:806:24::19) by LV8PR12MB9417.namprd12.prod.outlook.com (2603:10b6:408:204::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9320.22; Mon, 17 Nov 2025 18:56:27 +0000 Received: from SA2PEPF000015CB.namprd03.prod.outlook.com (2603:10b6:806:24:cafe::85) by SA9PR13CA0104.outlook.office365.com (2603:10b6:806:24::19) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.9343.10 via Frontend Transport; Mon, 17 Nov 2025 18:56:27 +0000 X-MS-Exchange-Authentication-Results: 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 SA2PEPF000015CB.mail.protection.outlook.com (10.167.241.201) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9343.9 via Frontend Transport; Mon, 17 Nov 2025 18:56:27 +0000 Received: from BLRKPRNAYAK.amd.com (10.180.168.240) 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.17; Mon, 17 Nov 2025 10:56:23 -0800 From: K Prateek Nayak To: Ingo Molnar , Peter Zijlstra , Juri Lelli , Vincent Guittot , John Stultz , "Johannes Weiner" , Suren Baghdasaryan , CC: Dietmar Eggemann , Steven Rostedt , Ben Segall , Mel Gorman , Valentin Schneider , K Prateek Nayak Subject: [PATCH 1/5] sched/psi: Make psi stubs consistent for !CONFIG_PSI Date: Mon, 17 Nov 2025 18:55:46 +0000 Message-ID: <20251117185550.365156-2-kprateek.nayak@amd.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20251117185550.365156-1-kprateek.nayak@amd.com> References: <20251117185550.365156-1-kprateek.nayak@amd.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: satlexmb07.amd.com (10.181.42.216) To satlexmb07.amd.com (10.181.42.216) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: SA2PEPF000015CB:EE_|LV8PR12MB9417:EE_ X-MS-Office365-Filtering-Correlation-Id: 990f0b31-65d1-4b0d-af9e-08de260b034e X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|82310400026|1800799024|36860700013|7416014|376014; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?zeCMh707YD/RO1yuKNMnUFi41ABOXoorurfG6t/ifBXjozhrAfVFnSlN7MRa?= =?us-ascii?Q?8G3/luE53DhjgK2z3hRvwGoBYJppPntwWFzJdTBTQtftf3M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Mtu2GS8dTWySmCaA7VUpgG9fp+LLDiIpF4m5d6j3EO?= =?us-ascii?Q?CiFI2xMk7rBbUuz7jYLdobqdH8ea33Mn3WlumK3o/jxwAJUcPSVAjsU+LMRw?= =?us-ascii?Q?1ajGeya7U1ySZPWskUNs8k/sPsLrRww/x4RbOAxWI49BuvsDElD+u/wEiYCe?= =?us-ascii?Q?xVZd9FUtLoTsuRKGwRQqS8+PiylTHbhUYq+I5tTG0GDsjmqDavXr3U4u+WQw?= =?us-ascii?Q?JEn6AXDkx6m49FF+Jom4xIsVe+V8dvMeGTg4HDT4aQw8R6d7nxDtLJjlZUaH?= =?us-ascii?Q?Eh/M0HD1qamVA/v+T3LgC8Kor3adMO9+SQBlAVcMPJfuvSC21lVt2rX4olI2?= =?us-ascii?Q?eHZhCkCwkR3HBdGH+c4nOhG+vPJM6uLlYCyQ4DRC5UZ6PFsOnmiqvxC5F0IT?= =?us-ascii?Q?lf70AUkZU8cdvERzUNThssCGsu5ZsSOlexJcQnBo0Z/AFpW5+crPsk73/vKk?= =?us-ascii?Q?pIjcyYPGD15L2GYCwA0bLCAaSMozZ8G5hBd8m4N88iK4qc/6ACAiv2jRH5mG?= =?us-ascii?Q?W/LLQLnu1Rlewwq5mkkIwmerhM7ZqHuoHg+NF45eN/R/ApLzoo3Zk4iwlA?= =?us-ascii?Q?=3D=3D?= X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:satlexmb07.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(82310400026)(1800799024)(36860700013)(7416014)(376014);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Nov 2025 18:56:27.4512 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 990f0b31-65d1-4b0d-af9e-08de260b034e 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: SA2PEPF000015CB.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: LV8PR12MB9417 Content-Type: text/plain; charset="utf-8" commit 1a6151017ee5 ("sched: psi: pass enqueue/dequeue flags to psi callbacks directly") modified the psi_enqueue() and psi_dequeue() functions to take the complete enqueue/dequeue flags but left the stubs for !CONFIG_PSI unaltered. Modify the stubs to also accept the flags argument to keep it consistent with CONFIG_PSI. Signed-off-by: K Prateek Nayak Reviewed-by: John Stultz Reviewed-by: Madadi Vineeth Reddy Tested-by: K Prateek Nayak --- kernel/sched/stats.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kernel/sched/stats.h b/kernel/sched/stats.h index cbf7206b3f9d..3323d773fec3 100644 --- a/kernel/sched/stats.h +++ b/kernel/sched/stats.h @@ -221,8 +221,8 @@ static inline void psi_sched_switch(struct task_struct = *prev, } =20 #else /* !CONFIG_PSI: */ -static inline void psi_enqueue(struct task_struct *p, bool migrate) {} -static inline void psi_dequeue(struct task_struct *p, bool migrate) {} +static inline void psi_enqueue(struct task_struct *p, int flags) {} +static inline void psi_dequeue(struct task_struct *p, int flags) {} static inline void psi_ttwu_dequeue(struct task_struct *p) {} static inline void psi_sched_switch(struct task_struct *prev, struct task_struct *next, --=20 2.34.1 From nobody Tue Dec 2 02:51:17 2025 Received: from CH1PR05CU001.outbound.protection.outlook.com (mail-northcentralusazon11010054.outbound.protection.outlook.com [52.101.193.54]) (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 A2A2432A3C6 for ; Mon, 17 Nov 2025 18:56:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.193.54 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763405817; cv=fail; b=fhm5K5EmGtphymUWm1ttpMDzaeJ7rW9/YSN6Q9aj2e9yRNBUWP11VKoLpRsOg5nSl2XLJh2hn8kKGq6lzIQTvO/FsSao1B2W7LAO1NcoZfrQ9IDZkS9ilk7+7WQHKSyWp0/UPHqjiH4aWjW2eIE349bDmgQVN0kguYrcQYqtO5Q= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763405817; c=relaxed/simple; bh=oSo1IszCfUM8PoDCqzrK8P+C/xpzpNNWT4nqJ1YsMbQ=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=bL7eM4C2msp+W8CBo54C2b4w3uObMfZ1Mo2roHnGvaGtW4azCABrGyM3l+h++uGYzeV0sLvLnCzDiaI0kaEdKwDv4kvv2eoxRpN97bBNPS2tDJwbO1KRvGzbVPp8M0T/5Cepubu4CVT17bRiIB8OCNHNsatq9k1q1w+JZeTbE1g= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com; spf=fail smtp.mailfrom=amd.com; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b=ombpvE8+; arc=fail smtp.client-ip=52.101.193.54 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) header.d=amd.com header.i=@amd.com header.b="ombpvE8+" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=nxOAvwEvpwanrB5TxkiRzazM/C0AQu+p4BPI6WQhvW4sFa0zuJFNOaBsuew3h46V1kWwEmZ9jY5u19Wc5Ufr1PfXBLWhtq5QiB7onCbPJSmFthRvZ0c1NKOh7PfqmjQqZsTEGLYKYisF+ZpWQy0yJhfb7JsMUmp5vRqcWOLXQgTjqNR6a7CI+PvtLrtZs++/j7Q5Z/nypu5EAos0R4tKQdIHYNoLagYLTQnIUmdyJIgnRfeS+IbvbeBj623qHWe7Je8il9gEeTm84CAE8QSahrPMUR0ef3qTiTJZA8xB7wWoGMNuGKRCsxtvy2hVx5J48l8Xr14aj8a6MWD+yMopmg== 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=8TlzZ2Ad8rvboEFa9Q7K7AbMdZWelIMho5m8afF0kgM=; b=ALQNd5KRnJSytP7xLENUoHvSwld3e8ydfxZoJ7G2VMMpzN/HdzWRRLb1nbZVqADOjGs+2mtcHY3scgliuGt2X1xpYnlFKfSVQvwfjCGb3MuLoskxPU5IIGDUCHh5L9RLeQGcgsNb6220+Ei1YZSePCWD/6Y6HqHuxGexHzB/dmwes9/+XgGOy3NTaQ7f3jWNGcOp3b9ZkExyL5ppfGUUWPIMGo0IMSQPhK7vAvNqplAwm+d6dbyTtw5Z5JQdezjVYEMtM2PhbYoVwL+Z3p2YyeJ0kQNOqkGFoxkBlvRcNLxFlnjxFuH2j+AXJy3TXs23RQs4d5cEwaBdeht+aPoeqg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=redhat.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=8TlzZ2Ad8rvboEFa9Q7K7AbMdZWelIMho5m8afF0kgM=; b=ombpvE8+OUPnyE7lNqwcJCDZmg54bfg/MZo+PEuFbZBzHDHyViYRo6JKDcTPzu4iijK+x8M7lcmEqfJdoH2NlYeWsx6Xd+RUlPQ4zcBZndUTfa0rL1Ph87i1DjkY/4uru+zqrBiRXH0QsYeH7u7Qjiwv8q15FtA4vs4ZQy7x2yI= Received: from SJ0PR03CA0045.namprd03.prod.outlook.com (2603:10b6:a03:33e::20) by DM4PR12MB6640.namprd12.prod.outlook.com (2603:10b6:8:8f::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9320.17; Mon, 17 Nov 2025 18:56:47 +0000 Received: from CO1PEPF000066ED.namprd05.prod.outlook.com (2603:10b6:a03:33e:cafe::a3) by SJ0PR03CA0045.outlook.office365.com (2603:10b6:a03:33e::20) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.9320.22 via Frontend Transport; Mon, 17 Nov 2025 18:56:47 +0000 X-MS-Exchange-Authentication-Results: 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 CO1PEPF000066ED.mail.protection.outlook.com (10.167.249.10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9343.9 via Frontend Transport; Mon, 17 Nov 2025 18:56:46 +0000 Received: from BLRKPRNAYAK.amd.com (10.180.168.240) 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.17; Mon, 17 Nov 2025 10:56:40 -0800 From: K Prateek Nayak To: Ingo Molnar , Peter Zijlstra , Juri Lelli , Vincent Guittot , John Stultz , "Johannes Weiner" , Suren Baghdasaryan , CC: Dietmar Eggemann , Steven Rostedt , Ben Segall , Mel Gorman , Valentin Schneider , K Prateek Nayak Subject: [PATCH 2/5] sched/psi: Prepend "0x" to format specifiers when printing PSI flags Date: Mon, 17 Nov 2025 18:55:47 +0000 Message-ID: <20251117185550.365156-3-kprateek.nayak@amd.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20251117185550.365156-1-kprateek.nayak@amd.com> References: <20251117185550.365156-1-kprateek.nayak@amd.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: satlexmb07.amd.com (10.181.42.216) To satlexmb07.amd.com (10.181.42.216) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CO1PEPF000066ED:EE_|DM4PR12MB6640:EE_ X-MS-Office365-Filtering-Correlation-Id: 7272e493-f906-4c29-5795-08de260b0e92 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|82310400026|7416014|1800799024|36860700013|376014; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?mFp0JD8dAsND2T1LrkW6/HjN2Y2Aq0QlJucKCxv05V+c51rJcV/nx7hoMyAT?= =?us-ascii?Q?REKheh41v7YMNbQm754T4GODlsBqt5wu9mgZQAzqMLeCnAqAPqlawkdFw1QF?= =?us-ascii?Q?JtUcckmxqvARJrtQ3tu+xU+PqQB8gBwSAmJr4u9KQgHAFRAkSNeC9hYjBOC9?= =?us-ascii?Q?8W0aBd6ODzNkIb0bAO8GMSZ0slG26kMQmmG21fbGp96Q8A4esvAXlQxJoR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MlQGxpGQKDHs+VKPJ0bDMdr3knAg+OXaS?= =?us-ascii?Q?x0wo3CAEfLZSI+Fjr0Gv1t9oZy5LFMdT9ii+WqzYY2ec/3qgyeizjWk0gx+1?= =?us-ascii?Q?QkLHcaJyUjb3wN1heMEpy8ml7/hhBvND2S0EkiFtwAWO4IxnO+64tud2IKjr?= =?us-ascii?Q?kvUb7srOFKUxwup2v7czUh2+s1uDgy+7xSyRZ+WBusktWYs+zFfwdElRTp/4?= =?us-ascii?Q?fM3uMsGz/Q19YeyFBNw8axImuAcgWFiu5kUjRau+VEUlEFsEnQtZ2XSEUN+Q?= =?us-ascii?Q?Yhmi8Q8axFPVLHcTPFtZIFoHz56Uv2pjhODBM+s0bTMmNFXkzGSF9T9ZEW/D?= =?us-ascii?Q?ca1BWih4geCF3rQodtBhtcnU7x+hjJ3Yqhmb408Ji0KqGw8/ryWHt/eCOcjK?= =?us-ascii?Q?gKAP7GF7Wi3OOCQYH/CH2SUfCMfA1I4B2ga4Q7xMf//ycM5hAxJ+Q+sgn52+?= =?us-ascii?Q?m5Er2FEQMOQ4Mh6wQlg=3D?= X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:satlexmb07.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(82310400026)(7416014)(1800799024)(36860700013)(376014);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Nov 2025 18:56:46.2820 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 7272e493-f906-4c29-5795-08de260b0e92 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: CO1PEPF000066ED.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM4PR12MB6640 Content-Type: text/plain; charset="utf-8" It is not immediately clear that the PSI flags, the set, and the clear bits printed in PSI warnings are hexadecimal values. Prepend "0x" to format specifiers to make it clear. Since "kernel/sched" uses "0x%x" as opposed to "%#x" when printing hexadecimal values, the same was followed to keep consistency. Signed-off-by: K Prateek Nayak Reviewed-by: John Stultz Tested-by: K Prateek Nayak --- kernel/sched/psi.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/kernel/sched/psi.c b/kernel/sched/psi.c index 59fdb7ebbf22..b031608c02ce 100644 --- a/kernel/sched/psi.c +++ b/kernel/sched/psi.c @@ -830,7 +830,7 @@ static void psi_group_change(struct psi_group *group, i= nt cpu, if (groupc->tasks[t]) { groupc->tasks[t]--; } else if (!psi_bug) { - printk_deferred(KERN_ERR "psi: task underflow! cpu=3D%d t=3D%d tasks=3D= [%u %u %u %u] clear=3D%x set=3D%x\n", + printk_deferred(KERN_ERR "psi: task underflow! cpu=3D%d t=3D%d tasks=3D= [%u %u %u %u] clear=3D0x%x set=3D0x%x\n", cpu, t, groupc->tasks[0], groupc->tasks[1], groupc->tasks[2], groupc->tasks[3], clear, set); @@ -896,7 +896,7 @@ static void psi_flags_change(struct task_struct *task, = int clear, int set) if (((task->psi_flags & set) || (task->psi_flags & clear) !=3D clear) && !psi_bug) { - printk_deferred(KERN_ERR "psi: inconsistent task state! task=3D%d:%s cpu= =3D%d psi_flags=3D%x clear=3D%x set=3D%x\n", + printk_deferred(KERN_ERR "psi: inconsistent task state! task=3D%d:%s cpu= =3D%d psi_flags=3D0x%x clear=3D0x%x set=3D0x%x\n", task->pid, task->comm, task_cpu(task), task->psi_flags, clear, set); psi_bug =3D 1; --=20 2.34.1 From nobody Tue Dec 2 02:51:17 2025 Received: from SJ2PR03CU001.outbound.protection.outlook.com (mail-westusazon11012000.outbound.protection.outlook.com [52.101.43.0]) (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 389E2338F2F for ; Mon, 17 Nov 2025 18:57:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.43.0 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763405830; cv=fail; b=Lq3jVwC/2bJjtVNszv6q9/r9lhkdR60/jxM+1yqmQHDdn1yCeS5XJGOV+mOS6iCMNV7SQUw7qKgEdVQxbMC1WVw0C32p7VWrPw4/XWu8lQsfTftEC2Qfwxw9b1nYEL2cQtuYMchZrOFco06U89JWe7nEIjEA0rTjyOrWWbwTQjs= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763405830; c=relaxed/simple; bh=9mUQ9hO7vC81J+ALdSlKa1y6M1KX0DXaTrWqYdzm5qE=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=W0eNIe2XP9T6WatvXuCdmsjWKpmO3dRJv75XsQptmkSu/SaRqDSOOSDI2a28eZljO01gpTb8KnXzuQqJ23QN1gIOX72wqiTxfV3/brOLQWVWDmMJ4VsHGVr5r6Z1Af9CR+iQjN1LQ9phJcDj0frkC9xF2F1Vc/Ct2lgnz5xrXLw= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com; spf=fail smtp.mailfrom=amd.com; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b=OsXC+WEn; arc=fail smtp.client-ip=52.101.43.0 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) header.d=amd.com header.i=@amd.com header.b="OsXC+WEn" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=URwr7cAue4cpXJmtpWnqgouJMtIa10myqWJbL2BBNtHYs1w9Oty3psTiL16GwTu8g9lCUoTqRW1AMo49HP3ukleQq6mOVaCplxHXIVwIyce2E/7+FuwZrz2t3GENCRIAyHfvkdmqs7OAMQ9O6Xh2LsJK04laUNBvp2QB20TasxBmIOZyIn874JgaWlAocIvmCM8R6nVcECpIthSW3V76jbdwsnWbMnQpMR0jeAQXAALFa+igSIkrbL1ZKQR9PHOZqzcRo7maGtO4z9OPTVmwOlbY8Tns94uXmc0/BNomH0F6nl64VC3+qp0azVBB8D+OBZkCUhV41FREpIi4FkgdHA== 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=10+y+kmbWzK4VCT+QLfTkyLJREuZ/fzyn1aogyiQXeM=; b=Ja9LoqAPQt+VCGOwDq/1aIJhtlRpCJCQg7unjrdL3OOPzbrsLe9j69vGhufbRJuKHe/ffbfKNFvvfrxkcNOKMjs59l+ARPbWzpljpM5K6RuJBhf0QL0tkjqXsZlAMkkapatDtCcgU5w5KGMX4shblCsFGJU5W5r9CNANpGJTXHrSZAUOsXlCpebE8o1nsjx29IpozaSjJjqJX7gHiWJsF3eYYI3D/bNAWG0gJedXQhBcTBJ7YQkWidgCKj5a5uMZyPYe7A/RheG8LbZ2VK17k+HDEH4L5qC9zUNjVu1fLYY9ncmS5ox4MnIIZwEYpFvXgjErTCM9m+Y+zm7soq9iag== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=redhat.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=10+y+kmbWzK4VCT+QLfTkyLJREuZ/fzyn1aogyiQXeM=; b=OsXC+WEnxL4/TIr0iEXPMVaeTmNksNo+/9dHqDFw051QY1a/ox14g5uCF0eFuAQODYJHFR14KfOlK0AC2axNmsEYBj174fgtB9A7Wmw+2X4fc9NgyOs7XAZ0yB5goPoay4pqpwlosLn5E0aHlxfU6vXr9I1xyDG+SJGLxWiQTQs= Received: from BYAPR08CA0068.namprd08.prod.outlook.com (2603:10b6:a03:117::45) by SA1PR12MB6917.namprd12.prod.outlook.com (2603:10b6:806:24c::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9320.22; Mon, 17 Nov 2025 18:57:03 +0000 Received: from CO1PEPF000066E8.namprd05.prod.outlook.com (2603:10b6:a03:117:cafe::f2) by BYAPR08CA0068.outlook.office365.com (2603:10b6:a03:117::45) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.9320.22 via Frontend Transport; Mon, 17 Nov 2025 18:57:03 +0000 X-MS-Exchange-Authentication-Results: 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 CO1PEPF000066E8.mail.protection.outlook.com (10.167.249.6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9343.9 via Frontend Transport; Mon, 17 Nov 2025 18:57:02 +0000 Received: from BLRKPRNAYAK.amd.com (10.180.168.240) 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.17; Mon, 17 Nov 2025 10:56:57 -0800 From: K Prateek Nayak To: Ingo Molnar , Peter Zijlstra , Juri Lelli , Vincent Guittot , John Stultz , "Johannes Weiner" , Suren Baghdasaryan , CC: Dietmar Eggemann , Steven Rostedt , Ben Segall , Mel Gorman , Valentin Schneider , K Prateek Nayak Subject: [RFC PATCH 3/5] sched/core: Track blocked tasks retained on rq for proxy Date: Mon, 17 Nov 2025 18:55:48 +0000 Message-ID: <20251117185550.365156-4-kprateek.nayak@amd.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20251117185550.365156-1-kprateek.nayak@amd.com> References: <20251117185550.365156-1-kprateek.nayak@amd.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: satlexmb07.amd.com (10.181.42.216) To satlexmb07.amd.com (10.181.42.216) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CO1PEPF000066E8:EE_|SA1PR12MB6917:EE_ X-MS-Office365-Filtering-Correlation-Id: ec8f8767-2d86-4fed-fde4-08de260b1842 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|7416014|82310400026|36860700013|1800799024; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?Usx7EAQImtycs9aPHh2tjauVmlhoPmNTmRlPq0fFCLirSunW67kggsHxaV5Q?= =?us-ascii?Q?ItNDBellGwGG4lKT3A7j9MWg8Ea31wYrqe9hHVWDGUOLtkN3JG/Kho4RjJw1?= =?us-ascii?Q?QPmbq+SsD1deIS0CEAbMQ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BZ9adwhHA?= =?us-ascii?Q?OCZZYC1zLo+bAy3o0gWxjfPiGmEoAFzzrj/+eJaQmnaL5xIbLgQNTnH5n+MF?= =?us-ascii?Q?ririPV0iSV8TbJfCpiaCTN55uWCkWRYqZn+UmHTJJmGnB5+dcGgSX7qhmAdK?= =?us-ascii?Q?HDWQDOZtG2f77eLhV5jWJWvRNoKLI07dMKC78cLNHsTBnAm+jJPBITnMsgzy?= =?us-ascii?Q?W3IgTLK6sTPHsWXPmWoUQPk+Cc73EpXxPezKkZT5areS9iGxjXXIYKtWlWk8?= =?us-ascii?Q?UxPtgxswYDUgq3Pei8/NfAcaLRqGvUH7qgcAH2fCbezNOaZZ5xs4mppCaBo7?= =?us-ascii?Q?ZUZ1rTt8z3v+UN7A3SY3gQ/t0lEYnHjdjH+wJIYGbs5KY1C0HhSsqv6kfY5d?= =?us-ascii?Q?8aaTVsYJzv41v7+YFYEirzodjWC2VY+s7ZZ6UhXgVldVrw3rarIjCv4QNwRC?= =?us-ascii?Q?3q0HRZME+DP9qin7pOLbX+VduRS8o2I+tLorCls9rSH4ODtxp3Ab0aMkBIPp?= =?us-ascii?Q?Tij/Gon4XgTx4SdnQ5dPdqAlDUd3CHJAy3sEi3lGFZ8Ye9VgaWWLPkpMdPtk?= =?us-ascii?Q?Ll2cYb5CD0Yw2fKPFA4=3D?= X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:satlexmb07.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(376014)(7416014)(82310400026)(36860700013)(1800799024);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Nov 2025 18:57:02.5936 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: ec8f8767-2d86-4fed-fde4-08de260b1842 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: CO1PEPF000066E8.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR12MB6917 Content-Type: text/plain; charset="utf-8" Track blocked task retained on runqueue to act as a proxy donor. This is necessary since task's "blocked_on" relationship can be cleared without holding the task_rq lock and a blocked donor can be forced to run on CPU before a wakeup since task_is_blocked() returns false at the time of pick. This is necessary for to fix a PSI task state corruption observed with CONFIG_SCHED_PROXY_EXEC=3Dy but it also serves as a medium to track the lifecycle of proxy donor when it is retained on the rq for proxy. Signed-off-by: K Prateek Nayak Tested-by: K Prateek Nayak --- include/linux/sched.h | 4 ++++ kernel/sched/core.c | 32 +++++++++++++++++++++++++++++++- kernel/sched/sched.h | 2 ++ 3 files changed, 37 insertions(+), 1 deletion(-) diff --git a/include/linux/sched.h b/include/linux/sched.h index bb436ee1942d..f96ad1ec680b 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h @@ -978,6 +978,10 @@ struct task_struct { unsigned sched_contributes_to_load:1; unsigned sched_migrated:1; unsigned sched_task_hot:1; +#ifdef CONFIG_SCHED_PROXY_EXEC + /* To indicate blocked task was retained on the rq for proxy. */ + unsigned sched_proxy:1; +#endif =20 /* Force alignment to the next boundary: */ unsigned :0; diff --git a/kernel/sched/core.c b/kernel/sched/core.c index 9f10cfbdc228..52a744beeca9 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -3659,6 +3659,9 @@ ttwu_do_activate(struct rq *rq, struct task_struct *p= , int wake_flags, } } =20 +static inline void set_task_proxy(struct task_struct *p); +static inline void clear_task_proxy(struct task_struct *p); + /* * Consider @p being inside a wait loop: * @@ -3693,6 +3696,8 @@ static int ttwu_runnable(struct task_struct *p, int w= ake_flags) rq =3D __task_rq_lock(p, &rf); if (task_on_rq_queued(p)) { update_rq_clock(rq); + if (is_proxy_task(p)) + clear_task_proxy(p); if (p->se.sched_delayed) enqueue_task(rq, p, ENQUEUE_NOCLOCK | ENQUEUE_DELAYED); if (!task_on_cpu(rq, p)) { @@ -6460,8 +6465,10 @@ static bool try_to_block_task(struct rq *rq, struct = task_struct *p, * blocked on a mutex, and we want to keep it on the runqueue * to be selectable for proxy-execution. */ - if (!should_block) + if (!should_block) { + set_task_proxy(p); return false; + } =20 p->sched_contributes_to_load =3D (task_state & TASK_UNINTERRUPTIBLE) && @@ -6487,6 +6494,23 @@ static bool try_to_block_task(struct rq *rq, struct = task_struct *p, } =20 #ifdef CONFIG_SCHED_PROXY_EXEC +bool is_proxy_task(struct task_struct *p) +{ + return !!p->sched_proxy; +} + +static inline void set_task_proxy(struct task_struct *p) +{ + WARN_ON_ONCE(p->sched_proxy); + p->sched_proxy =3D 1; +} + +static inline void clear_task_proxy(struct task_struct *p) +{ + WARN_ON_ONCE(!p->sched_proxy); + p->sched_proxy =3D 0; +} + static inline struct task_struct *proxy_resched_idle(struct rq *rq) { put_prev_set_next_task(rq, rq->donor, rq->idle); @@ -6502,6 +6526,9 @@ static bool __proxy_deactivate(struct rq *rq, struct = task_struct *donor) /* Don't deactivate if the state has been changed to TASK_RUNNING */ if (state =3D=3D TASK_RUNNING) return false; + + clear_task_proxy(donor); + /* * Because we got donor from pick_next_task(), it is *crucial* * that we call proxy_resched_idle() before we deactivate it. @@ -6649,6 +6676,9 @@ find_proxy_task(struct rq *rq, struct task_struct *do= nor, struct rq_flags *rf) return owner; } #else /* SCHED_PROXY_EXEC */ +bool is_proxy_task(struct task_struct *p) { return false; } +static inline void set_task_proxy(struct task_struct *p) { } +static inline void clear_task_proxy(p) { } static struct task_struct * find_proxy_task(struct rq *rq, struct task_struct *donor, struct rq_flags = *rf) { diff --git a/kernel/sched/sched.h b/kernel/sched/sched.h index b419a4d98461..fa2a2d5bff6d 100644 --- a/kernel/sched/sched.h +++ b/kernel/sched/sched.h @@ -1362,6 +1362,8 @@ static inline u32 sched_rng(void) #define cpu_curr(cpu) (cpu_rq(cpu)->curr) #define raw_rq() raw_cpu_ptr(&runqueues) =20 +bool is_proxy_task(struct task_struct *p); + #ifdef CONFIG_SCHED_PROXY_EXEC static inline void rq_set_donor(struct rq *rq, struct task_struct *t) { --=20 2.34.1 From nobody Tue Dec 2 02:51:17 2025 Received: from CY7PR03CU001.outbound.protection.outlook.com (mail-westcentralusazon11010026.outbound.protection.outlook.com [40.93.198.26]) (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 53E621DB125 for ; Mon, 17 Nov 2025 18:57:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.93.198.26 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763405846; cv=fail; b=GhblBStDa1cZjI4w4MHAbgOO8a90ZeMaiBJ0ntiT5n+6tLMQyfbE5iRoBRpD01C41TYQP9MxignokYHWJpj+f2rLGhXDypz5dnON2VoFgkbB4Oo2OFzrK+cvmKLpG5/hYZqAQa1nXM8DavQy0txhsZQWsPiE6DXmbzz6JGeC1Qo= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763405846; c=relaxed/simple; bh=z5UqQdPa2USXA0HZiDzwOjvAgGN7Z0CrgsLu9eW074w=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=HHxJioolgRJjt0PDQE3DpaXlv/8RJzMYC8+lUlG6+Oj+pCf/g6NFvQBh9Xa7X6ogaHl1jhiacFO0CNt3c7Cw8KO8Sa9x1DPlfQzt7ZuemLFWqdy/yA2A6VqnpOjejiT2ph9kGztlwBQuCAZ3MsYxH92ezllt699+ctpSLWv2HI4= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com; spf=fail smtp.mailfrom=amd.com; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b=UYkLNuD7; arc=fail smtp.client-ip=40.93.198.26 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) header.d=amd.com header.i=@amd.com header.b="UYkLNuD7" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=Edy03IqCn3loPcUJ+W6xmJ/OnEOhuLBXW7jD0D4u8jH/+80K2tQ32MhzhoWwhPabMW6EXjsO7J9PYGGYk2Weu+sX5xTAevdGoimlpa66KIMo9JcYcj5EL1s4m2QZThEH4C0KDWceqW/0MkwAPqOZM4D2QgIF4FgIXMmkHxJ/MqDVd4ZT0iZTwIR3jRcHjpVTFDsod6NSpMelTs5mB+1EFTG711JO8yLv7d7p5JKWmMutZ0SvNWLGi4zeCC1GBeCNplNEeV246zI6NtGYVGQNvuvRlNNYZKXgepJPYRWDU22KtacBc1ehIW8qKwilXetfUMp+96Nq7vSV+ASI5+yZdw== 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=a5M7EKwcvyRkP0evhTUjajMvC3Xzot9qR3q4I3usR3E=; b=w8El6kT2QjM/bgBi+bZpmrSFodP85x+IxqPR+EZDe3VIJSSn357VXXZgEJVrolxd2qIs4Qk/MIYMqsN1SaqHP6iEbvWQ33d11kzhc2XNj0r38p5QB7GtJvk2/suvcbkgjxRMKDWDzrxWTEY2u6friiXKRi/GgftEwzONy1JD4tyrTff0+yHVYEF7y4Win2F2xwj7hU7hkZrGC0wc0pxrJVoa3hyvBYXtTLIzcvFMWjOkC9ykpdOPRtXZ0o12zaD0/1iV+I0sLc3rr95e2dHBXtYsplcnDXi5jYrbpHeAUdsqCg+adDhBCGd8UnEGWzCY1SbNjs9M9L8qwSys0hENqg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=redhat.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=a5M7EKwcvyRkP0evhTUjajMvC3Xzot9qR3q4I3usR3E=; b=UYkLNuD7PmVO5y4OZdZHgr+Dl0d31sfpBgF/wT6ZXMnZfVQ5ZuMUwTKqYk1AR/6R01AqjB/O150u1+S0vP2+ziE67Q1vEiz4O2douqS+iFogNFmUNo63GstorvbhXQu4X7USRew8ivTuulJfcTAAOEaM8vSrKakR9gzKhdVKgoQ= Received: from SJ0PR03CA0005.namprd03.prod.outlook.com (2603:10b6:a03:33a::10) by SJ0PR12MB6685.namprd12.prod.outlook.com (2603:10b6:a03:478::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9320.21; Mon, 17 Nov 2025 18:57:19 +0000 Received: from CO1PEPF000066EC.namprd05.prod.outlook.com (2603:10b6:a03:33a:cafe::9a) by SJ0PR03CA0005.outlook.office365.com (2603:10b6:a03:33a::10) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.9320.17 via Frontend Transport; Mon, 17 Nov 2025 18:56:44 +0000 X-MS-Exchange-Authentication-Results: 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 CO1PEPF000066EC.mail.protection.outlook.com (10.167.249.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9343.9 via Frontend Transport; Mon, 17 Nov 2025 18:57:19 +0000 Received: from BLRKPRNAYAK.amd.com (10.180.168.240) 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.17; Mon, 17 Nov 2025 10:57:15 -0800 From: K Prateek Nayak To: Ingo Molnar , Peter Zijlstra , Juri Lelli , Vincent Guittot , John Stultz , "Johannes Weiner" , Suren Baghdasaryan , CC: Dietmar Eggemann , Steven Rostedt , Ben Segall , Mel Gorman , Valentin Schneider , K Prateek Nayak Subject: [RFC PATCH 4/5] sched/core: Block proxy task on pick when blocked_on is cleared before wakeup Date: Mon, 17 Nov 2025 18:55:49 +0000 Message-ID: <20251117185550.365156-5-kprateek.nayak@amd.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20251117185550.365156-1-kprateek.nayak@amd.com> References: <20251117185550.365156-1-kprateek.nayak@amd.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: satlexmb07.amd.com (10.181.42.216) To satlexmb07.amd.com (10.181.42.216) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CO1PEPF000066EC:EE_|SJ0PR12MB6685:EE_ X-MS-Office365-Filtering-Correlation-Id: 9ab64041-b556-4416-cb37-08de260b2259 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|82310400026|7416014|376014|1800799024|36860700013; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?JDaesIFWXb/8UBP9zjaRNR6TWRUZHZsfObmKMLwUSdQLFAeJ+vMuGAKR1K+i?= =?us-ascii?Q?x6LamvNhA03zzx9O1hPrTvjntKaQAXCvHNSu9NA4EIRyLFgbkNT5cQXYJ1YH?= =?us-ascii?Q?u6JREmfiNY6GQMm2qSwPHhPBvkn0JdDM/s+E2g2+B/VEf6OPGh6V9eqFnBKM?= =?us-ascii?Q?3Zw5IvmOysXE9QxW2k9Hz0y4s7ElAVhaZOh8e7rTAzJ2dQmWvOyjg9cAqeGD?= =?us-ascii?Q?r5MSYAr04DZVs+PMExtu/188VowHbBsnqApLmd+o/xI6Z6BvCBnHzbftIyEL?= =?us-ascii?Q?S1dyOYpUofWzil2nvUYzJDoFOR02q6Lzi3aUkBy2BwIxcy0mRFF9lVW1uFGU?= =?us-ascii?Q?48Ls73QEVQaVoJ2NNnAgPhz+8+LE/y1hUF+jIHkFY81XSzfKiv1HNfOKu7U0?= =?us-ascii?Q?UecicVJ7xamfBhyVTSVL+dybCIcVVgIw3f5jFTMLf8H3Hj41uIS1oCac2zXf?= =?us-ascii?Q?XY2PG8aPRn5u0Z76dycx1tK29PM619seVNs4qtAdJ9saNsLW8f4D0htNBZnZ?= =?us-ascii?Q?M1BzgJo1BLz7vom8vLffLIedag6Ab++NXFiaZ8LGjN+E4sNQ2lt+rHl9Hf2A?= =?us-ascii?Q?+oL9HdyOwG8qRvXgQ/9/plTB099dnPJ79vUZxZ03noPhxBOYjAKv/ruFwvlW?= =?us-ascii?Q?PBjuGci2OCKzwqGurei/m9b28pu8O1pdWLjhOtsoxKx4KJtqMoY1BUrumslZ?= =?us-ascii?Q?ipFZEEml6jMWyz65xg1Ke/MjGeD2AVQlLnOno53VAdBF76pB+dQeTqKT2jhf?= =?us-ascii?Q?2gaAmGbpLaXajNRf6A+giA03TndQW/7H2enNGQgtwmRTO/hTFk6ac7CqGCqP?= =?us-ascii?Q?zigwziZcRBEhkdbWEvdxKDHIRmeBg1BzO1MaNPS1DsN/HwPKaZmO8DLPQcAD?= =?us-ascii?Q?XAPUxl1mrAUJBA9EE4w7Hq/0G3ZSzIqK6Y1WHPPqAXQsxxfUWmXJRcLbDUGG?= =?us-ascii?Q?moPbAPWJQfvgNfmeq9wJh7gsOPN5HBOMk0/lwkszWqK5E5BXej5vs9eZXUIW?= =?us-ascii?Q?zyQwiTA/jVz9BGxibxol0j6buHZiOattec52on7hTznshxiruy4/w+YqKwYc?= =?us-ascii?Q?IIa2DT53xc4JnyqKlitSIJZ16rcFgzcjNxEj3bBVQWzTx7KKG6kaWNz4NbLb?= =?us-ascii?Q?GtUEC9bnMGh/+hOQFd70PXKjUMtZ3+ES8RTPcTRPkVxZWds2zyKYZVFzPRCU?= =?us-ascii?Q?kZhmSct9uNvfQ+4Ekre0+hknA9ts2KQmBIt1Oc1fG+adkuI0wLzb3AUueOk+?= =?us-ascii?Q?rxVktsNKlYRZc18E+7Jw0PmwDgJf4iMUrhg2jujpNw+hXEwZdWcWsGn6grP2?= =?us-ascii?Q?cstc803+B8uCuZ/VLSzeX0U3OvtjnZ3nlXUckJlO6qBkkZUNhCknobDkPfSn?= =?us-ascii?Q?S6AzkLc2642y/qdXv2kpkPI3yssmctAq1BORIKcxVzukebbN+/23inVzouD0?= =?us-ascii?Q?zLmUA5mcnqHXIsWLvuC9pZ7G7flak0AWm8H9rtGDAQhRvNPSaHQaAYPAGLxa?= =?us-ascii?Q?AfCP9l6lO5J5sp61Zp6M+6UUg2q9qTuAwmd+iWt5W1jKklZOrdvdjujRlI5U?= =?us-ascii?Q?cuNsg8y0w5Kowca/oG0=3D?= X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:satlexmb07.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(82310400026)(7416014)(376014)(1800799024)(36860700013);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Nov 2025 18:57:19.4898 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 9ab64041-b556-4416-cb37-08de260b2259 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: CO1PEPF000066EC.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR12MB6685 Content-Type: text/plain; charset="utf-8" Task's "blocked_on" relationship can be cleared remotely without acquiring the task's runqueue lock and can lead to a blocked donor being picked to run without having a wakeup. Although this is not a problem since the task blocks back again if it wasn't woken up in time, it cause problem from stats acccounting point, especially for PSI since psi_enqueue() tries to reset the runnable signals for a proxy task that wasn't fully block, and psi_sched_switch() assumes a blocking task is always runnable before being switched out. When investigating PSI task state corruption, the following transitions were observed with CONFIG_SCHED_PROXY_EXEC=3Dy: ... [141] ...: psi_flags_change: task=3D4358:... cpu=3D141 psi_flags=3D1= 4 clear=3D14 set=3D0 queued=3D1 delayed=3D0 blocked=3D1 psi_bug=3D0 # Task is retained on the rq for proxy. All runnable signals are # cleared for the task. ... [141] ...: psi_flags_change: task=3D4358:... cpu=3D141 psi_flags=3D0= clear=3D0 set=3D10 queued=3D1 delayed=3D0 blocked=3D0 psi_bug=3D0 # Task is picked and forced to run since task_is_blocked() returns # false. ... [141] ...: psi_dequeue: task=3D4358:... cpu=3D141 psi_flags=3D10 # Task blocks again. Flag modifications are deferred to # psi_sched_switch() since DEQUEUE_SLEEP. ... [141] ...: psi_flags_change: task=3D4358:... cpu=3D141 psi_flags=3D1= 0 clear=3D14 set=3D0 queued=3D1 delayed=3D1 blocked=3D0 psi_bug=3D(0 -> 1) # psi_sched_switch() tries to clear TSK_ONCPU and TSK_RUNNING. # TSK_RUNNING was never set since task was never woken up. # !! PSI inconsistent state waring triggered !! ... [014] ...: try_to_wake_up: wakeup: task=3D4358: psi_flags=3D0 queued= =3D0 delayed=3D0 blocked=3D0 # Task wakes up and is finally runnable. To prevent any inconsistencies from running a task that was supposed to be blocked, deactivate a potential donor task if it was picked without having the "sched_proxy" indicator cleared. A pending wakeup would queue the task back again when it turns runnable again. Fixes: be41bde4c3a8 ("sched: Add an initial sketch of the find_proxy_task()= function") Signed-off-by: K Prateek Nayak Tested-by: K Prateek Nayak --- kernel/sched/core.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/kernel/sched/core.c b/kernel/sched/core.c index 52a744beeca9..d6265f38e93a 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -6679,6 +6679,7 @@ find_proxy_task(struct rq *rq, struct task_struct *do= nor, struct rq_flags *rf) bool is_proxy_task(struct task_struct *p) { return false; } static inline void set_task_proxy(struct task_struct *p) { } static inline void clear_task_proxy(p) { } +static bool __proxy_deactivate(struct rq *rq, struct task_struct *donor) {= return false; } static struct task_struct * find_proxy_task(struct rq *rq, struct task_struct *donor, struct rq_flags = *rf) { @@ -6839,6 +6840,25 @@ static void __sched notrace __schedule(int sched_mod= e) if (next =3D=3D rq->idle) goto keep_resched; } + if (unlikely(is_proxy_task(next))) { + /* + * It is possible for a remote CPU to clear task + * "blocked_on" without acquiring the task rq lock. + * + * This can lead to a blocked task retained for proxy to + * be forced on CPU without the task being woken up + * since task_is_blocked(next) above returns false. + * + * Since "sched_proxy" is only cleared on wakeup, + * is_proxy_task() returning true indicates that the + * task hasn't woken up yet. + * + * Block the task and wait for wakeup to queue it back + * when it is runnable again. + */ + if (__proxy_deactivate(rq, next)) + goto pick_again; + } picked: clear_tsk_need_resched(prev); clear_preempt_need_resched(); --=20 2.34.1 From nobody Tue Dec 2 02:51:17 2025 Received: from CH4PR04CU002.outbound.protection.outlook.com (mail-northcentralusazon11013067.outbound.protection.outlook.com [40.107.201.67]) (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 E543E33DECC for ; Mon, 17 Nov 2025 18:57:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.201.67 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763405865; cv=fail; b=iFZa5Z2HSwR8XpxLA69jonqHj0ETQljTnjKiVpkw+YBwvn9a+SY8vnMsU6JSf3O7eISPFN+neVSYnGIyPxQJw4HADZDn7y/IGm5xdGcWCoJesfGfTe4I3iyiCmxhSDqjjbdzNIv/NJuT/28E9ibdC/YYVOis80h3BH3A+hWwEZY= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1763405865; c=relaxed/simple; bh=evq3ESIgItipZMPf8zn1vTgfjGZl9cOcrg9/dIjnQ74=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=lp4vk5PjfoffWV0eck3LH0bIQOtAdwjAK3ERD20PkewwTt5GZfMBsMthGxTpLzRRKFXDi7z5O61Ja7K7YNMKuvODIrdGUOUuWoOud+3/eJD7ApXNdwOTKXZmuXOhWPKaZUHIxgCeBXqi3BmxdylYWTeYp67IVPJh4bI7z2YddOY= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amd.com; spf=fail smtp.mailfrom=amd.com; dkim=pass (1024-bit key) header.d=amd.com header.i=@amd.com header.b=gsfufuK9; arc=fail smtp.client-ip=40.107.201.67 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) header.d=amd.com header.i=@amd.com header.b="gsfufuK9" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=X1mmfvW1xGozEhoe0GOkZsg6334isHjKkxswZOtum8Ch7UwnvClSJRoIJJ9INIEonXu+QmnumiCy4ctcg0BVeZbgXncR4eM6SaWhn/oevd3RFNH/+pCoHBEjiSOG3EoJ/uaZSTbx+8XL0md78GDG/hLkZDE0ZGyHRcMkYnm9rupjC2mVzgBtM0PAiZacaju7iQCY9V6kc7stJZsPOhF2t1Bnr8eOzdMjJJI0nykwVwVVfbrQKe8MJyAGvb6FMTNMZK0h8QQyLbdCQXxosFK7zhj+p4fMpyhNJLu/Dp7vEHLT92XhTn9p3Hdct+bVOdHUdqs5m8mAzQwXnDryrs7vRA== 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=E4dDDMBxGJU6p7ih3h0hnTtR1ltg7tY3YCJmskw0Ku0=; b=qSj4T6mvuqu8M4SNjO8FEo4m+CbZVBFLBQjuIro0CK4YFXpaFX44A3F7y/TyOqWfo8eofFVgueZHWvqiNqf16oJ4qy6oCUWEHEdoQgp9NRzgVEVxeBnNzNj4OZlkYquZLdAN75gga8dSjUfCTi5vX+3DjJ6fR2B/Zqp4PenhqGsSIQi4o1V7jaYM/qyvebFHK5C7q9bu/mneBG5n1GATR6CXLtf4s5EqoHZPffDIslkf8Pxc22mwfAd31h9ZQjI5VqW5Dsc3Ou+Hg5x87BOU+Qus+QNZtgDPFt10pNlHNWWCybMDZvHiJtyLZMNAh+pAB7PST5perlUW+shqGOrLNQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=redhat.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=E4dDDMBxGJU6p7ih3h0hnTtR1ltg7tY3YCJmskw0Ku0=; b=gsfufuK9nhvcupde+n7CBSTrd3btVXDN7jK77b/1c9ml9xthVefb0xkMS9pQyPDkLgcGsb2T1PAX+zL6ngA1CznzvGmEukCLxf2Sknd6MJy+W3uiwmlU6xbdU0pi0lAbUl9QRsq/yUZjY4MyLHp50dXFoYvPUPzRgdj/AlDhhag= Received: from SJ0PR05CA0195.namprd05.prod.outlook.com (2603:10b6:a03:330::20) by DS0PR12MB8564.namprd12.prod.outlook.com (2603:10b6:8:167::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9320.17; Mon, 17 Nov 2025 18:57:37 +0000 Received: from CO1PEPF000066E8.namprd05.prod.outlook.com (2603:10b6:a03:330:cafe::7f) by SJ0PR05CA0195.outlook.office365.com (2603:10b6:a03:330::20) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.9343.10 via Frontend Transport; Mon, 17 Nov 2025 18:57:28 +0000 X-MS-Exchange-Authentication-Results: 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 CO1PEPF000066E8.mail.protection.outlook.com (10.167.249.6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9343.9 via Frontend Transport; Mon, 17 Nov 2025 18:57:37 +0000 Received: from BLRKPRNAYAK.amd.com (10.180.168.240) 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.17; Mon, 17 Nov 2025 10:57:32 -0800 From: K Prateek Nayak To: Ingo Molnar , Peter Zijlstra , Juri Lelli , Vincent Guittot , John Stultz , "Johannes Weiner" , Suren Baghdasaryan , CC: Dietmar Eggemann , Steven Rostedt , Ben Segall , Mel Gorman , Valentin Schneider , K Prateek Nayak Subject: [RFC PATCH 5/5] sched/psi: Fix PSI signals of blocked tasks retained for proxy Date: Mon, 17 Nov 2025 18:55:50 +0000 Message-ID: <20251117185550.365156-6-kprateek.nayak@amd.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20251117185550.365156-1-kprateek.nayak@amd.com> References: <20251117185550.365156-1-kprateek.nayak@amd.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ClientProxiedBy: satlexmb07.amd.com (10.181.42.216) To satlexmb07.amd.com (10.181.42.216) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CO1PEPF000066E8:EE_|DS0PR12MB8564:EE_ X-MS-Office365-Filtering-Correlation-Id: aa250f29-7c00-4078-dbfd-08de260b2cff X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|36860700013|7416014|376014|1800799024|82310400026; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?vsaj0ypz3qVF9b/XXLRuGJCyQ0tiwDyTvbJMCzfIT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sjC84s1ojgIM/JbrZ/Cg5102g3ANpVu411e3oWlgw1LymQQERuis8z?= =?us-ascii?Q?LDLCN3tq+Tk+vMHx7/XiEVAVFLWtP1ltLbZOXude4sFTvIhxSsuYUlAsIu7F?= =?us-ascii?Q?dG/Eq5MPc75jlFKIyqZL8/jP6aKQtHtd69y1cXbSZKNowvjb655g6EWzmKg4?= =?us-ascii?Q?wha9CWCcO95QCq+y0YZSm50iP21bg2Ez4k1DIId5H6KYTodFwSkvPBthrG0w?= =?us-ascii?Q?XOOv8ri++TwsS1bjIDK4wMO18fm/qUUDmxdWuGOEBzN/Ket1yAsux7xXHcZ+?= =?us-ascii?Q?bP1VANj5weAC5emad49TPvj9dcxSY2eDcrszrgvHhijXpt9ivaRHhWOBPxmM?= =?us-ascii?Q?ZjaI4u9vMuMgK7zJ+ZWvdi2aZkUJCHxBDvzgUE2q3uLQ7A1Et0lZPLT0q4hm?= =?us-ascii?Q?C1gNPZvNHKWarvGEGmf8PxjaS2EiOnRhi5T79PeKqx55dO/ctKegnRzxG3OU?= =?us-ascii?Q?chd6DC8KLs9adfcL9td4H9zqVC8zsRC9RH8Vox7ZYAfbT1rCe3aCk7pdjHBb?= =?us-ascii?Q?M0ec5vLk9PU6JhNCNHSUXUWAmGY6eKntW5X39SCSTAt3mEPbfw2dm+pjceaI?= =?us-ascii?Q?5qgKzF+SVccKtu8eS6tz2jivYLbkDCiZrc0X7xjMh8KUnTGLlxwZE26Umg10?= =?us-ascii?Q?qZHw2WNxg429UnP+lgE=3D?= X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:satlexmb07.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(36860700013)(7416014)(376014)(1800799024)(82310400026);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Nov 2025 18:57:37.3315 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: aa250f29-7c00-4078-dbfd-08de260b2cff 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: CO1PEPF000066E8.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS0PR12MB8564 Content-Type: text/plain; charset="utf-8" Booting a machine with CONFIG_SCHED_PROXY_EXEC=3Dy leads to a PSI warning similar to following early into the boot: psi: inconsistent task state! task=3D... cpu=3D... psi_flags=3D4 clear= =3D0 set=3D4 Investigating the set of events that led to warning indicated that psi_sched_switch() never dequeued the signals for a blocked task since it was retained on the runqueue as a potential donor but the psi_enqueue() that follows the wakeup tries to re-enqueue these signals for the blocked tasks thus leading to the inconsistent state warning. When fixing PSI state corruption for delayed dequeue in commit c6508124193d ("sched/psi: Fix mistaken CPU pressure indication after corrupted task state bug"), Johannes mentioned that delayed tasks are in-fact blocked and the PSI signals should treat them as such in [1]. With proxy execution, the same argument holds true for blocked tasks that are kept around to donate the vruntime context - the tasks are essentially blocked and their PSI signals should be treated as such until they are woken up again. Treat is_proxy_task() as blocked for psi_sched_switch() and call psi_enqueue(ENQUEUE_WAKEUP) when the "sched_proxy" signal is cleared. For all the transitions in-between, treat the task similar to a delayed task and just move the block signals on migration of blocked donor. Fixes: be41bde4c3a8 ("sched: Add an initial sketch of the find_proxy_task()= function") Link: https://lore.kernel.org/all/20241010130316.GA181795@cmpxchg.org/ [1] Signed-off-by: K Prateek Nayak Tested-by: K Prateek Nayak --- kernel/sched/core.c | 9 +++++++-- kernel/sched/stats.h | 2 +- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/kernel/sched/core.c b/kernel/sched/core.c index d6265f38e93a..765365b81b12 100644 --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -3696,8 +3696,12 @@ static int ttwu_runnable(struct task_struct *p, int = wake_flags) rq =3D __task_rq_lock(p, &rf); if (task_on_rq_queued(p)) { update_rq_clock(rq); - if (is_proxy_task(p)) + if (is_proxy_task(p)) { clear_task_proxy(p); + /* Task was never fully blocked to be delayed. */ + WARN_ON_ONCE(p->se.sched_delayed); + psi_enqueue(p, ENQUEUE_WAKEUP); + } if (p->se.sched_delayed) enqueue_task(rq, p, ENQUEUE_NOCLOCK | ENQUEUE_DELAYED); if (!task_on_cpu(rq, p)) { @@ -6903,7 +6907,8 @@ static void __sched notrace __schedule(int sched_mode) =20 psi_account_irqtime(rq, prev, next); psi_sched_switch(prev, next, !task_on_rq_queued(prev) || - prev->se.sched_delayed); + prev->se.sched_delayed || + is_proxy_task(prev)); =20 trace_sched_switch(preempt, prev, next, prev_state); =20 diff --git a/kernel/sched/stats.h b/kernel/sched/stats.h index 3323d773fec3..b2d7461c1ea9 100644 --- a/kernel/sched/stats.h +++ b/kernel/sched/stats.h @@ -142,7 +142,7 @@ static inline void psi_enqueue(struct task_struct *p, i= nt flags) if (task_on_cpu(task_rq(p), p)) return; =20 - if (p->se.sched_delayed) { + if (p->se.sched_delayed || is_proxy_task(p)) { /* CPU migration of "sleeping" task */ WARN_ON_ONCE(!(flags & ENQUEUE_MIGRATED)); if (p->in_memstall) --=20 2.34.1