[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <a29f0be2-5d8f-4585-8cf0-baabfd316e12@amd.com>
Date: Wed, 7 Jan 2026 10:19:48 +0530
From: K Prateek Nayak <kprateek.nayak@....com>
To: "Mario Limonciello (AMD) (kernel.org)" <superm1@...nel.org>, Huang Rui
<ray.huang@....com>, "Gautham R. Shenoy" <gautham.shenoy@....com>, "Rafael J.
Wysocki" <rafael@...nel.org>, Viresh Kumar <viresh.kumar@...aro.org>,
Srinivas Pandruvada <srinivas.pandruvada@...ux.intel.com>, Len Brown
<lenb@...nel.org>, Sebastian Andrzej Siewior <bigeasy@...utronix.de>, "Clark
Williams" <clrkwllms@...nel.org>, Bert Karwatzki <spasswolf@....de>,
<linux-pm@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
<linux-rt-devel@...ts.linux.dev>
CC: Perry Yuan <perry.yuan@....com>
Subject: Re: [RFC PATCH 2/2] cpufreq: Pass the policy to
cpufreq_driver->adjust_perf()
Hello Mario,
On 1/7/2026 1:01 AM, Mario Limonciello (AMD) (kernel.org) wrote:
>
>
> On 1/6/2026 1:36 AM, K Prateek Nayak wrote:
>> cpufreq_cpu_get() can sleep on PREEMPT_RT in presence of concurrent
>> writer(s), however amd-pstate depends on fetching the cpudata via the
>> policy's driver data which necessitates grabbing the reference.
>>
>> Since schedutil governor can call "cpufreq_driver->update_perf()"
>> during sched_tick/enqueue/dequeue with rq_lock held and IRQs disabled,
>> fetching the policy object using the cpufreq_cpu_get() helper in the
>> scheduler fast-path leads to "BUG: scheduling while atomic" on
>> PREEMPT_RT [1].
>>
>> Pass the cached cpufreq policy object in sg_policy to the update_perf()
>> instead of just the CPU. The CPU can be inferred using "policy->cpu".
>>
>> The lifetime of cpufreq_policy object outlasts that of the governor and
>> the cpufreq driver (allocated when the CPU is onlined and only reclaimed
>> when the CPU is offlined / the CPU device is removed) which makes it
>> safe to be referenced throughout the governor's lifetime.
>>
>> Link: https://lore.kernel.org/all/20250731092316.3191-1-spasswolf@web.de/ [1]
>
> I think you should have these tags instead:
> Reported-by: Bert Karwatzki <spasswolf@....de>
> Closes:https://lore.kernel.org/all/20250731092316.3191-1-spasswolf@web.de/ [1]
Ack! I'll update it in the next version. Thank you for the review.
--
Thanks and Regards,
Prateek
Powered by blists - more mailing lists