linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Reuse of BIOs
@ 2005-09-08 13:17 David Howells
  2005-09-08 13:19 ` Jens Axboe
  2005-09-08 13:32 ` Fawad Lateef
  0 siblings, 2 replies; 3+ messages in thread
From: David Howells @ 2005-09-08 13:17 UTC (permalink / raw)
  To: Jens Axboe; +Cc: linux-kernel, linux-fsdevel


Hi Jens,

Is it possible to reuse a BIO once the callback on it has been invoked to
indicate final completion? Or does it have to be released and another one
allocated?

David

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

* Re: Reuse of BIOs
  2005-09-08 13:17 Reuse of BIOs David Howells
@ 2005-09-08 13:19 ` Jens Axboe
  2005-09-08 13:32 ` Fawad Lateef
  1 sibling, 0 replies; 3+ messages in thread
From: Jens Axboe @ 2005-09-08 13:19 UTC (permalink / raw)
  To: David Howells; +Cc: linux-kernel, linux-fsdevel

On Thu, Sep 08 2005, David Howells wrote:
> 
> Hi Jens,
> 
> Is it possible to reuse a BIO once the callback on it has been invoked to
> indicate final completion? Or does it have to be released and another one
> allocated?

If you reuse it indefinitely, you violate the principles that make the
mempool work. So the answer is 'yes' if you only reuse it a little, 'no'
if you want to hang on to it forever.

-- 
Jens Axboe


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

* Re: Reuse of BIOs
  2005-09-08 13:17 Reuse of BIOs David Howells
  2005-09-08 13:19 ` Jens Axboe
@ 2005-09-08 13:32 ` Fawad Lateef
  1 sibling, 0 replies; 3+ messages in thread
From: Fawad Lateef @ 2005-09-08 13:32 UTC (permalink / raw)
  To: David Howells; +Cc: Jens Axboe, linux-kernel, linux-fsdevel

On 9/8/05, David Howells <dhowells@redhat.com> wrote:
> 
> 
> Is it possible to reuse a BIO once the callback on it has been invoked to
> indicate final completion? Or does it have to be released and another one
> allocated?
> 

The thing which I did in my virtual caching device driver is I keeps
the pointer of BIO got from the kernel in my locally created BIO's
private field (and fill other fields with the original BIO's Data) and
sends it to other caching device and when got the end_io for that BIO
(like in read from caching device and writing to target device) I put
that in the queue and one of my thread directly sends that to the
target device without changed except replacing the sector of caching
device to the target device sector and after getting completion signal
from target device, I just freed that BIO or move it to my free pool
of BIOs and just call the completion for the original BIO taken back
from the private field of local BIO ..........

This means we can reuse BIO sended to one device and then sending that
to other device after getting completion signal from first device
......... But I can't say this about the original kernel BIO b/c I m
not sending it to any of my devices !!!!

-- 
Fawad Lateef

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

end of thread, other threads:[~2005-09-08 13:32 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-09-08 13:17 Reuse of BIOs David Howells
2005-09-08 13:19 ` Jens Axboe
2005-09-08 13:32 ` Fawad Lateef

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).