unified page and buffer cache? (was: readahead on directories)

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Phillip Susi
Date: Friday, May 7, 2010 - 6:38 am

I thought that the buffer and page caches were unified long ago, but
last night I modified ureadahead to call readahead() directly on the
block device for all physical extents involved rather than open() each
file and readahead() on that.  It read all of the related blocks into
the buffer cache nice and fast, which was then ignored and the data was
read again when accessed normally during boot.

So it seems that the buffer cache and page cache are still separate, and
normal files only use the page cache, and directories only use the
buffer cache, which is why readahead() fails when called on a directory.

Can anyone confirm that my disappointed understanding is correct?  I
started experimenting with a workaround where I readahead directories
via the block device, and normal files the normal way.  This seems to do
the trick, but is sub optimal since you have to read in two passes,
picking up the directories on the first pass, then going back for the files.
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
readahead on directories, Phillip Susi, (Mon Apr 19, 8:51 am)
Re: readahead on directories, Jamie Lokier, (Tue Apr 20, 5:44 pm)
Re: readahead on directories, Phillip Susi, (Wed Apr 21, 7:57 am)
Re: readahead on directories, Jamie Lokier, (Wed Apr 21, 9:12 am)
Re: readahead on directories, Phillip Susi, (Wed Apr 21, 11:10 am)
Re: readahead on directories, Evgeniy Polyakov, (Wed Apr 21, 11:38 am)
Re: readahead on directories, Jamie Lokier, (Wed Apr 21, 11:51 am)
Re: readahead on directories, Evgeniy Polyakov, (Wed Apr 21, 11:56 am)
Re: readahead on directories, Phillip Susi, (Wed Apr 21, 12:23 pm)
Re: readahead on directories, Jamie Lokier, (Wed Apr 21, 1:01 pm)
Re: readahead on directories, Jamie Lokier, (Wed Apr 21, 1:02 pm)
Re: readahead on directories, Phillip Susi, (Wed Apr 21, 1:13 pm)
Re: readahead on directories, Evgeniy Polyakov, (Wed Apr 21, 1:21 pm)
Re: readahead on directories, Jamie Lokier, (Wed Apr 21, 1:22 pm)
Re: readahead on directories, Jamie Lokier, (Wed Apr 21, 1:37 pm)
Re: readahead on directories, Jamie Lokier, (Wed Apr 21, 1:39 pm)
Re: readahead on directories, Phillip Susi, (Wed Apr 21, 1:59 pm)
Re: readahead on directories, Jamie Lokier, (Wed Apr 21, 3:06 pm)
Re: readahead on directories, Brad Boyer, (Thu Apr 22, 12:01 am)
Re: readahead on directories, Phillip Susi, (Thu Apr 22, 7:26 am)
Re: readahead on directories, Jamie Lokier, (Thu Apr 22, 10:53 am)
Re: readahead on directories, Phillip Susi, (Thu Apr 22, 12:23 pm)
Re: readahead on directories, Jamie Lokier, (Thu Apr 22, 1:35 pm)
Re: readahead on directories, Phillip Susi, (Thu Apr 22, 2:22 pm)
Re: readahead on directories, Jamie Lokier, (Thu Apr 22, 3:43 pm)
Re: readahead on directories, Phillip Susi, (Thu Apr 22, 9:13 pm)
unified page and buffer cache? (was: readahead on directories), Phillip Susi, (Fri May 7, 6:38 am)
Re: unified page and buffer cache?, Matthew Wilcox, (Fri May 7, 11:30 am)
Re: unified page and buffer cache?, tytso, (Fri May 7, 5:46 pm)
Re: unified page and buffer cache?, Phillip Susi, (Fri May 7, 5:50 pm)
Re: unified page and buffer cache?, Phillip Susi, (Fri May 7, 5:54 pm)
Re: unified page and buffer cache?, tytso, (Sat May 8, 5:52 am)