[Ocfs2-devel] [PATCH] Refactor ocfs2_insert_extent for not-merging.

Mark Fasheh mfasheh at suse.com
Wed Aug 13 19:04:22 PDT 2008


On Thu, Aug 14, 2008 at 09:13:54AM +0800, Tao Ma wrote:
> Mark Fasheh wrote:
> >On Thu, Aug 14, 2008 at 01:33:12AM +0800, Tao Ma wrote:
> >  
> >>From: taoma <taoma at tma-home.cn.oracle.com>
> >>
> >>Hi Mark,
> >>	Here is the patch we discussed this morning.
> >>
> >>In xattr bucket, we want to limit the maximum size of a btree leaf,
> >>otherwise we'll lose the benefits of hashing because we'll have to search
> >>large leaves.
> >>
> >>So add a new flag in ocfs2_extent_tree which will prevent 
> >>ocfs2_insert_extent
> >>from merging the leaf record even if they are contiguous.
> >>    
> >
> >Ok, this is close... The problem I see here though is that we've gone from
> >always merging when possible to *never* merging.
> >
> >What we want is "don't merge if the resulting extent is larger than a given
> >size".
> >  
> I leave this judgement to the caller itself(the flag) and I think the 
> caller should be responsible for telling ocfs2_insert_extent whether the 
> new added cluster should be merged or not.

Right.


> So if the caller say loudly that "please don't merge", we will not 
> merge.

Well, my point is it's better if the caller says (loudly) "don't exceed this
limit!"... That way, it doesn't have to look at the extents to the right and
left of the record being inserted and figure out whether a merge would be a
bad thing. Basically, it leaves the specifics of where extent records are to
the btree code...


> As for xattr extent tree, I have already judge the situation in 
> the caller(ocfs2_add_new_xattr_cluster), so it will not be a problem.

Ok, I didn't see that patch. Is it actually checking records on either side
of the insert?


> There is also another benefit. In future, other extent tree type may 
> have another type of things which will ask ocfs2_insert_extent to "not 
> merge", but not because of the leaf size. And we can also handle this.
> Make sense?

Yeah, I think we're about 90% in agreement. I also want this for future use
- indexed directories will need to do the same thing. I'd like them to just
just pass down a max size however, and never have to worry about the details
of extent merging.
	--Mark

--
Mark Fasheh



More information about the Ocfs2-devel mailing list