From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from SA9PR02CU001.outbound.protection.outlook.com (mail-southcentralusazon11013060.outbound.protection.outlook.com [40.93.196.60]) (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 9747C489888 for ; Tue, 4 Aug 2026 05:12:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.93.196.60 ARC-Seal:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785820366; cv=fail; b=Dv3LMRMIjd1gSINkTnoNqNUxNo7Exv9ckT2uUayFV/uY4Ny7bG98alVAUWo0K/vjYaQa2jXvAxzG8CGpqnHdQ8bRGn2tyN+4KHTPexVBXQsC8xtaDfX7AjTUiSro+6VSZi7TeHkynBxiFK32GYqU5H+dOO+/sDgUY+V4WEcpAhs= ARC-Message-Signature:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1785820366; c=relaxed/simple; bh=M4PhM6QTF1hTZ0cBiHDiKyBgnq33xymu+BNvj6wcDNY=; h=Message-ID:Date:MIME-Version:Subject:To:CC:References:From: In-Reply-To:Content-Type; b=ijYjQeuE5mGzXG6AY7z2w/wwbLuSe3i724ZE+dL7g8PvCmomcAFQmylS393h+PcGn8uT/wLMI5rQ2SAGyw1pblCXVIb09T+mrxnjmj9AbGEOttNcUSqKfg43/tNzRNMFfwnwCLpussTAvlPFIkJ73OmROpb1/lEj+X2K+2MjFwQ= 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=e6VW8dj8; arc=fail smtp.client-ip=40.93.196.60 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="e6VW8dj8" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=QBau4Xuks3BoAP7ejAnIPQNsBNZnYTaQ/VVjUcR86fs1qGxjm2OjZP2olgkXYTPoczwJuZFmLPzEcu4W0QyQ5uUkJnIypf3Wa9MfHdQduNsIkgxaCBGiLDTOmfA3+6QbFy37R092O5MNK1U24uyEWouJt+2jCa7hC2kqZCf8txWfhdU/l4fNW5xMaOrkBUA8KGDA1Hp9eYfQLYrpbcn+Z5LX0rrwUV+mDz1yiFAut5fXQ4J8+Ys9LFzvU4p475LRGeKc/m4VT+ru6Vkn3uSQglhB2zHnzYQKYpO1rkam1Vlz6IDn1JK0Gp9L6YBLgumsCN+bHd81OX+D5voLTAriLg== 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=TlBvTj4g4PNybaBpDQAvJV23IgxelPcqdr4RweXD2CA=; b=rnUnbHkEE7wCHz32kzJ64k7LULNiTHk6rFXz4BiRYIIAMo6Bt9Kwsh5k0fqQ0m8xPLsmn3nhjsH5hjBccpf/MkJWd3sSebNDze/5a4pQFJf4Ta75oC5qY7rFfZKxpslhWihJPFbTExUQETMNfmgYo4H7S99ttakEz3DscMONsH6My0eQTg060TGWyLR/s+ZsL4JVJOPZ63o5plbHjTjrb9sDhrVVpOoizprJo1bpckVxMz6/mk7YL2iGah+XQlhFVwmXJIMGZrT4rPwZHWg6899yn34xKdXg+TfldqzOxEQK8R9hYYOge9KOKs5FaLJU4dewE0vPoAJoH2a2PlWkmA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=huawei.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=TlBvTj4g4PNybaBpDQAvJV23IgxelPcqdr4RweXD2CA=; b=e6VW8dj8gX/FrdETtEt9xe9cBvmbuVzgSKVeW2G9ej5y4wVdTubd1fqFf0NJP8HojEu0JrwPDJpQoyu3++Kki0G+9nXHM46DtpPrdIr8V3MWVEQQAU47rNCMmBc4DbkPu/KsjjIcC/icmL4Jd3BK8hUO19Mq8U4oK89/Nlr4R58= Received: from CH0PR04CA0094.namprd04.prod.outlook.com (2603:10b6:610:75::9) by PH7PR12MB7844.namprd12.prod.outlook.com (2603:10b6:510:27b::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.270.18; Tue, 4 Aug 2026 05:12:41 +0000 Received: from DS3PEPF0000C37C.namprd04.prod.outlook.com (2603:10b6:610:75:cafe::ab) by CH0PR04CA0094.outlook.office365.com (2603:10b6:610:75::9) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.21.270.18 via Frontend Transport; Tue, 4 Aug 2026 05:12:40 +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 DS3PEPF0000C37C.mail.protection.outlook.com (10.167.23.6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.292.8 via Frontend Transport; Tue, 4 Aug 2026 05:12:40 +0000 Received: from satlexmb10.amd.com (10.181.42.219) 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.41; Tue, 4 Aug 2026 00:12:35 -0500 Received: from satlexmb08.amd.com (10.181.42.217) by satlexmb10.amd.com (10.181.42.219) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.2562.41; Tue, 4 Aug 2026 00:09:20 -0500 Received: from [10.136.47.95] (10.180.168.240) by satlexmb08.amd.com (10.181.42.217) with Microsoft SMTP Server id 15.2.2562.41 via Frontend Transport; Tue, 4 Aug 2026 00:09:17 -0500 Message-ID: <3149b834-b4bc-485c-8ea5-6b5c6d2d4db1@amd.com> Date: Tue, 4 Aug 2026 10:39:10 +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] sched/numa: Prevent race on sysctl_numa_balancing static key To: Chen Jinghuang , Ingo Molnar , Peter Zijlstra , Juri Lelli , Vincent Guittot , "Paolo Bonzini" CC: Dietmar Eggemann , Steven Rostedt , Ben Segall , Mel Gorman , Valentin Schneider , References: <20260803123046.297426-1-chenjinghuang2@huawei.com> Content-Language: en-US From: K Prateek Nayak In-Reply-To: <20260803123046.297426-1-chenjinghuang2@huawei.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS3PEPF0000C37C:EE_|PH7PR12MB7844:EE_ X-MS-Office365-Filtering-Correlation-Id: adc709ff-38f8-4092-8b44-08def1e701ab X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|36860700016|23010399003|7416014|1800799024|376014|82310400026|56012099006|11063799006|5023799004|10067099003|22082099003|18002099003; X-Microsoft-Antispam-Message-Info: sByC01huufI6c8oj+Ikcuzy5pNLpXNFAS40MqjDvjnC1lkyGrUEOr29dz30h0j+RzAuJBA/Aopwz2IXEoiR+XspeRzvfrVoDKP46cJDVN9eWQVoc9YEgV60C0DII2ItNSuVFRXvp5kw/MiwPjDcvW92Dr4NW3M1Ex65YP2VZrHWRRY33rosfLrtOVzYqTHSxQUD7UGASpQBfPeJdSYp0zXfM0i2jEdNuW7+oTPzt2HBznq+cvbpnLxtFixx45vQJETsrMLIeoUn2v3JwOaLvHfMab+iXDQj4pxqJhrEx52xP2pW8lXuNkd5OeMAj0e8fJhJwrWnNtMLMOdHWXghLCsTbgx286DTnBU/Az23XFyU8G/GSrsF1I6vGSuhkaXSvjCiGa9Igr6ahXqPwYtXnnBSOXzjmai0vaRJYF/kx/UEG30cS8TfkdC1RYb2gyEie8FXxIbi6kXLGqwDh/S+5caURwzWxxleBG9fLFjXUiFGEU0nU6CNbcEpQpq7R9U1Tj0kLeb1RO9meZlt7vbBBDC7nLQ3gZgUGLBqY7vjuJimoeKRQ47WstC4U5QC7KTUqld12GRGI1Jv0wbL++8njXNQy9fDcv9sb3kKDmNPhQz1J7y/GLKI/PkcGbJ4ANNkBGHQMUc/8N5tV8x8nWXe2Lr5F5eiKZK4xIFI0WEHWqBNJiT0weIlkciwVF19f1sC4D2yWaCbApT4cQx/j3q4QcQ== 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)(36860700016)(23010399003)(7416014)(1800799024)(376014)(82310400026)(56012099006)(11063799006)(5023799004)(10067099003)(22082099003)(18002099003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: YuM1NHUXSc1afzNoaUXI8ALnbDUg0O5kuhlm0livIaCi/+Q52KzXoquWWAMUa7RkWD1iUbn9Y1mvp3QFcS2t09OIsFAsx6pN2vABMeIqqkcRgi+w7G2UjpZojivZycir5MErhYrwoQ8WOIrfA0riein0N7eXhUwRYvXLjUGSF3DIFdGXZQgcvC6Ia6q9Z5tb+GY3/iFP34YW1pDxz0LU/EEJisyOGf4iN7hjl5yAIEUaZoDpVzrtpM+0/8+t8NL/SxQtNv/LIrzmZ/6WalfLeu2AMJclg19rPuYAFzD0yLbdO10oX6ocPcrABI6qbHphjv63OM1jbTnfyQQfsvcb9qCcezMW0a8R/RTcSu5Fm5I4ExlemHBQ2f/cS3eKumJOlAieQPyRuzLzh+Z1BBlaXv1HxvCamV8yLatM08mKC3RNEkg/yBhXYX0ee4cSyYvu X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Aug 2026 05:12:40.0552 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: adc709ff-38f8-4092-8b44-08def1e701ab 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: DS3PEPF0000C37C.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR12MB7844 Hell Chen, On 8/3/2026 6:00 PM, Chen Jinghuang wrote: > +static DEFINE_MUTEX(numabalancing_mutex); > + > void set_numabalancing_state(bool enabled) > { > + mutex_lock(&numabalancing_mutex); > if (enabled) > sysctl_numa_balancing_mode = NUMA_BALANCING_NORMAL; > else > sysctl_numa_balancing_mode = NUMA_BALANCING_DISABLED; > __set_numabalancing_state(enabled); > + mutex_unlock(&numabalancing_mutex); > } Doesn't sysctl_numa_balancing() directly call __set_numabalancing_state() and this bit is only used by check_numabalancing_enable() on the mm side during early init? I think you should move this serialization into sysctl_numa_balancing() because nothing can race during early init and we only need this for sysfs writes. -- Thanks and Regards, Prateek