From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from PH0PR06CU001.outbound.protection.outlook.com (mail-westus3azon11011036.outbound.protection.outlook.com [40.107.208.36]) (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 E292D342CA7 for ; Thu, 2 Jul 2026 05:13:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.208.36 ARC-Seal:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782969214; cv=fail; b=AviA2rL8bM+FtOVxrKlDB+FPNT+0W/L5v1XulJoHC2Sn3bjkL3tj0IrU7u0LdP8bEbGIpZ4CYEFImYV9kQ1UJDSTIgkuBf6JE6Amy593w5FFmuu2sS/GLj5b/mv+zojsflpPlKLrxGqfpAnWC8VZZYKR84fmIjDSX2KIPks8szI= ARC-Message-Signature:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1782969214; c=relaxed/simple; bh=jCm/ojqmTJFvd5QBZVqlVLYienqA4WwG/xC26kxKcMg=; h=Message-ID:Date:MIME-Version:Subject:To:CC:References:From: In-Reply-To:Content-Type; b=taZHkJBt0JIK4JckmpeUYi6h5jVhQp2vBgcbawWu2MCZ3trXmx6NCZIYe9KmJNCOlnNv2EAxf8g5iUWA64jngVxgM8vOaEK9l5Ha51jdxWa44Am2R+LhObUkx69NITKanfCRVK2LlsuCmnxqSlUp8ACJ4Mej2cEJ8sE5MFkFmAs= 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=UiNWUV4B; arc=fail smtp.client-ip=40.107.208.36 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="UiNWUV4B" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=MYy1bDGP5phOaGWi1hjcPUM38skptVdkFQucSdG+QNqZ15sijewyqY2RrnV2K8DioDUp67TBCoxV3OI7TeMCOvcwq0Rov2HYI/AA77fb5gmiPZupaAG/2sUAS4wIQ4gyMIraI5WF0GWuUD5M6b+YQ0mrdmbJg1FLV3K3t2dtcZhAPLevgNDDicsz69RcJ7C5d+/YXCZ/OXqgNagFHEBqhlBSvksPtdGZQVoQ3pF7mDJfC5aVfoB116aJNwZMAVn6PKyB2xlY9+FnSlJxzD7POdsTOU5xHwXpBTtvyy9LizGjo3BmKSF7ApLZ/9rtbea5wczNc6jhb4seRrBAaKwu4g== 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=raFqHc3KcckAGqGb/7Ko31lSD+NJClewfF/w0r8TGMk=; b=X17zESwnDiNIWkq730mUjdihxqK5yY/3SoXma48lmtvgROtt2IeVml+2IKD0wNKTr8mDpCX0/I7AW9rNH5d9imeBS8zTApqcj04L6OJ4+msF7wjG46Vzt5C8P1AdSkNUsqir/gxGOcMcVHOpvwMufCAXN75kLF1GrjL4nukJhRkO/P9RdNQGwL7lUHquwO6PQVDmy3QArwrmoIml2oKSFkd+8oz+l9o3yMDGd+Q/ix94L+5iYjI4TDUPjVyJ+CaxH4gfDcAbOOuiTzVhiYU6GnOhtRPTgY7QKbD8rypEokFXPD2cAkdC7HSIiXdF9RNnJMqrucYB2K/edRePtqVc2Q== 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=raFqHc3KcckAGqGb/7Ko31lSD+NJClewfF/w0r8TGMk=; b=UiNWUV4BIgf6TYdA6znYKQHUuVLXap5hY+pjA6Uuazqo40iQVI/UAyHiqWvE/LL7w8zt1NBTvUgkS6PS3GfEnhcF3VFmEZXEFcqVau6JzKG0DEM1hUhRD0PLOn8HTxwUh92TVzgbv77AvfTFNSEmq+SY58ImRpIQfyX9WPVEMN8= Received: from IA4P220CA0004.NAMP220.PROD.OUTLOOK.COM (2603:10b6:208:558::8) by MW6PR12MB7085.namprd12.prod.outlook.com (2603:10b6:303:238::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.181.8; Thu, 2 Jul 2026 05:13:24 +0000 Received: from BL02EPF00021F69.namprd02.prod.outlook.com (2603:10b6:208:558:cafe::24) by IA4P220CA0004.outlook.office365.com (2603:10b6:208:558::8) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.21.181.10 via Frontend Transport; Thu, 2 Jul 2026 05:13:23 +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 BL02EPF00021F69.mail.protection.outlook.com (10.167.249.5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.181.6 via Frontend Transport; Thu, 2 Jul 2026 05:13: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.41; Thu, 2 Jul 2026 00:13:23 -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; Thu, 2 Jul 2026 00:13:15 -0500 Message-ID: Date: Thu, 2 Jul 2026 10:43:14 +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: [PATCH v30 3/7] sched/core: Don't proxy-exec unmatched cookie lock owners To: John Stultz , LKML CC: Vasily Gorbik , Joel Fernandes , Qais Yousef , Ingo Molnar , Peter Zijlstra , Juri Lelli , Vincent Guittot , Dietmar Eggemann , Valentin Schneider , Steven Rostedt , Ben Segall , Zimuzo Ezeozue , Will Deacon , Waiman Long , Boqun Feng , "Paul E. McKenney" , Metin Kaya , Xuewen Yan , Thomas Gleixner , Daniel Lezcano , Suleiman Souhlal , kuyo chang , hupu , References: <20260701214615.3773339-1-jstultz@google.com> <20260701214615.3773339-4-jstultz@google.com> Content-Language: en-US From: K Prateek Nayak In-Reply-To: <20260701214615.3773339-4-jstultz@google.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: BL02EPF00021F69:EE_|MW6PR12MB7085:EE_ X-MS-Office365-Filtering-Correlation-Id: 969e5130-8ac0-471c-56e7-08ded7f8a3f6 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|23010399003|7416014|376014|82310400026|36860700016|1800799024|18002099003|22082099003|56012099006|4143699003|11063799006; X-Microsoft-Antispam-Message-Info: Y+GVnNE/DsUomWUY4etZZB3POcdZ5zkwzl47yQHPKRyOScMxc6I6VVJhTkW1jw5dx4Vival/Fde+0h1hN6VH394XKs3W093Sobe4CiU/rrP372D3U5XxWnHFs43V/3CfY8gWXjWiryxlc0jxpc9XGODb12FbnTJlRprMGq8spPNKxdKL6dtG6BIMvyiN3+sQ52+rG/C4DC6wjDD9kDD7Bkk1aJrLd2061+43EBSMFU56l4m+WpyH2K0XWbua9ylxr6JswiRWJ9Z75Xi7F3cfJeju9c8tcudPkAPN2vWqTnEStXl3OK22ULa5hqdLH7dpAQ23TzLbUfDh4T4btO1l67kohqq3tVM7XTQuxT125Xx3hwkgt5Wuvvi3S8M717I3VkIaWwqrcbdFiwFnwViW/1nHSM9ELJRmEU+Jde3Welx4awB4dsy4bw27B7jZMVeEw+OqE1Y29iim/vAzxZqeOPdjUo5EauSr+6dWxsv1+tlHslgmT83BY112weRqzvZBgcZZhGn4UYjIU50nE0bIL9KXczEt8qVtzVZtk24my8M6/8HEWwnljmCgkOV+a8d76VAFeRkhAS6cRQGohVJxvDjE+VfELYTRSoS01+wUDAVpozcPH6HSgXkO7Pcl7u/21x63L4G5gSpqyr9Ptn5b1l56X67t/8kSGexZSFsvNodzej7043fivj0JZPEInsfVx2yfs6MMNV/BGHR7RfZMiA== 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)(23010399003)(7416014)(376014)(82310400026)(36860700016)(1800799024)(18002099003)(22082099003)(56012099006)(4143699003)(11063799006);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: f6jd6IHVXm4GHnkMCna8/ZqTvp+kC0Se23XRApoPpCD6WfiTHmBdHqiWCWA82wkY1y9rdw2c3CsUS+9k/wDUASvCSlxEctja8TaNrIITOhbRhNrHznUN4wjHb8i4j7l7bL1IA+SFRql7YxWWSrPZ4rlJirZtkcR8MW4ej5JBW6MnSEQ0W3cbxCwNn1MaazjuzKWtAOEAHRTLwy5+ksO+6MhnbZn8M/wXIh20ACunXy5d/2IjjWV5ONsp9omxgjhCXAoW1ZqCkU7S/RAP1NYF8lZE38GyMraLhoe5QQQN+UrkuC6UIyuepVMKAUuNfw7qf5t/TAYvCp8TjxhdLiwJSWGcQPB4HzrRyCZtlHJ/OvgoZbw3xupwyXSiovArkAVN4vqxhvv+TY6n8ChmGnzoLfJ85WN9I7aTpS5j5+8IRK03S16tcUaT1Csadt1osiNn X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Jul 2026 05:13:23.5592 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 969e5130-8ac0-471c-56e7-08ded7f8a3f6 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: BL02EPF00021F69.namprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW6PR12MB7085 Hello John, On 7/2/2026 3:15 AM, John Stultz wrote: > From: Vasily Gorbik > > Core scheduling chooses a core-wide cookie before __schedule() > installs the next task. With proxy-exec enabled, that task becomes the > donor/scheduling context, and find_proxy_task() may then replace the > execution context with the runnable mutex owner. If its cookie differs > from the selected core cookie, running it would bypass core scheduling's > cookie selection. > > When the final mutex owner found by find_proxy_task() does not match the > selected core cookie, stop proxying the donor. If the current execution > context is already in the blocked chain, fall back to idle like the > existing proxy-exec retry paths do. Otherwise deactivate the donor and > let __schedule() pick again. The mutex owner can be picked later under > its own cookie. So I had a interesting (maybe a bit insane) way to make this work by using the lock owner for rq->core_cookie when the blocked donor is the core-wide preferred selection. I was waiting on Peter's core-sched cleanup to post an official series but it is currently present as one big RFC patch at https://lore.kernel.org/lkml/9ceb2af0-33c6-40ca-b855-5167a9c5ae0f@amd.com/ I can streamline that more on top of current tip to do it all in pick_next_task() but the bigger question is, is it worth all the complexity? John, Peter, what do you think? [..snip..] > @@ -7004,6 +7004,14 @@ find_proxy_task(struct rq *rq, struct task_struct *donor, struct rq_flags *rf) > owner->blocked_donor = p; > } > WARN_ON_ONCE(owner && !owner->on_rq); > + > + if (owner && !sched_cpu_cookie_match(rq, owner)) { > + if (curr_in_chain) > + return proxy_resched_idle(rq); > + p = donor; /* Deactivate the donor, not the runnable owner */ > + clear_task_blocked_on(p, NULL); > + goto deactivate; > + } Otherwise, this is acceptable if we don't want to touch core-sched bits juts yet. > return owner; > > deactivate: -- Thanks and Regards, Prateek