Subject: Re: Page daemon behavior part N
To: Charles M. Hannum <root@ihack.net>
From: Chuck Silvers <chuq@chuq.com>
List: tech-kern
Date: 01/26/2001 04:44:48
On Thu, Jan 25, 2001 at 11:26:02AM -0800, Jason R Thorpe wrote:
> There is definitely a problem with the async flushing in the file
> system write calls, tho.
> 
> If you look at ufs_readwrite.c:300, there is a block of code that cleans
> the object.  If sync I/O, we sync each UBC_WINSIZE block in the loop.  If
> async I/O, it only starts a clean if you've *crossed* a 64k boundary in
> the file.
> 
> Seems like we should move the clean block outside the loop, remembering
> the original offset, and then cleaning the entire range.  That may allow
> us to build larger clusters for larger writes, and also reduce the number
> of sync I/Os for larger sync writes.

we'd also like to be able to do write clustering for small writes such as
those produced by stdio.  if we do an async flush for each write syscall,
we'll end up doing a disk write for each syscall, which will perform
pretty badly.

one thing we could do instead that might help is to kick off an async
flush when a vnode goes inactive.  that could help out in cases like
creating a bunch of small files.  I haven't tried it yet though.

-Chuck