• Adam Kropelin's avatar
    [PATCH] cpqarray SMP deadlock fix · c5e1bfd8
    Adam Kropelin authored
    This fixes some critical bugs in cpqarray in 2.5.  One of the fixes
    essentially backs out the block queue stop/start behavior that was added
    recently.  This code as it stands is buggy and locks up under even light
    SMP workloads.  Certainly we want the performance benefits of proper
    block queue plugging, but the driver needs some work before it will fit
    nicely.
    
    Some of these fixes do theoretically hurt performance, but when you
    consider that the driver is unusable under SMP as-is, I think it is
    right to get correctness first.
    
    Specifically, this patch does the following:
    
    * Adds locking to proc queue-walking code for debugging use.  Note that
      the proc registration is still broken and I've left it that way since
      this stuff should probably migrate to driverfs anyway.
    
    * Moves interrupt enabling so queue lock is initialized before
      interrupts are enabled.  Otherwise if we get a quick interrupt we oops
      the machine.
    
    * Removes unconditional IRQ enabling in do_ida_request().  The block
      layer takes the spinlock with irq_save so if we're going to play this
      trick then we need to irq_restore.  For now, just eliminate the
      unlocked region.
    
    * Remove block queue stop/start logic since it can leave the queue
      stopped with no outstanding completions to start it again.  Plugging
      logic can come back but it should go hand-in-hand with a cleanup of
      the driver's request handling algorithm.  If nobody screams about this
      patch I'll go ahead and start making those improvments.
    c5e1bfd8
cpqarray.c 46.8 KB