Re: [patch] raw1394: fix locking in the presence of SMP and interrupts

From: Dan Dennedy
Date: Sun Oct 09 2005 - 13:10:55 EST


On Wednesday 05 October 2005 09:35 am, Andy Wingo wrote:
> In raw1394.c:handle_iso_listen(), don't grab host_info_lock at all --
> we're not accessing host_info_list or host_count, and holding this lock
> while trying to tasklet_kill the iso tasklet this can cause an ABBA
> deadlock if ohci:dma_rcv_tasklet is running and tries to grab
> host_info_lock in raw1394.c:receive_iso. Test program attached reliably
> deadlocks all SMP machines I have been able to test without this patch.

I have to admit being surprised to see this because I have been using an SMP
machine for a few years and not noticed a consistent or reproducible problem
here. However, I have to admit the majority of my isochronous usage on kernel
2.6 has been using the new API and implementation (aka rawiso and
libiec61883). So, I tested your program on my dual Athlon running a 2.6.12
SMP kernel, and it worked fine a few times when run manually. Then, I put it
into a shell loop:
I="0"; while [ $I -lt 1000 ]; do ./raw1394reader_nothreads; \
echo ran iteration $I; I=`expr $I + 1`; done

Eventually, it did deadlock. So, I applied the patch, and the above looping
test ran fine 3 times.Works for me.
-
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/