[CentOS] Page cache flushing algorithm question

Mark Hull-Richter

mhullrich at gmail.com
Tue Apr 3 23:48:37 UTC 2007


I have been studying this for the last several days, and the one thing that
leaps out at me is that the page cache always flushes one page at a time.
Always.

To some extent, there is justification for this - what has to happen for
each page that gets flushed depends in part on what file system is being
written to and whether or not there is a function for that file system to
handle the pages.

However, as far as I can tell, if the mapping data for a page does not exist
(mapping->a_ops->writepage == NULL), it is handed to mpage_writepage() for
buffer management and i/o submission, whereas almost all of the file systems
that do map this function map it to block_write_full_page.  These two
functions use completely different algorithms for flushing a page from the
cache, or at least it sure looks that way.  (This figures, because if the
file system didn't buffer the pages, the kernel has to do it, whereas if the
file system did, the flush is much simpler.)  (The only ones that don't use
block_write_full_page are reiserfs, which does some interesting things with
small files, and the networked file systems, which don't write to a disk
file per se.)

My question is, is it feasible to tweak these functions so that it becomes
possible to flush multiple pages at one time (with one function), or is that
too large/complex a change to be worth the effort (which would be
considerable)?

This might be OT since it is a kernel question, but what the heck....  :-)

Thanks.

Mark Hull-Richter, Linux Kernel Engineer
DATAllegro (www.datallegro.com)
85 Enterprise, Second Floor, Aliso Viejo, CA  92656
949-680-3082 - Office     949-330-7691 - fax
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.centos.org/pipermail/centos/attachments/20070403/fd59f1c2/attachment.html>


More information about the CentOS mailing list