<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/kernel/sched/deadline.c, branch linux-6.19.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-6.19.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-6.19.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2026-02-26T23:00:49Z</updated>
<entry>
<title>sched/deadline: Clear the defer params</title>
<updated>2026-02-26T23:00:49Z</updated>
<author>
<name>Joel Fernandes</name>
</author>
<published>2026-01-26T09:58:59Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=4d55a051488343f602ebfdd4b102ce48583fa453'/>
<id>urn:sha1:4d55a051488343f602ebfdd4b102ce48583fa453</id>
<content type='text'>
[ Upstream commit 3cb3b27693bf30defb16aa096158a3b24583b8d2 ]

The defer params were not cleared in __dl_clear_params. Clear them.

Without this is some of my test cases are flaking and the DL timer is
not starting correctly AFAICS.

Fixes: a110a81c52a9 ("sched/deadline: Deferrable dl server")
Signed-off-by: Joel Fernandes &lt;joelagnelf@nvidia.com&gt;
Signed-off-by: Peter Zijlstra (Intel) &lt;peterz@infradead.org&gt;
Reviewed-by: Andrea Righi &lt;arighi@nvidia.com&gt;
Acked-by: Juri Lelli &lt;juri.lelli@redhat.com&gt;
Tested-by: Christian Loehle &lt;christian.loehle@arm.com&gt;
Link: https://patch.msgid.link/20260126100050.3854740-2-arighi@nvidia.com
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>sched/deadline: Fix 'stuck' dl_server</title>
<updated>2026-01-30T22:06:06Z</updated>
<author>
<name>Peter Zijlstra</name>
</author>
<published>2026-01-30T12:41:00Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=115135422562e2f791e98a6f55ec57b2da3b3a95'/>
<id>urn:sha1:115135422562e2f791e98a6f55ec57b2da3b3a95</id>
<content type='text'>
Andrea reported the dl_server getting stuck for him. He tracked it
down to a state where dl_server_start() saw dl_defer_running==1, but
the dl_server's job is no longer valid at the time of
dl_server_start().

In the state diagram this corresponds to [4] D-&gt;A (or dl_server_stop()
due to no more runnable tasks) followed by [1], which in case of a
lapsed deadline must then be A-&gt;B.

Now our A has dl_defer_running==1, while B demands
dl_defer_running==0, therefore it must get cleared when the CBS wakeup
rules demand a replenish.

