The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Matthew Wilcox <matthew@wil.cx>
To: Ingo Oeser <ioe-lkml@rameria.de>
Cc: linux-kernel@vger.kernel.org, Ingo Molnar <mingo@elte.hu>,
	hch@infradead.org
Subject: Re: [PATCH 1/2] Introduce mutex_lock_timeout
Date: Sat, 25 Nov 2006 09:32:43 -0700	[thread overview]
Message-ID: <20061125163242.GH14076@parisc-linux.org> (raw)
In-Reply-To: <200611251700.39806.ioe-lkml@rameria.de>

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.


  reply	other threads:[~2006-11-25 16:32 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-11-09 18:27 [PATCH 1/2] Introduce mutex_lock_timeout Matthew Wilcox
2006-11-09 18:30 ` [PATCH 2/2] Use mutex_lock_timeout in qla2xxx driver Matthew Wilcox
2006-11-20 21:21   ` Andrew Vasquez
2006-11-20 21:13 ` [PATCH 1/2] Introduce mutex_lock_timeout Andrew Vasquez
2006-11-25  3:55 ` Matthew Wilcox
2006-11-25 16:00   ` Ingo Oeser
2006-11-25 16:32     ` Matthew Wilcox [this message]
2006-11-26 11:00       ` Ingo Oeser

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20061125163242.GH14076@parisc-linux.org \
    --to=matthew@wil.cx \
    --cc=hch@infradead.org \
    --cc=ioe-lkml@rameria.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox