"layered" block devices and deadlock problems

From: Andy Tai (lichengtai@yahoo.com)
Date: Thu Mar 07 2002 - 04:13:11 EST


Hi, I have been trying to write a kernel driver for a
"layered" block device, that is, a virtual device
which sits on top of actual physical devices and
redirects read/write requests to them. To avoid
problems in the interrupt context I save the requests
in a queue in the request function and have a kernel
thread pulling the requests out of the queue and then
in turn calling read() or write() functions of the
physical block device.

However, I keep running into deadlocks. Sometimes the
kernel thread will hang on waiting for free request
structures. Other times it will hang in
wait_for_buffer() in buffer.c. In both cases the
system won't respond to any new shell commands I typed
in. (But existing processes like xosview and top
continue to run) Since I am not familiar with the
internal workings of the buffer cache, can anyone give
me hints on how to avoid deadlocks in layered drivers?
 Or pointers to useful documentation for this kind of
tasks are also appreciated.

Thanks.

__________________________________________________
Do You Yahoo!?
Try FREE Yahoo! Mail - the world's greatest free email!
http://mail.yahoo.com/
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Thu Mar 07 2002 - 21:01:01 EST