Re: [PATCH] SCSI: Replace semaphores with wait_even

From: Ingo Molnar
Date: Sun Oct 24 2004 - 18:11:27 EST



* James Bottomley <James.Bottomley@xxxxxxxxxxxx> wrote:

> On Sun, 2004-10-24 at 16:06, Thomas Gleixner wrote:
> > Hmm, strange. It works on two systems here and others using this
> > modification had no problem either.
> > I will check again.
>
> Yes, very strange given what the mistake is:
>
> - down_interruptible(&sem);
> + wait_event_interruptible(eh_wait, shost->eh_kill ||
> + (shost->host_busy ==
> shost->host_failed));
>
> This condition is always true when the eh thread first starts because
> the default quiescent state of a scsi host is
>
> shost->host_busy = shost->host_failed = 0
>
> so your change makes the eh_thread spin forever locking everything
> else off the CPU. On a UP system, this is a complete hang.

i think i fixed this in my PREEMPT_REALTIME tree (having seen spinning
eh_threads) - maybe Thomas forgot to merge those fixes back?

(in a PREEMPT_REALTIME kernel a spinning thread is just a thread eating
up CPU power, it doesnt cause a hang.)

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