On Thu, Oct 21, 2010 at 07:46:15PM +0200, Jens Axboe wrote:> By the sound of things, if I were you I'd turn on the mem and slab> debugging to catch use-before-init and use-after-free. Mysterious hangs> in the IO sub system are usually caused by such bugs. And the regular> debugging aids, just to see if that produces anything of interest.

It looks like it was a use-after-free bug in my code. I'm running afull set of set of tests now, but so far, it's gotten a lot furtherthan it went before, so I think I've figured it out.

I'm not sure why it caused the weird behaviour that it did (I got asfar as figuring out that somehow we lost the unplug timer, so afterthe queue got plugged it never got unplugged), but I'm not going toask too many questions. :-)

Maybe later on I'll try to figure out if there's any way to add somekind of sanity checking so that screw ups in in the bio code's callercause a clearer failure (such as a BUG_ON), but that'll have to waitfor when I have some free time.