Re: IDE spin_lock bug

From: Jeff Garzik (jgarzik@mandrakesoft.com)
Date: Wed May 03 2000 - 20:05:23 EST


What sort of wait is this?

Looking at the code for ide_spin_wait_hwgroup, a couple things come to
mind.

* IIRC this was one of the places which people hacked in 2.2.x to fix an
IDE<->SMP problem. There may be issues here which are getting missed.
Namely,

* you notice how the old code drops the spinlock, then calls
__save_flags (not save_flags) and __sti (not sti). your patch
completely eliminates that per-CPU synchronization (or whatever that
code does). I'm not sure that's correct.

* spin waiting like this in general seems wrong anyway. can't we do
better? can you sneak a schedule() call in there? anyway, IIRC Alan
commented [about the 2.2.x IDE code] that it needed to be cleaned up,
that the IDE<->SMP fix in place was really a band-aid.

Maybe Andre or Alan can comment about the "right fix", if this code even
needs to be changed.... IMHO you can probably use spin_lock_irq here,
but you probably shouldn't remove the __save_flags/__sti stuff.

        Jeff

-- 
Jeff Garzik              | Nothing cures insomnia like the
Building 1024            | realization that it's time to get up.
MandrakeSoft, Inc.       |        -- random fortune

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Sun May 07 2000 - 21:00:13 EST