On Wed, 26 Jul 2000, Alexander Viro wrote:
> On Wed, 26 Jul 2000, Daniel Phillips wrote:
> 
> > Stephen asked me some sharp questions about how this would work,
> > and after I answered them to his satisfaction he asked me if I 
> > would have time to implement this feature.  I said yes, and went 
> > on to write an initial design document describing the required
> > modifications to Ext's handling of inodes, and a prototype
> > algorithm for doing the tail merging.
> 
> Here is one more for you:
>       Suppose we grow the last fragment/tail/whatever. Do you copy the
> data out of that shared block? If so, how do you update buffer_heads in
> pages that cover the relocated data? (Same goes for reiserfs, if they are
> doing something similar). BTW, our implementation of UFS is fucked up in
> that respect, so variant from there will not work.

Please bear in mind that I don't pretend to be an expert on the VFS, and
especially its latest incarnation in 2.4.0.  I'm coming to grips with it now. 
Notwithstanding that, I'll try to provide some insight anyway.

>       Suppose we grow the last fragment/tail/whatever. Do you copy the
> data out of that shared block? 

Yes, except possibly in the case where the fragment grows by an amount will that
will still fit in the shared block.  Even in that case, you might want to
ignore the possible optimization and copy it out mindlessly, on the assumption
that another write is coming soon.  My plan is to do the incremental merging at
file close time.

> If so, how do you update buffer_heads in
> pages that cover the relocated data? 

We have to be sure that if blocks are buffered then they are buffered in
exactly one place and you always access them through through the buffer hash
table.  So far so good, but the picture gets murkier for me when you talk
about the page cache.  I'm not clear yet on the details of how the buffer cache
interacts with the page cache, and perhaps you can help shed some light on
that.  Until I am clear on it, I'll hold off commenting.

> (Same goes for reiserfs, if they are doing something similar).

I don't know exactly what ReiserFS does - I just heard Hans mention the term
'tail merging' and I could see that it was a good idea.

> BTW, our implementation of UFS is fucked up in  that respect, so variant
> from there will not work.

I'm not sure what you mean there...

-- 
Daniel

Reply via email to