Re: AS spin lock bugs

From: Nick Piggin
Date: Thu Nov 13 2003 - 05:56:27 EST




Jens Axboe wrote:

Hi,

Was looking at io tracking for cfq, and I think I found some spin lock
bugs in current as (current BK). as_update_iohist() runs from
add_request which is typically in process context. It could be run with
interrupts disabled though, either driver private stuff or using the
generic block layer tagging.

Anyways, as_update_iohist() grabs aic->lock without disabling
interrupts, while as_completed_request() typically runs at interrupt
time and grabs the same lock. Deadlock.

To be safe, both need to use the flags saving lock variants.


Hi Jens,
I was hoping everything ran under the queue lock which should always
have interrupts off on the local CPU. The lock in question is to prevent
a as_completed_request on one queue from racing with as_update_iohist
on another. Each would be on a different CPU.

Maybe I'm wrong, did you actually see misbehaviour?


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