From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from DM5PR21CU001.outbound.protection.outlook.com (mail-centralusazon11011035.outbound.protection.outlook.com [52.101.62.35]) (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 4CA1C194AE6 for ; Thu, 23 Jul 2026 04:02:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.62.35 ARC-Seal:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784779339; cv=fail; b=vAVAOrv8U6oODfLY9HSPuIKgiEDP5BoNuSODQEdaPSZcg65CzM1cIpJtPk+Gk0fMxwxNY8PSSq6sWoyro+xVlRZYfh4fnO7eMVN+Tw4W0uizCBxjOJsIVJ6aR2VjQRelthrukieZnDvHiwrhtaUH95JQ91ZfnNvfurGY2wnwk6Y= ARC-Message-Signature:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784779339; c=relaxed/simple; bh=H5UMyX5i1xR6wAeWS8c1MZe/11SyibfCFnrha7xlG0k=; h=Message-ID:Date:MIME-Version:Subject:To:CC:References:From: In-Reply-To:Content-Type; b=gUcdB+hI0mtzUJ1eo+6YvSVk1h1ZM0gnJlalUx1b6JRuChdoEOaTOgv2Vv4Jw2FzHqbyu8MJIIazRft8nyXfXPV3F+Tf/ffnOFFdacfgE7X+Zlsjs/7jM2vpZbHd9WQGIofnWjKDIihN5gKjcQzIyxDN4YIT8zY2mc0sjHzsbcU= 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=nDB5IG/f; arc=fail smtp.client-ip=52.101.62.35 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="nDB5IG/f" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=ng5KR+0J/FhV8Wdl1MSnX75em1lHPns9ooGlLpGSR+YRXbeD0vC3bU4p4kTHeJ3hB/vyTGmzmpmJK7JdYKyt0DY/4jSi4Alybo1a3A3Eii2hWV6464ZMP8Db8tieszyyzub5GmRCNhXTty8QVHGxkRWLeITsefTNFay1RlH1FbLPKn7H5n8+YcSzFqrX6u4Zq6ut8e5Q+fvwGiJ9+A+DeaDjoDJIHLUOWwRMAaNfdP8jp6rYpSjDGghcJRccohlWW+HEUWXmastpnL4AGaAB2W6FXdB34nyzRu9xadnQilaJVQfx+mV7g0dVQfqW2VSWx3e3EOteEmrMicrYuIRBlQ== 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=NM0XdGXYSuwQaSYx+WpMdLsUAREXY9M7ZONsZVWSe7w=; b=ZjbTw02Zw0gDnwoapl/pUFF9z9fAkBtxQCNzbwxmJorJz73lqzTLq0yKHTPEKnvBLGFpNe9FDepqm8RYoqYs4QTpR5a8batkRzmH2W/v6GC4UFxb1jyE4nyLTpoUP8F5sVBZoFfnswBgHAeqGMyqQHSftO2Y/gd9SQAqf5vxN8cJdxKAnHUqsxbBPydArM0WbbhcTcfOuOt05GGHha8Vfmbse/CS0tHYMyz934bYHMyc2bdsUqFc8U9JIMumnD4Mw1SItgiz2iUnREG1SdazUBBSXMkMeOn401lt+hs3y5l3Hw5Q83s8G2YW+jDoPjAMlQpn9+HMTNFvgVbby5Lglg== 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=NM0XdGXYSuwQaSYx+WpMdLsUAREXY9M7ZONsZVWSe7w=; b=nDB5IG/fy+8/lF7ALn1Yp1UFrdAI8OOtiykSWYtLnd6ChVK1CFz+JgX8xZv97HFnQOHHbgqaby6ci68xu1VylnoP6DTIs930uNrOMczeyEz3EZ78Cuk6NBCx0TWTUrPg2mJFkve7rqxrByxtCzkSN+AR8HAO1yEcy8a6MfBrFdQ= Received: from DS1P222CA0010.NAMP222.PROD.OUTLOOK.COM (2603:10b6:8:454::19) by DS4PR12MB9636.namprd12.prod.outlook.com (2603:10b6:8:27f::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.181.8; Thu, 23 Jul 2026 04:02:04 +0000 Received: from DS3PEPF000099E0.namprd04.prod.outlook.com (2603:10b6:8:454:cafe::30) by DS1P222CA0010.outlook.office365.com (2603:10b6:8:454::19) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.21.245.11 via Frontend Transport; Thu, 23 Jul 2026 04:02:04 +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 DS3PEPF000099E0.mail.protection.outlook.com (10.167.17.203) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.270.5 via Frontend Transport; Thu, 23 Jul 2026 04:02:03 +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.41; Wed, 22 Jul 2026 23:02:02 -0500 Received: from [172.31.184.125] (10.180.168.240) by satlexmb08.amd.com (10.181.42.217) with Microsoft SMTP Server id 15.2.2562.41 via Frontend Transport; Wed, 22 Jul 2026 23:01:55 -0500 Message-ID: Date: Thu, 23 Jul 2026 09:31:54 +0530 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [RFC PATCH 2/3] sched/core: Fix forceidle when lock owner has mismatchd cookie To: John Stultz CC: Ingo Molnar , Peter Zijlstra , Juri Lelli , Vincent Guittot , , Dietmar Eggemann , Valentin Schneider , Steven Rostedt , Ben Segall , Joel Fernandes , Qais Yousef , Zimuzo Ezeozue , Will Deacon , Waiman Long , Boqun Feng , "Paul E. McKenney" , Metin Kaya , Xuewen Yan , Thomas Gleixner , Daniel Lezcano , Suleiman Souhlal , kuyo chang , hupu , Vasily Gorbik , References: <20260717111601.6017-1-kprateek.nayak@amd.com> <20260717111601.6017-3-kprateek.nayak@amd.com> Content-Language: en-US From: K Prateek Nayak In-Reply-To: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS3PEPF000099E0:EE_|DS4PR12MB9636:EE_ X-MS-Office365-Filtering-Correlation-Id: 300f9d74-eced-4b4d-d1cc-08dee86f27d7 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|36860700016|7416014|376014|23010399003|82310400026|1800799024|10067099003|11063799006|56012099006|18002099003|22082099003|4143699003; X-Microsoft-Antispam-Message-Info: tPBL4+TYliTAF5ISIh85bxKl0mvIT7M/cZ9Hxr6ffXXOmJD9NeFeFjRL9UlaPNk/u3mgfUt2Xk0YQH7NKMRq9SJUuwYbj9ZBw9qW2BrdfRE0WFtptE2P34azFfEmUI3Q3xMxRhT+M9CAFPIpPxXtj7nEy6qAIOoNtdZ8zZltNK9S/QlbKpFNAzH8JCbeSSb6hMMA5SiDeV8OL8VPhz5ZVbDV91ZP5eMDGd3Rpcu7es7rZpOKZ8MOki72H02BBHVDeIhhWemXwpKQMp1k7H1AXyWuje5lj5hw9utoZW+u+uC0hlWcycFJA7An6Buy5yB+bIbxaAYPSkpXrMyXhM6y1r7++64cr9sAv0eLPRyESzflDy/B3XCm2oDlmWpFHNzXcmCOljgr0yl8c95UPs1CDgWv+iy9Pg0vaAelSm6IO/HX3bBBHkALCsX7URmtQrvqZWEzL/yC9bt8CF+dCcS5UsAYJhvKpj7o8OkSj+v6fNgOAoLJyLIKmwSJEyrPfWt8A8Znt1ZLlSk6GiyjgsZcAASf4V6XupyewuOexeOitGWcqcSvp3w0kdHWR40PW+JPmlTso86Q9gwm2YDLfQDKuQh75Jw3kv/NSGnN3FW1dMBuuE0m043z+5U6ih6Lum+2SUXFXj2Kvf2KpBucgGjtwUkYsG7OA+fuWbOzw8fwCqCasu1Tztc246J2Pn+jDxqxzsT/hNtLiFLJYtEYSanbxQ== 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)(36860700016)(7416014)(376014)(23010399003)(82310400026)(1800799024)(10067099003)(11063799006)(56012099006)(18002099003)(22082099003)(4143699003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: oAj7WYejPDxT51Weq+rWFzNI8Ks4iTBltgBB0ZwXHm+uLBac5zyt6jn3tZFc+ZaofqW6ODoX51QNwYpxKUtFcqNpws03dpTrdRWXwBmpUX7+1Ve0tRZKhjkJiuHiyS4OqsHfgkg0aILauWJDcMFvKBKDmWGXx4hPyY1vxUXUPZU5i31IzNNtiL3mbkx8K1GqnCo+0+nR8+7MXihFWRZOpqESfhGk+YmYdYmYSZ2VfGvQI1ZnRXEs+D3O+ubSHof+OU8vFksalCZIeb5GuqUeFnVnsrak8gQ8vI4vsVnw49zv2+8iSmiyWXjB+Tc5PEw1CDVPbCmNfnxczwVBI0Qa35yUyeDtUtYAmibOrwLu1kHyUJJMywilN+N4Fh+61fz0FSaJsqMrVUCzhgVC3JJG0OKm59U9E79ifGXHfTKGrLoHV9Fs2Qsqbo4gIju8ENGz X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Jul 2026 04:02:03.9801 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 300f9d74-eced-4b4d-d1cc-08dee86f27d7 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: DS3PEPF000099E0.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS4PR12MB9636 Hello Jon, On 7/23/2026 8:44 AM, John Stultz wrote: > On Fri, Jul 17, 2026 at 4:17 AM K Prateek Nayak wrote: >> >> Move Vasily's fix from 7cd4088f70e0 ("sched/core: Don't proxy-exec >> unmatched cookie lock owners") into a separate helper and fix the >> forceidle stats, balance callback queuing when rq is not the one >> dictating the core cookie. >> >> The helper will be extended in subsequent commits to allow for re-pick >> with cookie from the lock owner if rq is the pick leader. >> >> Signed-off-by: K Prateek Nayak > > Thanks again for sending these out. I've included these in my full > proxy-exec-WIP tree and ran into a few build issues with this one. > >> --- >> kernel/sched/core.c | 43 ++++++++++++++++++++++++++++++++++++------- >> 1 file changed, 36 insertions(+), 7 deletions(-) >> >> diff --git a/kernel/sched/core.c b/kernel/sched/core.c >> index 31fa6bcee616..ed11410f1416 100644 >> --- a/kernel/sched/core.c >> +++ b/kernel/sched/core.c >> @@ -6598,6 +6598,8 @@ __pick_next_task(struct rq *rq, struct rq_flags *rf) >> BUG(); /* The idle class should always have a runnable task. */ >> } >> >> +static void proxy_deactivate(struct rq *rq, struct task_struct *donor); >> + > > So this should probably go in a "#ifdef CONFIG_SCHED_PROXY_EXEC" > block, or in the !SCHED_PROXY_EXEC case you get defined but not used > warnings. > > >> @@ -7113,6 +7132,18 @@ pick_next_task(struct rq *rq, struct rq_flags *rf) >> return __pick_next_task(rq, rf); >> } >> >> +static struct task_struct * >> +sched_core_swap_pick(struct rq *rq, struct task_struct *next) >> +{ >> + /* >> + * Caller should always check !sched_cpu_cookie_match(rq, next) >> + * which is always false for !CONFIG_SCHED_CORE and execution >> + * should never reach here. >> + */ >> + BUG_ON(); > > This should just be BUG() > > I'll fold these fixes up into the patch in my tree, but wanted to give > you a heads up should you intend to resend these out for review > sooner. Thanks a ton for fixing those! Guilty of not testing with !CONFIG_SCHED_PROXY_EXEC. Will definitely make sure I at least test a build next time around :-) I'll wait for your next version and rebase on top of that. -- Thanks and Regards, Prateek