Re: [PATCH 2.6.27-rc5 incremental re-resubmit] Fix itimer/manythread hang.

From: Ingo Molnar
Date: Tue Sep 30 2008 - 02:34:20 EST



* Frank Mayhar <fmayhar@xxxxxxxxxx> wrote:

> /*
> * Return any ns on the sched_clock that have not yet been banked in
> * @p in case that task is currently running.
> - *
> - * Called with task_rq_lock() held on @rq.
> */
> -static unsigned long long task_delta_exec(struct task_struct *p, struct rq *rq)
> +unsigned long long task_delta_exec(struct task_struct *p)
> {
> + struct rq *rq;
> + unsigned long flags;
> + u64 ns = 0;
> +
> if (task_current(rq, p)) {
> u64 delta_exec;

hmmm ... where do we get 'rq' from?

in v3 you did this:

- rq = task_rq_lock(p, &flags);

which removed the deadlock but left us with a random uninitialized rq
variable ...

the right solution for the bug would have been to unlock it.
Miraculously we didnt actually crash anywhere visibly, found it by
reviewing the code. I thought this code gets excercised quite
frequently. The commit below fixes it.

Could you please functionality-test latest tip/master:

http://people.redhat.com/mingo/tip.git/README

with your testcase that excercises these codepaths heavily?

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/