[Ocfs2-devel] [PATCH 19/41] ocfs2: Integrate CoW in file write.

Joel Becker Joel.Becker at oracle.com
Fri Aug 21 16:42:10 PDT 2009


On Sat, Aug 22, 2009 at 07:17:55AM +0800, Tao Ma wrote:
> Joel Becker wrote:
> yes, that is anticipated. We CoW 1MB at most at a time.

	No!  We want to CoW the entire write_len at once!  That's why I
wrote cal_cow_cluters() the way I did!

> yes, we can put a check there, but we can't resolve the 1MB issue
> you mentioned above either. Maybe we can make ocfs2_refcount_cow
> more intelligent? But I would say let us leave it as-is and this can
> be a future improvement.

	If you make ocfs2_refcount_cow() into ocfs2_refcount_cow_hunk()
like I described in my email, make the your ocfs2_refcount_cluters()
into a new ocfs2_refcount_cow() like I described, then we can CoW the
entire write at once.

> oh, yes, this is really a bug. I don't think of O_DIRECT when I
> created this patch set. So I may really need to add a check in
> ocfs2_prepare_inode_for_write(I guess just need to call
> ocfs2_refcount_cow and make write_len<=1MB).

	No, you pass a write_len of the full I/O!  We don't want to
fragment the thing, and there's no reason to :-)

> This also make me think that we can cal ocfs2_refcount_cow right
> before we populate_write_desc, so that we don't need to call it
> twice and we can directly BUG_ON(ext_flags & REFCOUNTED) in it.

	With the new ocfs2_refcount_cow() that loops over the entire
write, absolutely.

Joel

-- 

"Every day I get up and look through the Forbes list of the richest
 people in America. If I'm not there, I go to work."
        - Robert Orben

Joel Becker
Principal Software Developer
Oracle
E-mail: joel.becker at oracle.com
Phone: (650) 506-8127



More information about the Ocfs2-devel mailing list