Fixes: a110a81c52a9 ("sched/deadline: Deferrable dl server")
Reported-by: Andrea Righi arighi@nvidia.com
Signed-off-by: Peter Zijlstra (Intel) &lt;peterz@infradead.org&gt;
Acked-by: Juri Lelli &lt;juri.lelli@redhat.com&gt;
Tested-by: Andrea Righi arighi@nvidia.com
Link: https://lkml.kernel.org/r/20260123161645.2181752-1-arighi@nvidia.com
Link: https://patch.msgid.link/20260130124100.GC1079264@noisy.programming.kicks-ass.net
</content>
</entry>
<entry>
<title>sched/deadline: Use ENQUEUE_MOVE to allow priority change</title>
<updated>2026-01-15T20:57:53Z</updated>
<author>
<name>Peter Zijlstra</name>
</author>
<published>2026-01-15T08:27:22Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=627cc25f84466d557d86e5dc67b43a4eea604c80'/>
<id>urn:sha1:627cc25f84466d557d86e5dc67b43a4eea604c80</id>
<content type='text'>
Pierre reported hitting balance callback warnings for deadline tasks
after commit 6455ad5346c9 ("sched: Move sched_class::prio_changed()
into the change pattern").

It turns out that DEQUEUE_SAVE+ENQUEUE_RESTORE does not preserve DL
priority and subsequently trips a balance pass -- where one was not
expected.

From discussion with Juri and Luca, the purpose of this clause was to
deal with tasks new to DL and all those sites will have MOVE set (as
well as CLASS, but MOVE is move conservative at this point).

Per the previous patches MOVE is audited to always run the balance
callbacks, so switch enqueue_dl_entity() to use MOVE for this case.

Fixes: 6455ad5346c9 ("sched: Move sched_class::prio_changed() into the change pattern")
Reported-by: Pierre Gondois &lt;pierre.gondois@arm.com&gt;
Signed-off-by: Peter Zijlstra (Intel) &lt;peterz@infradead.org&gt;
Tested-by: Pierre Gondois &lt;pierre.gondois@arm.com&gt;
Tested-by: Juri Lelli &lt;juri.lelli@redhat.com&gt;
Link: https://patch.msgid.link/20260114130528.GB831285@noisy.programming.kicks-ass.net
</content>
</entry>
<entry>
<title>sched/deadline: Avoid double update_rq_clock()</title>
<updated>2026-01-15T20:57:52Z</updated>
<author>
<name>Peter Zijlstra</name>
</author>
<published>2026-01-13T11:57:14Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=4de9ff76067b40c3660df73efaea57389e62ea7a'/>
<id>urn:sha1:4de9ff76067b40c3660df73efaea57389e62ea7a</id>
<content type='text'>
When setup_new_dl_entity() is called from enqueue_task_dl() -&gt;
enqueue_dl_entity(), the rq-clock should already be updated, and
calling update_rq_clock() again is not right.

Move the update_rq_clock() to the one other caller of
setup_new_dl_entity(): sched_init_dl_server().

Fixes: 9f239df55546 ("sched/deadline: Initialize dl_servers after SMP")
Reported-by: Pierre Gondois &lt;pierre.gondois@arm.com&gt;
Signed-off-by: Peter Zijlstra (Intel) &lt;peterz@infradead.org&gt;
Tested-by: Pierre Gondois &lt;pierre.gondois@arm.com&gt;
Link: https://patch.msgid.link/20260113115622.GA831285@noisy.programming.kicks-ass.net
</content>
</entry>
<entry>
<title>sched/deadline: Ensure get_prio_dl() is up-to-date</title>
<updated>2026-01-15T20:57:52Z</updated>
<author>
<name>Peter Zijlstra</name>
</author>
<published>2026-01-06T10:41:13Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=375410bb9a403009a44af3cc7f087090da076e09'/>
<id>urn:sha1:375410bb9a403009a44af3cc7f087090da076e09</id>
<content type='text'>
Pratheek tripped a WARN and noted the following issue:

&gt; Inspecting the set of events that led to the warning being triggered
&gt; showed the following:
&gt;
&gt;     systemd-1  [008] dN.31 ...: do_set_cpus_allowed: set_cpus_allowed begin!
&gt;
&gt;     systemd-1  [008] dN.31 ...: sched_change_begin: Begin!
&gt;     systemd-1  [008] dN.31 ...: sched_change_begin: Before dequeue_task()!
&gt;     systemd-1  [008] dN.31 ...: update_curr_dl_se: update_curr_dl_se: ENQUEUE_REPLENISH
&gt;     systemd-1  [008] dN.31 ...: enqueue_dl_entity: enqueue_dl_entity: ENQUEUE_REPLENISH
&gt;     systemd-1  [008] dN.31 ...: replenish_dl_entity: Replenish before: 14815760217
&gt;     systemd-1  [008] dN.31 ...: replenish_dl_entity: Replenish after: 14816960047
&gt;     systemd-1  [008] dN.31 ...: sched_change_begin: Before put_prev_task()!
&gt;
&gt;     systemd-1  [008] dN.31 ...: sched_change_end: Before enqueue_task()!
&gt;     systemd-1  [008] dN.31 ...: sched_change_end: Before put_prev_task()!
&gt;     systemd-1  [008] dN.31 ...: prio_changed_dl: Queuing pull task on prio change: 14815760217 -&gt; 14816960047
&gt;     systemd-1  [008] dN.31 ...: prio_changed_dl: Queuing balance callback!
&gt;     systemd-1  [008] dN.31 ...: sched_change_end: End!
&gt;
&gt;     systemd-1  [008] dN.31 ...: do_set_cpus_allowed: set_cpus_allowed end!
&gt;     systemd-1  [008] dN.21 ...: __schedule: Woops! Balance callback found!
&gt;
&gt; 1. sched_change_begin() from guard(sched_change) in
&gt;    do_set_cpus_allowed() stashes the priority, which for the deadline
&gt;    task, is "p-&gt;dl.deadline".
&gt; 2. The dequeue of the deadline task replenishes the deadline.
&gt; 3. The task is enqueued back after guard's scope ends and since there is
&gt;    no *_CLASS flags set, sched_change_end() calls
&gt;    dl_sched_class-&gt;prio_changed() which compares the deadline.
&gt; 4. Since deadline was moved on dequeue, prio_changed_dl() sees the value
&gt;    differ from the stashed value and queues a balance pull callback.
&gt; 5. do_set_cpus_allowed() finishes and drops the rq_lock without doing a
&gt;    do_balance_callbacks().
&gt; 6. Grabbing the rq_lock() at subsequent __schedule() triggers the
&gt;    warning since the balance pull callback was never executed before
&gt;    dropping the lock.

Meaning get_prio_dl() ought to update current and return an up-to-date
value.

Fixes: 6455ad5346c9 ("sched: Move sched_class::prio_changed() into the change pattern")
Reported-by: K Prateek Nayak &lt;kprateek.nayak@amd.com&gt;
Signed-off-by: Peter Zijlstra (Intel) &lt;peterz@infradead.org&gt;
Reviewed-by: K Prateek Nayak &lt;kprateek.nayak@amd.com&gt;
Tested-by: K Prateek Nayak &lt;kprateek.nayak@amd.com&gt;
Link: https://patch.msgid.link/20260106104113.GX3707891@noisy.programming.kicks-ass.net
</content>
</entry>
<entry>
<title>sched/deadline: Fix server stopping with runnable tasks</title>
<updated>2026-01-13T10:37:52Z</updated>
<author>
<name>Gabriele Monaco</name>
</author>
<published>2026-01-13T08:52:01Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=ca1e8eede4fc68ce85a9fdce1a6c13ad64933318'/>
<id>urn:sha1:ca1e8eede4fc68ce85a9fdce1a6c13ad64933318</id>
<content type='text'>
The deadline server can currently stop due to idle although fair tasks
are runnable. This happens essentially when:

 * the server is set to idle, a task wakes up, the server stops
 * a task wakes up, the server sets itself to idle and stops right away

Address both cases by clearing the server idle flag whenever a fair task
wakes up and accounting also for pending tasks in the definition of idle.

Fixes: f5a538c07df2 ("sched/deadline: Fix dl_server stop condition")
Signed-off-by: Gabriele Monaco &lt;gmonaco@redhat.com&gt;
Signed-off-by: Peter Zijlstra (Intel) &lt;peterz@infradead.org&gt;
Link: https://patch.msgid.link/20260113085159.114226-3-gmonaco@redhat.com
</content>
</entry>
<entry>
<title>sched/deadline: Fix potential race in dl_add_task_root_domain()</title>
<updated>2026-01-13T10:37:51Z</updated>
<author>
<name>Pingfan Liu</name>
</author>
<published>2025-11-25T03:26:30Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=64e6fa76610ec970cfa8296ed057907a4b384ca5'/>
<id>urn:sha1:64e6fa76610ec970cfa8296ed057907a4b384ca5</id>
<content type='text'>
The access rule for local_cpu_mask_dl requires it to be called on the
local CPU with preemption disabled. However, dl_add_task_root_domain()
currently violates this rule.

Without preemption disabled, the following race can occur:

1. ThreadA calls dl_add_task_root_domain() on CPU 0
2. Gets pointer to CPU 0's local_cpu_mask_dl
3. ThreadA is preempted and migrated to CPU 1
4. ThreadA continues using CPU 0's local_cpu_mask_dl
5. Meanwhile, the scheduler on CPU 0 calls find_later_rq() which also
   uses local_cpu_mask_dl (with preemption properly disabled)
6. Both contexts now corrupt the same per-CPU buffer concurrently

Fix this by moving the local_cpu_mask_dl access to the preemption
disabled section.

Closes: https://lore.kernel.org/lkml/aSBjm3mN_uIy64nz@jlelli-thinkpadt14gen4.remote.csb
Fixes: 318e18ed22e8 ("sched/deadline: Walk up cpuset hierarchy to decide root domain when hot-unplug")
Reported-by: Juri Lelli &lt;juri.lelli@redhat.com&gt;
Signed-off-by: Pingfan Liu &lt;piliu@redhat.com&gt;
Signed-off-by: Peter Zijlstra (Intel) &lt;peterz@infradead.org&gt;
Acked-by: Juri Lelli &lt;juri.lelli@redhat.com&gt;
Acked-by: Waiman Long &lt;longman@redhat.com&gt;
Link: https://patch.msgid.link/20251125032630.8746-3-piliu@redhat.com
</content>
</entry>
<entry>
<title>sched/deadline: Remove unnecessary comment in dl_add_task_root_domain()</title>
<updated>2026-01-13T10:37:51Z</updated>
<author>
<name>Pingfan Liu</name>
</author>
<published>2025-11-25T03:26:29Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=479972efc2e7c9e0b3743ac538b042fcd4f315d7'/>
<id>urn:sha1:479972efc2e7c9e0b3743ac538b042fcd4f315d7</id>
<content type='text'>
The comments above dl_get_task_effective_cpus() and
dl_add_task_root_domain() already explain how to fetch a valid
root domain and protect against races. There's no need to repeat
this inside dl_add_task_root_domain(). Remove the redundant comment
to keep the code clean.

No functional change.

Signed-off-by: Pingfan Liu &lt;piliu@redhat.com&gt;
Signed-off-by: Peter Zijlstra (Intel) &lt;peterz@infradead.org&gt;
Acked-by: Juri Lelli &lt;juri.lelli@redhat.com&gt;
Acked-by: Waiman Long &lt;longman@redhat.com&gt;
Link: https://patch.msgid.link/20251125032630.8746-2-piliu@redhat.com
</content>
</entry>
<entry>
<title>Merge tag 'cgroup-for-6.19' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/cgroup</title>
<updated>2025-12-03T21:04:07Z</updated>
<author>
<name>Linus Torvalds</name>
</author>
<published>2025-12-03T21:04:07Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=8449d3252c2603a51ffc7c36cb5bd94874378b7d'/>
<id>urn:sha1:8449d3252c2603a51ffc7c36cb5bd94874378b7d</id>
<content type='text'>
Pull cgroup updates from Tejun Heo:

 - Defer task cgroup unlink until after the dying task's final context
   switch so that controllers see the cgroup properly populated until
   the task is truly gone

 - cpuset cleanups and simplifications.

   Enforce that domain isolated CPUs stay in root or isolated partitions
   and fail if isolated+nohz_full would leave no housekeeping CPU. Fix
   sched/deadline root domain handling during CPU hot-unplug and race
   for tasks in attaching cpusets

 - Misc fixes including memory reclaim protection documentation and
   selftest KTAP conformance

* tag 'cgroup-for-6.19' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/cgroup: (21 commits)
  cpuset: Treat cpusets in attaching as populated
  sched/deadline: Walk up cpuset hierarchy to decide root domain when hot-unplug
  cgroup/cpuset: Introduce cpuset_cpus_allowed_locked()
  docs: cgroup: No special handling of unpopulated memcgs
  docs: cgroup: Note about sibling relative reclaim protection
  docs: cgroup: Explain reclaim protection target
  selftests/cgroup: conform test to KTAP format output
  cpuset: remove need_rebuild_sched_domains
  cpuset: remove global remote_children list
  cpuset: simplify node setting on error
  cgroup: include missing header for struct irq_work
  cgroup: Fix sleeping from invalid context warning on PREEMPT_RT
  cgroup/cpuset: Globally track isolated_cpus update
  cgroup/cpuset: Ensure domain isolated CPUs stay in root or isolated partition
  cgroup/cpuset: Move up prstate_housekeeping_conflict() helper
  cgroup/cpuset: Fail if isolated and nohz_full don't leave any housekeeping
  cgroup/cpuset: Rename update_unbound_workqueue_cpumask() to update_isolation_cpumasks()
  cgroup: Defer task cgroup unlink until after the task is done switching out
  cgroup: Move dying_tasks cleanup from cgroup_task_release() to cgroup_task_free()
  cgroup: Rename cgroup lifecycle hooks to cgroup_task_*()
  ...
</content>
</entry>
<entry>
<title>sched/deadline: Walk up cpuset hierarchy to decide root domain when hot-unplug</title>
<updated>2025-11-20T16:57:58Z</updated>
<author>
<name>Pingfan Liu</name>
</author>
<published>2025-11-19T09:55:25Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=318e18ed22e89397635e15095c014accaf47ed30'/>
<id>urn:sha1:318e18ed22e89397635e15095c014accaf47ed30</id>
<content type='text'>
*** Bug description ***
When testing kexec-reboot on a 144 cpus machine with
isolcpus=managed_irq,domain,1-71,73-143 in kernel command line, I
encounter the following bug:

[   97.114759] psci: CPU142 killed (polled 0 ms)
[   97.333236] Failed to offline CPU143 - error=-16
[   97.333246] ------------[ cut here ]------------
[   97.342682] kernel BUG at kernel/cpu.c:1569!
[   97.347049] Internal error: Oops - BUG: 00000000f2000800 [#1] SMP
[...]

In essence, the issue originates from the CPU hot-removal process, not
limited to kexec. It can be reproduced by writing a SCHED_DEADLINE
program that waits indefinitely on a semaphore, spawning multiple
instances to ensure some run on CPU 72, and then offlining CPUs 1–143
one by one. When attempting this, CPU 143 failed to go offline.
  bash -c 'taskset -cp 0 $$ &amp;&amp; for i in {1..143}; do echo 0 &gt; /sys/devices/system/cpu/cpu$i/online 2&gt;/dev/null; done'

Tracking down this issue, I found that dl_bw_deactivate() returned
-EBUSY, which caused sched_cpu_deactivate() to fail on the last CPU.
But that is not the fact, and contributed by the following factors:
When a CPU is inactive, cpu_rq()-&gt;rd is set to def_root_domain. For an
blocked-state deadline task (in this case, "cppc_fie"), it was not
migrated to CPU0, and its task_rq() information is stale. So its rq-&gt;rd
points to def_root_domain instead of the one shared with CPU0.  As a
result, its bandwidth is wrongly accounted into a wrong root domain
during domain rebuild.

*** Issue ***
The key point is that root_domain is only tracked through active rq-&gt;rd.
To avoid using a global data structure to track all root_domains in the
system, there should be a method to locate an active CPU within the
corresponding root_domain.

*** Solution ***
To locate the active cpu, the following rules for deadline
sub-system is useful
  -1.any cpu belongs to a unique root domain at a given time
  -2.DL bandwidth checker ensures that the root domain has active cpus.

Now, let's examine the blocked-state task P.
If P is attached to a cpuset that is a partition root, it is
straightforward to find an active CPU.
If P is attached to a cpuset that has changed from 'root' to 'member',
the active CPUs are grouped into the parent root domain. Naturally, the
CPUs' capacity and reserved DL bandwidth are taken into account in the
ancestor root domain. (In practice, it may be unsafe to attach P to an
arbitrary root domain, since that domain may lack sufficient DL
bandwidth for P.) Again, it is straightforward to find an active CPU in
the ancestor root domain.

This patch groups CPUs into isolated and housekeeping sets. For the
housekeeping group, it walks up the cpuset hierarchy to find active CPUs
in P's root domain and retrieves the valid rd from cpu_rq(cpu)-&gt;rd.

Signed-off-by: Pingfan Liu &lt;piliu@redhat.com&gt;
Cc: Waiman Long &lt;longman@redhat.com&gt;
Cc: Chen Ridong &lt;chenridong@huaweicloud.com&gt;
Cc: Peter Zijlstra &lt;peterz@infradead.org&gt;
Cc: Juri Lelli &lt;juri.lelli@redhat.com&gt;
Cc: Pierre Gondois &lt;pierre.gondois@arm.com&gt;
Cc: Ingo Molnar &lt;mingo@redhat.com&gt;
Cc: Vincent Guittot &lt;vincent.guittot@linaro.org&gt;
Cc: Dietmar Eggemann &lt;dietmar.eggemann@arm.com&gt;
Cc: Steven Rostedt &lt;rostedt@goodmis.org&gt;
Cc: Ben Segall &lt;bsegall@google.com&gt;
Cc: Mel Gorman &lt;mgorman@suse.de&gt;
Cc: Valentin Schneider &lt;vschneid@redhat.com&gt;
To: linux-kernel@vger.kernel.org
Signed-off-by: Tejun Heo &lt;tj@kernel.org&gt;
</content>
</entry>
</feed>
