From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=52.101.201.62 ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass; t=1796096954; b=m+Rj6BrUjvVQKIjVQ7ujKeld5sqpj7/A0EMYMNQF3Yg2qhxJtzgsbGp84cvRX9R9s2Ru Qkbl9tdmbccRrLgiI8Pg5WEO7ClXCmSvsFSSRSvFNBUuwkCePrEzdRBAnaXYVU2grNeua MQXjcJlvdrEwlPGw4WmfoMIFR3SME7fVPJZm1f2kfh1to3csIXZHRP9uS9ODuP01QFO6z B8mQr/HEWaSKOj4ej8vih+fXIH9nw/6PHweGB0hyUne8ezEiyp9oZ/iEciaUe2ZUOtyl1 BvV3rjpShX3soYWcomO/0n0/WyrfvDCm4FGsrv/mWqIcw7Q6vR64XfL7Yc/igLasKuQ== ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796096954; h=DMARC-Filter:DKIM-Signature:Received:Received: X-MS-Exchange-Authentication-Results:Received-SPF:Received:Received: Received:Received:Message-ID:Date:MIME-Version:User-Agent:Subject:To: CC:References:Content-Language:From:In-Reply-To:Content-Type: Content-Transfer-Encoding:X-EOPAttributedMessage: X-MS-PublicTrafficType:X-MS-TrafficTypeDiagnostic: X-MS-Office365-Filtering-Correlation-Id:X-MS-Exchange-SenderADCheck: X-MS-Exchange-AntiSpam-Relay:X-Microsoft-Antispam: X-Microsoft-Antispam-Message-Info:X-Forefront-Antispam-Report: X-MS-Exchange-AntiSpam-MessageData-ChunkCount: X-MS-Exchange-AntiSpam-MessageData-0:X-OriginatorOrg: X-MS-Exchange-CrossTenant-OriginalArrivalTime: X-MS-Exchange-CrossTenant-Network-Message-Id: X-MS-Exchange-CrossTenant-Id: X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: X-MS-Exchange-CrossTenant-AuthSource:X-MS-Exchange-CrossTenant-AuthAs: X-MS-Exchange-CrossTenant-FromEntityHeader: X-MS-Exchange-Transport-CrossTenantHeadersStamped; bh=Yibno8zmgQ8MAA3J0T1EiYMGFemL46cKhdDoG2Xb75E=; b=i58du9rF0VmZe48JrDjObxXIaXzqAENG5oj5rHnZSZf4kyiyxaE2sPI4Ni+tkQH+zyzv zJYl3wJ+OGRHj22Vpo4NWhnbpXMPBG9wg/32bT4ZkAdfvgKCm4y1ELYp//vWx0xWTT1Qp 67nUyh+QaSkwhI65E+/pxFcs6E+iACy9f7ugB9+MKtINvg41idHF3zw/lHFkqZAog2Par +L1eAIHLg58G7Nc1OxTgpQO1z56Ps1YPLT6Qck+T9c63bdIFXV1mgrcrtw36ZFuRPrbuT kYGxsSOw5bBFd81hzbh2sLJhPKCsc/mpzx5izzRBPXXx21HAuVmR3Sk9MOEHMO6EGxg== ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass header.from=amd.com; spf=fail smtp.mailfrom=amd.com; dkim=pass header.d=amd.com header.i=@amd.com header.a=rsa-sha256 header.s=selector1 header.b=vFSsWya8; arc=pass header.oldest-pass=0 smtp.remote-ip=52.101.201.62 Received: from PH7PR06CU001.outbound.protection.outlook.com (mail-westus3azon11010062.outbound.protection.outlook.com [52.101.201.62]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (secp384r1) server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D1258606A31A; Tue, 1 Dec 2026 03:49:13 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org D1258606A31A 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, unprotected) header.d=amd.com header.i=@amd.com header.a=rsa-sha256 header.s=selector1 header.b=vFSsWya8 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=VPb1QyBdudtUX484vwnd+3U42EmetJnZzDvCOwTqTYrtni8cdNnV9lGLVqfBzETJt9Sa1tVWYwE48sawJrU4/ba+BgaX4V9ceaJbpCFqHdjlrm7Yc9jht7bi47zc3EBZlMdYaE0zlj/Mem5rweXZ4xk1M1PoselXQyfOuYv+LGZd+vfm0zzP+7EdGTnvL+I303QvKTrmzHyydr7U3nf6MS6uKxLgVEO9dFMbQZds/efz1Dea9K7ix2qMEga73Msjng5opkoB9ml1jVUMGtVeE45k2W0K5Oq5gt/8zTJCUR9tl0ALVh+5s/DrTJ+ceVRBkjzvNKKSHcrQipQzweSCDg== 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=Yibno8zmgQ8MAA3J0T1EiYMGFemL46cKhdDoG2Xb75E=; b=HiKAXzcMPm+E82Ldjuygieg9M5hVogLc3fdpEk3bIkXlDaX7XgbC4lgrZMnTIaoVAOxSFCy/RVjqBGkOMJY87AuYRUxZHbP/KqN2Tvma2B2O592Yf/V7o+7+eB+3G20zk72oUImnDMpNw/FaHaRx1bJag+lSmtfW0WMMM3mC4QDHEhUofmMPo5WVPWiGeR745j2Fzj7oW1ImF8wsYtwLasYuWo27+LMXBwugJgfCi5cr8jXL/57vta6fQa5FPuplQ7sk3uBGLbw4XXuLfp69V0j04P10JbLlQWrTKQSWgS3P48ou9NLTl30ZbTpUHvxKJg41vdRiyaeUvJa/7ehLpQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=oss.qualcomm.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=Yibno8zmgQ8MAA3J0T1EiYMGFemL46cKhdDoG2Xb75E=; b=vFSsWya8OL+e7I6y5Q25K3TBm3sr4uNGdXd/m9BMCfsYIpkkTDDtkCKCOkRj/S+IXQBU+GQF+tDsjoGjNXPRNeuPeoCs4ZqBE85MFgNgVHxh/HFzjuLs0fURswjtMy0JtojyyN1rEVi6s6wjIgyWJ07vKA60RAL9om3oVPSpXyE= Received: from DM6PR04CA0019.namprd04.prod.outlook.com (2603:10b6:5:334::24) by SJ0PR12MB6903.namprd12.prod.outlook.com (2603:10b6:a03:485::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.662.13; Tue, 1 Dec 2026 03:49:07 +0000 Received: from DS8PEPF000000DE.namprd05.prod.outlook.com (2603:10b6:5:334:cafe::52) by DM6PR04CA0019.outlook.office365.com (2603:10b6:5:334::24) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.21.688.10 via Frontend Transport; Tue, 1 Dec 2026 03:49:06 +0000 X-MS-Exchange-Authentication-Results: mx.microsoft.com 1; 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 DS8PEPF000000DE.mail.protection.outlook.com (10.167.23.199) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.21.688.5 via Frontend Transport; Tue, 1 Dec 2026 03:49:06 +0000 Received: from Satlexmb09.amd.com (10.181.42.218) 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.57; Mon, 30 Nov 2026 21:49:06 -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.57; Mon, 30 Nov 2026 21:49:05 -0600 Received: from [10.136.42.27] (10.180.168.240) by satlexmb07.amd.com (10.181.42.216) with Microsoft SMTP Server id 15.2.2562.57 via Frontend Transport; Mon, 30 Nov 2026 21:49:01 -0600 Message-ID: Date: Tue, 1 Dec 2026 09:18:55 +0530 X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] cpufreq: schedutil: Allow use on UP kernels To: Zhongqiu Han , Christian Loehle , Ingo Molnar , Peter Zijlstra , Juri Lelli , Vincent Guittot CC: Dietmar Eggemann , Steven Rostedt , Ben Segall , Mel Gorman , Valentin Schneider , , , "Rafael J. Wysocki" , Viresh Kumar , "open list:CPU FREQUENCY SCALING FRAMEWORK" References: <20261129201053.80590-1-christian.loehle@arm.com> <80895dfb-a8d0-4ac5-af0d-8641ff8d3a93@oss.qualcomm.com> Content-Language: en-US From: K Prateek Nayak In-Reply-To: <80895dfb-a8d0-4ac5-af0d-8641ff8d3a93@oss.qualcomm.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS8PEPF000000DE:EE_|SJ0PR12MB6903:EE_ X-MS-Office365-Filtering-Correlation-Id: ea34d62f-65f3-449a-9ad1-08df4f5e0c82 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|7416014|376014|36860700016|82310400026|1800799024|23010399003|11063799006|4143699003|6133799003|261009223027099003|22082099003|18002099003|3023799007|10067099003|261026140227099003|56012099006|261102123227099003|261026121527099003|261028144727099003|261022105027099003|261021121427099003|261022075727099003; X-Microsoft-Antispam-Message-Info: 2DswwhHBEzOLNEOY68ARIbeX6YyA5n7RlOP0NXHv2BLtiLzbobms2JM+wrdbZjs0+u2bJVIW1ez5/mMH77jMXnb6hoTkShtOan/837Whdyxtf4PZAHnoQBq0Q1PmlnUVd1PjCdSCfx8pqVtV7rU6KTZq6uEaXK64jGwCGlnfrv+EYniaFOubwm0FiGpT9F5Bz7o9T/3TXLZT55aDuU60JNxHKfyp7oDsj1lvdLM6KMbsGpJJEjwK5l/rRHttzro/Zsy7Fmd77I/l0P8HK+ghS131X3eYdl7dTXcfonPuF21LNre9HGEAs/ZMw8EcPWRDTS5og9ufaEZ+MUxHjDtHwSsiqOXKE51nt6oUEHcrvD4xyei/7IS0Krg+mDJ5BWYcdBYd81GYF58+yr5KQ7rZKwfP2Nl32Nh/iuEx/JAqmRw/aNzYruWjt/SidlAUb5clvMOuaW+2VSrSzOAcbnNuYajhV4SVhVldkB8ASWHoF9UHY+H+PHbLq7tKA8uuGVPImqXAI8iJMC06B49JnYbK8iI356fbmOTr3hF6BDWTfCMb748+1Uz8wN0igIEEUZxVd5yBFYOwISt+tH/8nmMFj4cIj90XGjyGNN3Dn3ea+3qqm3yFp/SdanWwDQUfkt3AfIs8PZ9WTbYhorJG3iv9EPQlxLQsiR1S10cm+tn7MF4QUE81EZvZu+azCd/JMv2ewf8gMSgm0D0SX6vVImNU3w== 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)(7416014)(376014)(36860700016)(82310400026)(1800799024)(23010399003)(11063799006)(4143699003)(6133799003)(261009223027099003)(22082099003)(18002099003)(3023799007)(10067099003)(261026140227099003)(56012099006)(261102123227099003)(261026121527099003)(261028144727099003)(261022105027099003)(261021121427099003)(261022075727099003);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 4RL8umo4HBtgg1ycxa+dVxZ5+epbcja3J2by7dPzeKxupzhEE+hhbo40ItWM8JwpY13tyU/epXzm9iLQVPaX1F2Ozm2bzEB4urqxhGBGdLpxzMXXqX2Ke8zL6x9Si8i6n3vxeE8fBWCc+pw4FMW+e4BofmqWdmBrnEuAK7Y3QiQzAM0SXBCFaAEdD6UtnZj0zbE8FPMBqxCmhen/B3uIpoQhWAWFS2lwdNqYd7vbpzbgh3Pjbv6F647ZMe1EG+sxEApIt6uuk4PQTaVLMkz6CslX2NLvYXMGXUcP4yAUlZ2yUijmPh3IXrspur/K9QTWHBHZxr91QHcRTq47+NDTotsAiXigbOUxKvRlb5WN+z2TJEmh7VScuEajfifAb8QtB/broYY3YNadyJYyCyYYk+Zh5fhvTTUEHtNVx8Jil3gUx+n+zQSk/uIpXmi1/xWW X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Dec 2026 03:49:06.4491 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: ea34d62f-65f3-449a-9ad1-08df4f5e0c82 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: DS8PEPF000000DE.namprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR12MB6903 Hello Zhongqiu, On 11/30/2026 7:14 PM, Zhongqiu Han wrote: > Hi Christian, > > Thanks for the patch. > > On 11/30/2026 4:10 AM, Christian Loehle wrote: >> Schedutil was restricted to SMP when the scheduler did not provide >> utilization data on UP. Commit cac5cefbade9 ("sched/smp: Make SMP >> unconditional") enabled PELT accounting on UP, but schedutil's Kconfig >> restrictions remained. > > [Adding Rafael, Viresh and linux-pm] > > The Kconfig change looks fine, but one thing may be worth discussing: > on a single CPU rq->sd is NULL, so the blocked load update never runs > and rq->avg_rt/avg_dl don't decay until another RT/DL task runs. > Couldn't that leave the frequency stuck high? Should NULL-domain CPUs > decay these from the tick, like scx_tick() does? Yes, it does make sense to update the averages if we get a tick on a NULL domain CPU - isolated ones should not get a tick and the remote handlers should do the right thing for the regular nohz ones. Something like below perhaps: (Only build tested) diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 2d9d3d686261..16fffd6381e5 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -10386,6 +10386,15 @@ static void put_prev_task_fair(struct rq *rq, struct task_struct *prev, struct t struct cfs_rq *cfs_rq = &rq->cfs; struct sched_entity *nse = NULL; + /* + * Task from a different class will run next - if it is a higher + * priority class, we'll need to decau its averages next or if + * it is a lower priority class, blocked averages for fair needs + * decaying. Notify there may be some blocked load to decay. + */ + if (next && next->sched_class != &fair_sched_class) + rq->has_blocked_load = 1; + #ifdef CONFIG_FAIR_GROUP_SCHED if (next && next->sched_class == &fair_sched_class) nse = &next->se; @@ -11548,18 +11557,18 @@ static inline void update_blocked_load_tick(struct rq *rq) WRITE_ONCE(rq->last_blocked_load_update_tick, jiffies); } -static inline void update_has_blocked_load_status(struct rq *rq, bool has_blocked_load) -{ - if (!has_blocked_load) - rq->has_blocked_load = 0; -} #else /* !CONFIG_NO_HZ_COMMON: */ static inline bool cfs_rq_has_blocked_load(struct cfs_rq *cfs_rq) { return false; } static inline bool others_have_blocked(struct rq *rq) { return false; } static inline void update_blocked_load_tick(struct rq *rq) {} -static inline void update_has_blocked_load_status(struct rq *rq, bool has_blocked_load) {} #endif /* !CONFIG_NO_HZ_COMMON */ +static inline void update_has_blocked_load_status(struct rq *rq, bool has_blocked_load) +{ + if (!has_blocked_load) + rq->has_blocked_load = 0; +} + static bool __update_blocked_others(struct rq *rq, bool *done) { bool updated; @@ -15073,8 +15082,11 @@ void sched_balance_trigger(struct rq *rq) * Don't need to rebalance while attached to NULL domain or * runqueue CPU is not active */ - if (unlikely(on_null_domain(rq) || !cpu_active(cpu_of(rq)))) + if (unlikely(on_null_domain(rq) || !cpu_active(cpu_of(rq)))) { + if (rq->has_blocked_load) + sched_balance_update_blocked_averages(cpu_of(rq)); return; + } if (time_after_eq(jiffies, rq->next_balance)) raise_softirq(SCHED_SOFTIRQ); diff --git a/kernel/sched/sched.h b/kernel/sched/sched.h index 32f76551a0c5..dc2ead0b06cc 100644 --- a/kernel/sched/sched.h +++ b/kernel/sched/sched.h @@ -1235,7 +1235,6 @@ struct rq { #ifdef CONFIG_NO_HZ_COMMON unsigned int nohz_tick_stopped; atomic_t nohz_flags; - unsigned int has_blocked_load; unsigned long last_blocked_load_update_tick; call_single_data_t nohz_csd; #endif /* CONFIG_NO_HZ_COMMON */ @@ -1337,6 +1336,7 @@ struct rq { struct list_head cfs_tasks; + unsigned int has_blocked_load; struct sched_avg avg_rt; struct sched_avg avg_dl; #ifdef CONFIG_HAVE_SCHED_AVG_IRQ --- I think the setting rq->has_blocked_load in put_prev_task_fair() is safe for SMP too since this is only checked from nohz handler for the nohz_idle_cpus - nohz CPU would have populate this anyway when going idle from nohz_balance_enter_idle(). If the load was decayed fully and a short running task (short enough to not accumulate any PELT segments) runs, the rq->has_blocked_load indicator would be set spuriously and get corrected soon at next nohz balance trigger. On null domain CPUs, only the tick care about it. Thoughts? -- Thanks and Regards, Prateek