> -----Original Message-----
> From: Stephen C. Tweedie [mailto:[EMAIL PROTECTED]]
> On Wed, 13 Oct 1999 09:55:39 -0400, Chris Mason
> <[EMAIL PROTECTED]> said:
>
> > All true. But shouldn't I be able to write function to reuse a
> buffer_head
> > for a different block without freeing it? I realize the buffer cache
> > doesn't have a call to do it now, but it seems like it should
> be possible.
>
> Sort of: you can definitely reuse the buffer data, but you almost
> certainly need a new buffer_head with which to label it when it goes to
> the log (ext3 tries to do that whenever possible). However, there is
> still a tradeoff: if you have the buffers shared, then no new
> transaction can modify the buffer contents while a commit occurs. If
> you allow copy-on-write so that the commit can proceed while a new
> transaction dirties the buffer, then once again you are requiring extra
> memory allocation during the commit.
>
Sorry, I don't think I'm explaining my intentions well. Since I'm not sure
it could work, and the reserved memory ideas solve the problem better (what
I'm think of will be very slow), I'll move on to other things ;-)
> However, the other part of the equation: the fact that you don't know in
> advance how large a running transaction will become, and that its
> buffers are pinned until the transaction completes and starts to commit
> --- is much harder to work around.
>
The best we have is an upper bound, and the lack of transaction handles
makes mine less accurate. Once I'm stable in 2.3, I'll probably add the
handles...they will make a reserved memory setup easier to use.
-chris