[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <aVBjDYPQcKEesoKu@slm.duckdns.org>
Date: Sat, 27 Dec 2025 12:51:57 -1000
From: Tejun Heo <tj@...nel.org>
To: Pavel Tikhomirov <ptikhomirov@...tuozzo.com>
Cc: Johannes Weiner <hannes@...xchg.org>,
Michal Koutný <mkoutny@...e.com>,
cgroups@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 2/2] cgroup-v2/freezer: Print information about
unfreezable process
Hello,
On Tue, Dec 23, 2025 at 06:20:09PM +0800, Pavel Tikhomirov wrote:
> +static void warn_freeze_timeout(struct cgroup *cgrp, int timeout)
> +{
> + char *buf __free(kfree) = NULL;
> + struct cgroup_subsys_state *css;
> +
> + guard(rcu)();
> + css_for_each_descendant_post(css, &cgrp->self) {
> + struct task_struct *task;
> + struct css_task_iter it;
> +
> + css_task_iter_start(css, 0, &it);
> + while ((task = css_task_iter_next(&it))) {
> + if (task->flags & PF_KTHREAD)
> + continue;
> + if (task->frozen)
> + continue;
> +
> + warn_freeze_timeout_task(cgrp, timeout, task);
> + css_task_iter_end(&it);
> + return;
> + }
> + css_task_iter_end(&it);
> + }
> +
> + buf = kmalloc(PATH_MAX, GFP_KERNEL);
> + if (!buf)
> + return;
> +
> + if (cgroup_path(cgrp, buf, PATH_MAX) < 0)
> + return;
> +
> + pr_warn("Freeze of %s took %ld sec, but no unfreezable process detected.\n",
> + buf, timeout / USEC_PER_SEC);
> +}
This is only suitable for debugging, and, for that, this can be done from
userspace by walking the tasks and check /proc/PID/wchan. Should be
do_freezer_trap for everything frozen. If something is not, read and dump
its /proc/PID/stack. Wouldn't that work?
Thanks.
--
tejun
Powered by blists - more mailing lists