Re: [PATCH v3 cgroup/for-7.0-fixes] cgroup: Fix cgroup_drain_dying() testing the wrong condition

From: Sebastian Andrzej Siewior

Date: Wed Apr 01 2026 - 09:27:48 EST


On 2026-03-27 10:18:49 [-1000], Tejun Heo wrote:
> On Thu, Mar 26, 2026 at 08:35:11AM +0100, Sebastian Andrzej Siewior wrote:
> > @@ -7141,7 +7143,7 @@ void cgroup_task_dead(struct task_struct *task)
> > {
> > get_task_struct(task);
> > llist_add(&task->cg_dead_lnode, this_cpu_ptr(&cgrp_dead_tasks));
> > - irq_work_queue(this_cpu_ptr(&cgrp_dead_tasks_iwork));
> > + schedule_delayed_work(this_cpu_ptr(&cgrp_delayed_tasks_iwork), HZ);
>
> Can you try schedule_delayed_work_on(smp_processor_id(), ...)?
> schedule_delayed_work() is using a percpu workqueue but the delay timer can
> still migrate.

So, this works and I should have known about this. Well. No more race
then.

This keeps the option open to switch to queue_work() if this approach
ends up problematic for isolated CPU folks.

Thanks.

> Thanks.
>

Sebastian