Re: does the request function block

From: Peter T. Breuer (ptb@it.uc3m.es)
Date: Tue Aug 28 2001 - 13:28:30 EST


"Christian Widmer wrote:"
> does the request function of a bock device driver to be attomic or may it
> block? in the linux device driver 2 it says that it must be attomic and
> may not block. that makes sense to me since it also sais that the bottom-

It may not block - it's executed by the kernel in order to empty the
queue of requests for the device, and the kernel executes it with the
io lock held. So that's that. It can return without emptying the
queue, but that's another story. It must return immediately.

> half of the driver will call the request function too. but this is not realy
> nessesery when i remove all request before releasing the io_request_lock.

?? This seems to me to be orthogonal to to your question.

> on the other side block devices like nbd or brbd do send date using a socket
> in there request function.

No they don't. NBD moves the requests to an internal queue when the
request function is run. The function does not block. The internal
queue is later emptied by another means, in another context.

> who is right and why?

Well, since the hypothesis on which the question is based is mistaken,
it's hard to say!

Peter
-
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 : Fri Aug 31 2001 - 21:00:30 EST