Re: questions about block device access

From: Stephen C. Tweedie (sct@redhat.com)
Date: Tue Feb 22 2000 - 11:20:42 EST


Hi,

On Sun, 20 Feb 2000 20:11:23 +0800, a9504915 <a9504915@graduate.hku.hk>
said:

> Hello, I am writing a block device driver to redirect all I/O requests
> to a remote hard disk at another node. The remote hd seems "attached"
> locally. The process accessing the driver (i.e. the client) has to
> communicate with a remote server process through sockets.

There are several projects already under way for this. Nbd is already
in the main kernel tree. gnbd and drbd are works-in-progress.

> However, I found that if these two processes are running at the same
> node, i.e. the client sleeps in the request_fn of the virtual device,
> and waiting for the local server to complete and return the I/O
> results, all the processes seems dead (in uninterruptible sleeping
> mode), and the kernel dies eventually, coz' even the bdflush will
> "hang".

Yes, it will.

> I would like to ask whether there are any problems if one process is
> sleeping in the request_fn, but waiting for another process to access
> the hard disk.

Major deadlock opportunity. The process holding the request function
can block the other process from proceeding, because there are only a
finite number of requests available in the request table. So you have
the network-device-using process waiting for the server process to
access the hard disk, and the server process waiting for a free
request... instant deadlock.

--Stephen

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Wed Feb 23 2000 - 21:00:30 EST