From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from CH4PR04CU002.outbound.protection.outlook.com (mail-northcentralusazon11013006.outbound.protection.outlook.com [40.107.201.6]) (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 92F65328638 for ; Fri, 5 Dec 2025 12:49:23 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.201.6 ARC-Seal:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764938969; cv=fail; b=shF1qbP4oAxRsjlJB3/p42zVtIo41ojgFWKLJ6dlRXjrFptmRfOUmHHJ5ZDfd1fD9Vyvqc/huNbq1YMSnQVWOhPx5ALjyexCfhUvXax/pEeNk0QPAydOY2BfyRn8ataVfrduJDRKrj/gX9fTYUK1M+Ts/ztjx8oduYcmCOC5n0g= ARC-Message-Signature:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1764938969; c=relaxed/simple; bh=xfqsgtzCygoohdWZMcTyg3gtWP9iFD+nG0WCzhIB/VM=; h=Message-ID:Date:MIME-Version:Subject:To:CC:References:From: In-Reply-To:Content-Type; b=UCU7NbUO8QeGp15OFXsvWw8QlCR4uaglfRa7mJhZyDkGL2qTPf+94+jE9VLUEwkuEVT8E12SCd8VQd+otv4pvCB+0g/TIFaXBXz9qdBEaKZqr4Mqe0NnNbGwX97AFbDYoDD8RpjaEw9IDhVh6nlhPZikqI9PFGXWC3um5IIg9FE= 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=PTmX5kdR; arc=fail smtp.client-ip=40.107.201.6 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="PTmX5kdR" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=Jrwn6GDPklBZXcxOFJ2scCg6K35Iy4InlbAHkEdj7gYogKW3E1zwP4W5PQDt1BAUkW83CmCW8FVSuEKYGj1jkEj3NlwysJguvg2XvjMFsCQS8N+kO8uCL94k9fMcL9sEjnAN1r86QPJP7ZClesGTxfAfeLOXdP4PKTKQGZOSV6nfZ/yLRWwNjWtkUBCbXJPL41lBjqmBJeBi3kcpei6M7Y1ZAMmOxkUhGPxKjFtzx6yKHcxkGLyfpKIeML8uAb9fbyYCFlciLcU/PLOCZBK+idVKMgfTil2PmOFdnl0WOzNB8TPA96WWkmI5T1GlSTtrVA/fV7S4zgEyLjmTyRYaGg== 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=Ick4BNa7m54lcWxHWydi6qCZzmYh8Yl0MapoOKonoI8=; b=f+eZIiemx3BcApyLTyZzhr8WHzHb8M+GApnrRca9XXELe/NFUFl5qsREyNMwPOFyietmP19XMtidfUt8OEgqUF2lJPRMjQyJisgk4HstjQR2ijEsqTBr2ufyfeQ8KmnLWeMf9MkZP7sSXodGeMKZZ0P9UXLrlTbtwksk7PnYvAr3H5pVz/wGXzwanHRLNHbwPzkLjma7SOdRV3qhVE8hD8DRrTwI2w5JY2l4cWYuZWj50BWRRFMp46uHzviZtBnu97b+uNbOGcHRbRUSUHYlu7U56LPeLcDF4VaFeHvpAiTMnU+4UkVKY35+HrAdliTrfDu9iTzlZ4vAWz+Y2LuaTg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=infradead.org 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=Ick4BNa7m54lcWxHWydi6qCZzmYh8Yl0MapoOKonoI8=; b=PTmX5kdRuO7JpeTyCdZDYnQoRSCjUbo2BLd81c4JNXVzPVbg4uiCQbqOORzhRbRX/QEiF6nZxmG7IFekEMA1L0L2ZEtSorr8WUCMssjztg/FsYiR97U5WWGq98xuUQKdVNVigYrLu1DiEnaGvRssJNyNakrYCEam0v1xmriUTQ8= Received: from SJ0PR03CA0165.namprd03.prod.outlook.com (2603:10b6:a03:338::20) by LV2PR12MB5869.namprd12.prod.outlook.com (2603:10b6:408:176::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9388.12; Fri, 5 Dec 2025 12:49:17 +0000 Received: from CO1PEPF000075F0.namprd03.prod.outlook.com (2603:10b6:a03:338:cafe::d6) by SJ0PR03CA0165.outlook.office365.com (2603:10b6:a03:338::20) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.9388.12 via Frontend Transport; Fri, 5 Dec 2025 12:49:17 +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=satlexmb08.amd.com; pr=C Received: from satlexmb08.amd.com (165.204.84.17) by CO1PEPF000075F0.mail.protection.outlook.com (10.167.249.39) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9388.8 via Frontend Transport; Fri, 5 Dec 2025 12:49:17 +0000 Received: from Satlexmb09.amd.com (10.181.42.218) by satlexmb08.amd.com (10.181.42.217) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.17; Fri, 5 Dec 2025 06:49:17 -0600 Received: from satlexmb07.amd.com (10.181.42.216) by satlexmb09.amd.com (10.181.42.218) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.17; Fri, 5 Dec 2025 04:49:17 -0800 Received: from [172.31.184.125] (10.180.168.240) by satlexmb07.amd.com (10.181.42.216) with Microsoft SMTP Server id 15.2.2562.17 via Frontend Transport; Fri, 5 Dec 2025 04:49:13 -0800 Message-ID: Date: Fri, 5 Dec 2025 18:19:07 +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 4/6 v8] sched/fair: Add push task mechanism for fair To: Peter Zijlstra , Vincent Guittot CC: , , , , , , , , , , , , References: <20251202181242.1536213-1-vincent.guittot@linaro.org> <20251202181242.1536213-5-vincent.guittot@linaro.org> <20251204112947.GK2528459@noisy.programming.kicks-ass.net> <20251205085912.GQ2528459@noisy.programming.kicks-ass.net> Content-Language: en-US From: K Prateek Nayak In-Reply-To: <20251205085912.GQ2528459@noisy.programming.kicks-ass.net> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CO1PEPF000075F0:EE_|LV2PR12MB5869:EE_ X-MS-Office365-Filtering-Correlation-Id: 6cf4ead0-becc-4df0-6910-08de33fcb3ce X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|36860700013|82310400026|376014|7416014|1800799024; X-Microsoft-Antispam-Message-Info: =?utf-8?B?YUdkd0RqRFBNVkNtaXBOczRSWE9KTWVUWXVKM2thZ0NxWEhOdjNoTElMSGJB?= =?utf-8?B?V2RuQ1paS1BxVy94YjdqS2JMWEx6SXRkYkt4Nnl2VXJPQlc5clZIVmxieE55?= =?utf-8?B?TkdpcE5vMEVRN2lrQW8yaks1MnBHTXNXV1E5ZnhhU0FpQVdyMzdKUjh0OWhR?= =?utf-8?B?ckxQSktiNk95K3JVSGMwN25UZjJWR3ViYmxtMmVDNXMzTUk1ODNrbG9Gak1B?= =?utf-8?B?RDEzQ2tyT0hKUWVLY2VxcGJSSHFRUklXSTk3QXY3dWpVZ1IxcmZjSkZXMXA3?= =?utf-8?B?ZUYzcXNOaEEvYkV5ampwVU5BLzloODg4eklDaGNUNGxVWHV4OXpJTncra3Bn?= =?utf-8?B?cHI0anRZSkFoWDlnaTNBWWQ2cDA5VVJHUHJvaklua3k3VHFmT2twUmh0RGIx?= =?utf-8?B?b0VTRzlvMWp4WnZiTzZwd3kxQm1JbGw1cVgwOW93d1lSeTJZK09ZTHZFTitC?= =?utf-8?B?aUJFWmNQa1V0NnMrc1hHNHgwK0VZT3c0TU03WVhRbGk1UFZxRGRHN2dyRHYw?= =?utf-8?B?Mm1SZTBUMTlxZVFEeTJGTCtPUGFoREMycTRaVWhKWDJWcGRBdktuWUdzTXFJ?= =?utf-8?B?U0w0L1p3eWRndkZ5NUZKVmM2VXBRNGd2azhvZE1sMU0rV0xidFJYbGtwcGxT?= =?utf-8?B?UFh3ZVMyRUkwWTBWeUtpOFBqSTVBUlYrdm5RYVBKNDNCTi9sZVlwenNia1JQ?= =?utf-8?B?czdRTzBnRjVYYmQzNFRwYllYcUJ4TS9oVitld010dlAzQTBYM09Ccko2OGZh?= =?utf-8?B?Z0lic0locWMyMTFUQWExbUhCUHNMejgwa0VMLzQ5OWc5ZmNmOTFuNEc5akJ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dmRGUE9lcnprb3pRM3dnZDQ3RS9nTGRE?= =?utf-8?B?YkgrNW9DNWlBUFI4ZXNZK0F6bUJOOE1ybVNkZndjYlR5YVprcXJvVlRqYmd2?= =?utf-8?B?bmNrbWFyVVdqSndmUTErL1BBeWJVemdUa0R5Tjd0TGpBbkRzcURiaHI3M3Jx?= =?utf-8?B?WWt4MUNaUWFkNnB1TkJteU9YU1VDSXg2UzJ6alhqdnVJNkpETEw2Wm54bGFX?= =?utf-8?B?T3pxeUF2RG1EMGNNMmN0VXFUV2x1ditSYytzMEZ3RzhRdG5BSkJpUi81ZzFn?= =?utf-8?B?UXhQbVFISG9MZlhmYzA5NEIyaEtDcGw3NHRwajFyYURERHBjY3dMWnhtZWVi?= =?utf-8?B?elVnK1lLaFl4SWpnSmJIRVk0VmkwYXNTaVI1YjYyd0ZRVGZYcDBOcldMWWdG?= =?utf-8?Q?Tt80=3D?= X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:satlexmb08.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(36860700013)(82310400026)(376014)(7416014)(1800799024);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Dec 2025 12:49:17.3297 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 6cf4ead0-becc-4df0-6910-08de33fcb3ce 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=[satlexmb08.amd.com] X-MS-Exchange-CrossTenant-AuthSource: CO1PEPF000075F0.namprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: LV2PR12MB5869 On 12/5/2025 2:29 PM, Peter Zijlstra wrote: >>> Why not use move_queued_task() ? >> >> double_lock_balance() can fail and prevent being blocked waiting for >> new rq whereas move_queued_task() will wait, won't it ? >> >> Do you think move_queued_task() would be better ? > > No, double_lock_balance() never fails, the return value indicates if the > currently held rq-lock, (the first argument) was unlocked while > attaining both -- this is required when the first rq is a higher address > than the second. > > double_lock_balance() also puts the wait-time and hold time of the > second inside the hold time of the first, which gets you a quadric term > in the rq hold times IIRC. Something that's best avoided. > > move_queued_task() OTOH takes the task off the runqueue you already hold > locked, drops this lock, acquires the second, puts the task there, and > returns with the dst rq locked. So I was experimenting with: deactivate_task(rq, p, 0); set_task_cpu(p, target_cpu); __ttwu_queue_wakelist(p, target_cpu, 0); and nothing has screamed at me yet during the benchmark runs. Would this be any good instead of the whole lock juggling? Since this CPU is found to be going overloaded, pushing via an IPI vs taking the overhead ourselves seems to make more sense to me from EAS standpoint. Given TTWU_QUEUE is disabled for PREEMPT_RT, I'm assuming this might be problematic too? -- Thanks and Regards, Prateek