Re: [PATCH 2/2 v3] softlockup: check all tasks in hung_task

From: Ingo Molnar
Date: Wed Feb 04 2009 - 14:44:22 EST



* Mandeep Singh Baines <msb@xxxxxxxxxx> wrote:

> +static void check_hung_rcu_refresh(struct task_struct *g, struct task_struct *t)

please rename this to rcu_lock_break().

> do_each_thread(g, t) {
> - if (!--max_count)
> - goto unlock;
> + if (!--max_count) {
> + max_count = sysctl_hung_task_check_count;
> + check_hung_rcu_refresh(g, t);
> + /* Exit if t or g was unhashed during refresh. */
> + if (t->state == TASK_DEAD || g->state == TASK_DEAD)
> + goto unlock;

Thinking about it some more, i think a slightly different approach (that has
the same end effect):

- Add a "static const int check_count_batching = 1024;" variable that adds
some natural batching - and initialize max_count to that value. There's
little point to make that batching configurable.

- Leave sysctl_hung_task_check_count present but change its default to
something really large like MAX_PID.

Thanks,

Ingo
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/