Re: [patch 4/4] sched: Distangle worker accounting from rq->lock

From: Tejun Heo
Date: Thu Jun 23 2011 - 04:37:48 EST


Hello, Thomas.

The hooking place doesn't have anything to do with rq->lock. The
problem with Peter's patch was preemption, not the lock.

> There is also no harm from updating nr_running when the task returns
> from scheduling instead of accounting it in the wakeup code.

Well, not exactly. If CPU is being thrashed, we don't want to try to
fire up new workers or calling in rescuers. If nr_running is bumped
up from ttwu(), a woken up but not yet running worker already counts
as running. With the suggested change, when we hit such heavy CPU
thrashing, workqueue code will add things on top of it.

Thanks.

--
tejun
--
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/