[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20090124025618.GB31189@google.com>
Date: Fri, 23 Jan 2009 18:56:18 -0800
From: Mandeep Singh Baines <msb@...gle.com>
To: Ingo Molnar <mingo@...e.hu>
Cc: fweisbec@...il.com, linux-kernel@...r.kernel.org,
rientjes@...gle.com, mbligh@...gle.com, thockin@...gle.com
Subject: Re: [PATCH v3] softlockup: remove hung_task_check_count
Ingo Molnar (mingo@...e.hu) wrote:
>
> not sure i like the whole idea of removing the max iterations check. In
> theory if there's a _ton_ of tasks, we could spend a lot of time looping
> there. So it always looked prudent to limit it somewhat.
>
We could go back to exporting max iterations to proc, and set the nice
value higher.
Or:
Instead of searching the tasklist from the beginning every time, continue
where you left off. On loaded systems, will take a while to search the
entire list but at least all tasks will be checked.
Something like this:
diff --git a/kernel/hung_task.c b/kernel/hung_task.c
index ba8ccd4..d220796 100644
--- a/kernel/hung_task.c
+++ b/kernel/hung_task.c
@@ -109,6 +109,15 @@ static void check_hung_task(struct task_struct *t, unsigned long now,
panic("hung_task: blocked tasks");
}
+static void wait_till_next_iteration(struct task_struct *t)
+{
+ get_task_state(t);
+ read_unlock(&tasklist_lock);
+ schedule_timeout_interruptible(hung_task_poll_jiffies);
+ read_lock(&tasklist_lock);
+ put_task_state(t);
+}
+
/*
* Check whether a TASK_UNINTERRUPTIBLE does not get woken up for
* a really long time (120 seconds). If that happens, print out
@@ -129,8 +138,14 @@ static void check_hung_uninterruptible_tasks(unsigned long timeout)
read_lock(&tasklist_lock);
do_each_thread(g, t) {
- if (!--max_count)
- goto unlock;
+ if (!--max_count) {
+ max_count = HUNG_TASK_CHECK_COUNT;
+ wait_till_next_iteration(t);
+ timeout = sysctl_hung_task_timeout_secs;
+ /* Exit loop if t was unlinked or timeout set to 0. */
+ if (!timeout || t->state == TASK_DEAD)
+ goto unlock;
+ }
/* use "==" to skip the TASK_KILLABLE tasks waiting on NFS */
if (t->state == TASK_UNINTERRUPTIBLE)
check_hung_task(t, now, timeout);
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists