Re: [PATCH 1/2] Introduce mutex_lock_timeout

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sat, Nov 25, 2006 at 05:00:27PM +0100, Ingo Oeser wrote:
> Ok, I will comment it. But I'll NOT comment on the implementation.
> I'll prove you instead, that timout based locking is non-sense.

Your proof misses a case and is thus invalid.

> What should the timout mutex_timeout() prevent? Usually the answer is 
> "if sombody hangs on a mutex forever ...?" and people tell you "ok, that is
> a deadlock -> fix your code not to deadlock instead."
> Then they tell you "Ok, but if somebody takes a mutex too long?"
> and people will answer "ok, then this is a livelock -> fix your code not to 
> livelock."
> 
> Another answer is "I like to block until sth. happens wihin a specific time frame" 
> -> fine, this is accomplished by wait_event_timout (which blocks only you and 
> not every other user of the mutex).

In the qla case, the mutex can be acquired by a thread which then waits
for the hardware to do something.  If the hardware locks up, it is
preferable that the system not hang.

> I know why ACPI needs it (API requirement) and I think the qla???-driver
> just needs to be fixed to work without it and nobody did it yet.

Since Christoph is the one who has his name on it:
/* XXX(hch): crude hack to emulate a down_timeout() */

I assumed that he'd spent enough time thinking about it that fixing it
really wasn't feasible.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux