Re: [PATCH v3] softlockup: remove hung_task_check_count

From: Frédéric Weisbecker
Date: Fri Jan 23 2009 - 05:04:50 EST

2009/1/23 Ingo Molnar <mingo@xxxxxxx>:
> * Mandeep Baines <msb@xxxxxxxxxx> wrote:
>> On Thu, Jan 22, 2009 at 11:55 AM, Mandeep Singh Baines <msb@xxxxxxxxxx> wrote:
>> >
>> > The unlock and lock could be removed and only compiled in if PREEMPT.
>> > If the number of tasks isn't bound, the lock might be held too long.
>> >
>> This is incorrect. The adding the lock and unlock will not make the
>> system more pre-emptive. To be more pre-emptive you'd want to check
>> need_resched() as often as possible.
>> > It would be kinda funny if hung_task caused a softlockup.
>> >
>> Again. This is incorrect. Rescheduling if need_resched() will prevent
>> softlockup.
>> Not sure what I was thinking this morning;)
>> However, I am happy with the patch. To give writers a chance, the lock
>> should held for bounded time. Holding the lock in khungtask (which is
>> running at low scheduler priority) could potentially be delaying
>> important work. The longer the lock is held, the bigger the priority
>> inversion problem.
> 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.
> Ingo

Which means we can loose several of them. Would it hurt to iterate as
much as possible along the task list,
keeping some care about writers starvation and latency?
BTW I thought about the slow work framework, but I can't retrieve
it.... But this thread has already a slow priority.

Would it be interesting to provide a way for rwlocks to know if there
is writer waiting for the lock?
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at
Please read the FAQ at