linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* does the request function block
@ 2001-08-28 18:13 Christian Widmer
  2001-08-28 18:28 ` Peter T. Breuer
  0 siblings, 1 reply; 3+ messages in thread
From: Christian Widmer @ 2001-08-28 18:13 UTC (permalink / raw)
  To: linux-kernel

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-
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.
on the other side block devices like nbd or brbd do send date using a socket
in there request function.

who is right and why?

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: does the request function block
  2001-08-28 18:13 does the request function block Christian Widmer
@ 2001-08-28 18:28 ` Peter T. Breuer
  2001-08-28 19:15   ` Christian Widmer
  0 siblings, 1 reply; 3+ messages in thread
From: Peter T. Breuer @ 2001-08-28 18:28 UTC (permalink / raw)
  To: cwidmer; +Cc: linux kernel

"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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: does the request function block
  2001-08-28 18:28 ` Peter T. Breuer
@ 2001-08-28 19:15   ` Christian Widmer
  0 siblings, 0 replies; 3+ messages in thread
From: Christian Widmer @ 2001-08-28 19:15 UTC (permalink / raw)
  To: ptb; +Cc: linux kernel

On Tuesday 28 August 2001 20:28, you wrote:
> 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.

ok - does 
	result = sock_sendmsg(sock, &msg, size);
block? something in the back of my brains sais yes, but i might be
wrong since i'm new to linux kernel programing. if it does block 
nbd blocks. it realeases the io_request_lock lock and calls 
nbd_send_req which calls nbd_xmit and that results in a call to 
sock_sendmst.

in the documention ob the brbd it sais: that the request function 
is allways called in the context of a process doing I/O the kflushd
or the kupdate kernel thread.





^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2001-08-28 19:16 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-08-28 18:13 does the request function block Christian Widmer
2001-08-28 18:28 ` Peter T. Breuer
2001-08-28 19:15   ` Christian Widmer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).