Subject: Re: Deadlock in sungem/ip_auto_config/linkwatch

From: Stefan Rompf <[email-masked]>
Date: Mon, 5 Jan 2004 17:50:55 +0100

Am Montag, 05. Januar 2004 17:19 schrieb Michal Ostrowski:

> Suppose the linkwatch code backs-off in the case that rtnl_sem is held
> legitimately by thread A.  Meanwhile, thread B is doing a
> flush_scheduled_work in order to wait for pending linkwatch events to
> complete.

This won't happen. If a pending linkwatch event needs to be scheduled 
synchronously (f.e. when a device is unregistered), it is executed in context 
of the calling process, not inside the workqueue thread.

> My initial though was to use a seperate work-queue, un-entangled with
> the global queue used for flush_scheduled_work. This would allow
> linkwatch events to be synchronized against explicitly.

That's overkill, and if I understand flush_workqueue() right, it doesn't care 
about work that is queued with delay, so it even wouldn't help. That's why I 
thought about a function to unregister pending work.

Stefan
-- 
"doesn't work" is not a magic word to explain everything.