From patchwork Fri Dec 20 15:11:36 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrea Righi X-Patchwork-Id: 13916900 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2084.outbound.protection.outlook.com [40.107.244.84]) (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 CD04721A440; Fri, 20 Dec 2024 15:41:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.244.84 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734709298; cv=fail; b=Kw7zJbiwn4oONKWFdtNsVCMrox6PXFF0GW2aHnOC2zOI/HmIyHsRge58eYNXyyWyH4NXR6USWzQgWZuAEwGUo4oxRpcSdtxg4p7+YtIs34faOkSz3XMzUxVs3d2nfe/GeBeWwc2kTIt1+cb/U/WjhXCRM/M8myIq2IB1IMl1qdc= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734709298; c=relaxed/simple; bh=KxRf734fvK6ZCQI4T3agHnNBNKtAxK+yTuBXzUj6Ok0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: Content-Type:MIME-Version; b=fKud2rQa0EySsoedbwtbC+e98fOMx3tTKEpHCaOck+a9i8a/EXl0YZec/pSKPenyLfkk46RplFEwNaDqPq2OXlK3XtzNllghxximZs3JMoKjwnZxsSpVqO5kl8r4IVW5mwDNuDasAE+y/DzXvhEjK7k50CBL24Yo5mZabSrgXpY= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com; spf=fail smtp.mailfrom=nvidia.com; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b=OP51xZhc; arc=fail smtp.client-ip=40.107.244.84 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nvidia.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=nvidia.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=Nvidia.com header.i=@Nvidia.com header.b="OP51xZhc" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=VrT9WlLgLQSmAE2P9uZtf8e58wLTVpt6DmqCjnnZl6ea3ImugK9vm2BZvmp+PqOPW/sjjitoFzDfvlI3R97gjpdGzN9p5thA25qCpQ4La9aab7CdV4VtLuVZBzml4a/0dL+PY40ukJ8bSVEv3Cc0wuYgb1lb5UddT/jndwYBQByGar2bEKec8XwCj8aDDV12l2rMCGkg4Qc1YdwJkVmUDvN8j6k2GqmFtA6GK2iHhhFoUhdeiOKK17rgV8PmyPktvJhuCw+BmXNFkOThdbfLpQDZhGg4YgAueGlOH9WQCVtuwXEEUJmR3HgNpZJYunlT4mWBtk96PET0k64sN7zdLg== 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=LCBF3M6WWXNz4Ul2aZjpCiD52jYPCmU4fJP70kG7xLE=; b=gD6/jSBGBAV4kqewYuUh+YQjUjJkK3qzMJSm5+M1yj2QTgKeshHAVTIgmqWkyI/kv/zH+Ed1T1cZ3Di7SDdb9IuOUr5qW6rpLQO+1unhONy2SBxe7+ekqcg0S6Ld5/gLje2Cd94BypPu1yM/A0ELJDz5h+H/NiTt5o7WInNLo+C26Nz2exAXgfbP7vGzvWLo0Cp9L2Tt7twKdYeYm0T8YcC77T0ZdikAh25MqqNggEIO4Er7b92SvLUCzMUxUQ0T0vrXAku/2wO/E8o6YyJTRp1JdTdvKL+yBIC1LKkrH9lxlt6P6KHzNT9B59fhi4H4djaMTxuIWjnHHDfYmeaBQQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nvidia.com; dmarc=pass action=none header.from=nvidia.com; dkim=pass header.d=nvidia.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=LCBF3M6WWXNz4Ul2aZjpCiD52jYPCmU4fJP70kG7xLE=; b=OP51xZhc3fXq0mklOetK4ctvV9xEka92GE/aRjOgVuyE38k/wzQ/ViTNuwpMqOqMjLvcNkMbsEYSHFkmMKZE3AxiPU0/DjJcUzxraBUYitYpV2XXJPE1E8a9Ox2SV4v/6WeN5YaKYQU7z3gCQElIPS/0oHSTN5ydrl0075ujhEPq3kuReA5H6qgxal2yWWt95VpsaQvRvN8k1k6V0YVB+BB7MWQgY5PpoMDeGNZ+8b+A8ddhzrBgYFvI5wwPEZbwZux5NbH63I3FhZv0cVDd0wBiYWOM9+EgsgUUHI1WFjEQ7LqwSLQ46BthqfK/+F9sX+pw6fh9fHWkfeqMY9mr1g== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nvidia.com; Received: from CY5PR12MB6405.namprd12.prod.outlook.com (2603:10b6:930:3e::17) by SA1PR12MB7149.namprd12.prod.outlook.com (2603:10b6:806:29c::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8272.13; Fri, 20 Dec 2024 15:41:33 +0000 Received: from CY5PR12MB6405.namprd12.prod.outlook.com ([fe80::2119:c96c:b455:53b5]) by CY5PR12MB6405.namprd12.prod.outlook.com ([fe80::2119:c96c:b455:53b5%3]) with mapi id 15.20.8272.005; Fri, 20 Dec 2024 15:41:33 +0000 From: Andrea Righi To: Tejun Heo , David Vernet , Changwoo Min Cc: Yury Norov , Ingo Molnar , Peter Zijlstra , Juri Lelli , Vincent Guittot , Dietmar Eggemann , Steven Rostedt , Ben Segall , Mel Gorman , Valentin Schneider , bpf@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 04/10] sched_ext: idle: use assign_cpu() to update the idle cpumask Date: Fri, 20 Dec 2024 16:11:36 +0100 Message-ID: <20241220154107.287478-5-arighi@nvidia.com> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20241220154107.287478-1-arighi@nvidia.com> References: <20241220154107.287478-1-arighi@nvidia.com> X-ClientProxiedBy: FR4P281CA0184.DEUP281.PROD.OUTLOOK.COM (2603:10a6:d10:ca::19) To CY5PR12MB6405.namprd12.prod.outlook.com (2603:10b6:930:3e::17) Precedence: bulk X-Mailing-List: bpf@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CY5PR12MB6405:EE_|SA1PR12MB7149:EE_ X-MS-Office365-Filtering-Correlation-Id: 7589d7e6-fe88-47c8-5d77-08dd210cc7c0 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|366016|376014|7416014; X-Microsoft-Antispam-Message-Info: qsCe0AmByE1qvZKGKGLptHhW0PwkFH6L/Y/A5NtNTezapk4n9QqoIRch4EVjSsUHBzFk4VhXbYHAuxQEB+Z7ht8xbSjYw2uUIZY8wE/DU48tHX0ske/o+X2V4ZNRZ06iUy2I+uF8fXQHPMB0xeqj9qSWvOFnfVpeIXXC/RNxZ7YlB++lCPqmYwzhR5LJZq8PFEVR/c6AWwRl05r+JxGrmlOXBprpJfypZbJBjMQs0/FQKBfR84v94c8OD7VLFq2NL3Qom0FFw1UgAmbvy9W1c+vgWftTaGfTvDZ5rL3qZ76HVyG4A4nrSXWa9rlocGSFteC+idML12SwrOx/oYCrKw0TMZ8FvOMhtNxtvRyn8vW5ig9802lvc6B68Q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SPM;H:CY5PR12MB6405.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(1800799024)(366016)(376014)(7416014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 1FZ6Z3KBGTETWqMS6MEqLtKStLhqDsNSx4dAA4NcOAvaL48cz4CrRaYVenfAnR1XX7BzKd1QVN4CURDQa6p8udQQXsVkGoIspH6HSxrJmLo3l+VhyUihYX5EsA/jBV0PHhLEkoDkqffHSUD6bx4sF0YB8bubRqwDQu7KvH4Speu+swVT0BZCHTFbfylWoi8falq6o7HQy6Lnearq6O091v1cNeVDO+GV54w7JbG60pIzxaE9MOW2t3kW16jz4/yaq9i6dH35UdfP2UsjFtQqTolNKnkk9wcrOLS0k7xnZoDGdXNWKPbI9CfHq9dr7u/cKtfJozBO3K6Rz0CA6bJpC0tlLVA/fNmLDR7kToDUnrSMkuhrxR9vOVvuR9RIvTLbbFlmhexPab7hjAyyZw8crhkTfUnK17+VZpQ6zHdI4K9tUEJ+y17R0F1vPLRkizWOjYFh1RGgtA598QignJOMuGvz2gWD782Ya7s2OajwWrpjn3I2S5mE1UQqW+xsCWVqatxQZ+JAImH3U/Nn5rgn1tAfD4gjU/jylVxpOeaKc+4v+9ENGin44M0BmNLX5e9pl9A1RIyvPJHdIlAwX3OCnXexCv5E7kyN9NkQPLX0XIg34EsGLCRsIXGpg5HCrAOJSbymavlW2D+CcIe40pOaI69fFYHlSCKCkj+U7+z6hUrMS3RS5q6zycf5PcLFjDi1HLWCKZcC4v7ZMNQBUO75fqhYzhFdXVb7YowhBWmsA319txeY0CyASQ7A9WV0Y5kvwChEvkoxhNg+aseWm+3CqihHSStnfyk5vZLw9URSGnpW9kKEdr4AIAGM2wrpoiQKweGoNMmMEaDtBidtlUayPJCiWprdeAQSTZ2XvFnb3v6kNmzSRniivrSFL+l19DoF0KvNCIegT2zC/lrGRscCQOmCP/J3L3HNoU5+Gy+g8N2Cr4n9EoriY0RRri6IKR6POwzts8AzwbRea2Pv2yUMkOaVBxyQg3VRah6cVl/sn0ri9ASQb387Z0BoQyv5MTTcahgM3WrGuEIEEatuYe6jmV7XBDMUKsa0xcipPYm/AHE1wVIrLnkQaS/Ttq1inyAHcPulh0R6mE7KzKQfGpNuViFetqQo7wucLk1X4fwasKRWJ1ZFOFYTAl3m96K6uQQKaIF3TAirCpIVsDF6kZBFX6xV9H1PmyBOkfmLr6AhE5iA/saxBlZWO22ZEfzyYx6yX7+9uOZsgmf4kXaVlkVbhxVL1vD/mpmSJYQmLCJb4uKihaqnDgV5YhveDByn5pwYN7U34xKMOtVs2Qe5jtr3mTzrU/wFcpT+qy7K8XTO30bVSEODwhJpDZQVxKkLttZxISx5dbD9JCgrAJAJcR4/Zb/wVXIADuqFju6gL1OddMGZ6x7//zHwHwR2zY7MVsJoC6WIWSMxS1mECj4EKuEtcgZ8YZYfguQ2TjyOXMwffjVQIm8yaJBb1SzWsKrWbPdqJMw4aGSIwyzZt2wc6Fw63m4utbuDro8v5NuLcuEDvh2SGQjvLemHryQDD3FydMVNjipXHluHT4lov8QM0+6GQfhm0hrwMuK2KXDvXLvyHfb/WLa2d5SgEq0RpYJ+VrQd X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: 7589d7e6-fe88-47c8-5d77-08dd210cc7c0 X-MS-Exchange-CrossTenant-AuthSource: CY5PR12MB6405.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Dec 2024 15:41:33.1994 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: s6w4SSc/mgfm8Xa5u8/Z0I7YWBk61xa3PBjWXKTMdBwxUf0IHRa+5uSZ0MZlnsgN5cNMB5v2LCfveNqZITfjrw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR12MB7149 Use the assign_cpu() helper to set or clear the CPU in the idle mask, based on the idle condition. Cc: Yury Norov Signed-off-by: Andrea Righi --- kernel/sched/ext_idle.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/kernel/sched/ext_idle.c b/kernel/sched/ext_idle.c index 0e57830072e4..dedd39febc88 100644 --- a/kernel/sched/ext_idle.c +++ b/kernel/sched/ext_idle.c @@ -460,10 +460,7 @@ void __scx_update_idle(struct rq *rq, bool idle) return; } - if (idle) - cpumask_set_cpu(cpu, idle_masks.cpu); - else - cpumask_clear_cpu(cpu, idle_masks.cpu); + assign_cpu(cpu, idle_masks.cpu, idle); #ifdef CONFIG_SCHED_SMT if (sched_smt_active()) {