Linux real-time development
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Zhongqiu Han" <zhongqiu.han@oss.qualcomm.com>
Cc: linux-rt-devel@lists.linux.dev, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] cpufreq: schedutil: Run irq_work in hardirq context on PREEMPT_RT
Date: Wed, 25 Nov 2026 08:12:46 +0000	[thread overview]
Message-ID: <sashiko-outbox-232874@kernel.org> (raw)
In-Reply-To: <20261125080613.1138573-1-zhongqiu.han@oss.qualcomm.com>

Thank you for your contribution! Sashiko AI review found no new issues
in this patch, but noticed 1 related pre-existing issue it does not
introduce:
- [High] sched/deadline: unallocated bandwidth subtraction in
  dl_task_needs_bw_move() [1]
--

commit 6dbfa989b510ecc8b3f76fbbc75d3d06fb5180f2
Author: Zhongqiu Han <zhongqiu.han@oss.qualcomm.com>

cpufreq: schedutil: Run irq_work in hardirq context on PREEMPT_RT

This commit initializes sg_policy->irq_work with IRQ_WORK_INIT_HARD() so
that sugov_irq_work() runs in hardirq context on PREEMPT_RT instead of
being delayed behind runnable RT tasks.

> diff --git a/kernel/sched/cpufreq_schedutil.c b/kernel/sched/cpufreq_schedutil.c
> index 14405a6149911..b2e9ac7e35172 100644
> --- a/kernel/sched/cpufreq_schedutil.c
> +++ b/kernel/sched/cpufreq_schedutil.c
> @@ -726,7 +726,7 @@ static int sugov_kthread_create(struct sugov_policy *sg_policy)
>  	else
>  		kthread_bind_mask(thread, policy->related_cpus);
>  
> -	init_irq_work(&sg_policy->irq_work, sugov_irq_work);
> +	sg_policy->irq_work = IRQ_WORK_INIT_HARD(sugov_irq_work);
>  	mutex_init(&sg_policy->work_lock);
>  
>  	wake_up_process(thread);

[Severity: High]
This problem wasn't introduced by this patch, but can binding the sugov
thread across exclusive cpuset partitions (root domains) here underflow
the source root domain's deadline bandwidth [1]?

sched_setattr_nocheck() configures the sugov thread with SCHED_DEADLINE
and SCHED_FLAG_SUGOV, which sets a non-zero p->dl.dl_bw while skipping
root domain bandwidth allocation because dl_entity_is_special(&p->dl) is
true.  If policy->related_cpus lies in a different root domain from the
kthread's initial CPU mask, set_cpus_allowed_ptr() or kthread_bind_mask()
calls set_cpus_allowed_dl(), which subtracts p->dl.dl_bw from the source
root domain whenever dl_task_needs_bw_move() returns true.

Unlike dl_add_task_root_domain() and dl_task_check_affinity(),
dl_task_needs_bw_move() does not exclude dl_entity_is_special(&p->dl)
tasks, so __dl_sub() subtracts bandwidth that was never added, triggering
a warning in __dl_sub() and corrupting SCHED_DEADLINE admission control
on the source root domain.

[1] https://sashiko.dev/#/bug/linux-a604bbac-776b-419e-820b-f5a41a07ff1c

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261125080613.1138573-1-zhongqiu.han@oss.qualcomm.com?part=1

      reply	other threads:[~2026-11-25  8:12 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-25  8:06 [PATCH] cpufreq: schedutil: Run irq_work in hardirq context on PREEMPT_RT Zhongqiu Han
2026-11-25  8:12 ` sashiko-bot [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=sashiko-outbox-232874@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rt-devel@lists.linux.dev \
    --cc=sashiko-reviews@lists.linux.dev \
    --cc=zhongqiu.han@oss.qualcomm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox