[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20100421183853.GA14897@ioremap.net>
Date: Wed, 21 Apr 2010 22:38:53 +0400
From: Evgeniy Polyakov <zbr@...emap.net>
To: Jamie Lokier <jamie@...reable.org>
Cc: Phillip Susi <psusi@....rr.com>, linux-fsdevel@...r.kernel.org,
Linux-kernel <linux-kernel@...r.kernel.org>
Subject: Re: readahead on directories
On Wed, Apr 21, 2010 at 05:12:11PM +0100, Jamie Lokier (jamie@...reable.org) wrote:
> A quick skim of fs/{ext3,ext4}/dir.c finds a call to
> page_cache_sync_readahead. Doesn't that do any reading ahead? :-)
It goes down to fs callbacks of data reading, which is not appliable to
directories.
To implement directory 'readahead' we use separated thread to call
readdir(). It is damn slow indeed, but it can populate cache in advance
of actual data reading. As a higher level crunch there is a 'find'
running in background.
> > I don't actually care to have the contents of the
> > directories returned, so readdir() does more than I need in that
> > respect, and also it performs a blocking read of one disk block at a
> > time, which is horribly slow with a cold cache.
>
> I/O is the probably the biggest cost, so it's more important to get
> the I/O pattern you want than worrying about return values you'll discard.
>
> If readdir() calls are slowed by lots of calls and libc, consider
> using the getdirentries system call directly.
it is not about readdir(). Plain read() is synchronous too. But
filesystem can respond to readahead calls and read next block to current
one, while it won't do this for next direntry.
--
Evgeniy Polyakov
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists