Subject: LFS ioflush & fdatasync() optimizations
To: None <tech-kern@netbsd.org>
From: Anil Gopinath <anil_public@yahoo.com>
List: tech-kern
Date: 04/02/2007 23:41:54
Folks,

I was trying to figure out why, on LFS, ioflush and
fdatasync() are taking more time to complete than
expected and eating up more CPU. 

I was able to narrow down the highest hit operation to
this call in lfs_segment.c

int
lfs_writefile(struct lfs *fs, struct segment *sp,
struct vnode *vp)
{
<snip>
error = VOP_PUTPAGES(vp, 0, 0,
					 PGO_CLEANIT | PGO_ALLPAGES | PGO_LOCKED);
<snip>
}

During fdatasync() operation, the most time is spent
in this function when it is being called by: 

int
lfs_segwrite(struct mount *mp, int flags)
{
<snip>
error = lfs_writevnodes(fs, mp, sp, VN_DIROP);
<snip>
}

1. Is there a way to make sure that
lfs_writevnodes(fs, mp, sp, VN_DIROP); is called less
often during ioflush and fdatasync()?

2. Even when it is called what would be the best way
to make sure that VOP_PUTPAGES(vp, 0, 0, PGO_CLEANIT |
PGO_ALLPAGES | PGO_LOCKED) is called less often?

I am using NetBSD 4.0 on an amd64 machine with disk
write cache turned off. When the write cache is turned
on, the writes complete faster and the inefficiency is
not easily observable.

Thanks,
Anil






 
____________________________________________________________________________________
It's here! Your new message!  
Get new email alerts with the free Yahoo! Toolbar.
http://tools.search.yahoo.com/toolbar/features/mail/