From mboxrd@z Thu Jan 1 00:00:00 1970 From: Phillip Susi Subject: Re: readahead on directories Date: Wed, 21 Apr 2010 16:13:59 -0400 Message-ID: <4BCF5C87.8060509@cfl.rr.com> References: <4BCC7C05.8000803@cfl.rr.com> <20100421004434.GA27420@shareable.org> <4BCF123C.6010400@cfl.rr.com> <20100421161211.GC27575@shareable.org> <20100421183853.GA14897@ioremap.net> <20100421185124.GM27575@shareable.org> <4BCF509E.2040903@cfl.rr.com> <20100421200104.GT27575@shareable.org> Mime-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7bit Cc: Evgeniy Polyakov , linux-fsdevel@vger.kernel.org, Linux-kernel To: Jamie Lokier Return-path: In-Reply-To: <20100421200104.GT27575@shareable.org> Sender: linux-kernel-owner@vger.kernel.org List-Id: linux-fsdevel.vger.kernel.org On 4/21/2010 4:01 PM, Jamie Lokier wrote: > Ok, this discussion has got a bit confused. Text above refers to > needing to asynchronously read next block in a directory, but if they > are small then that's not important. It is very much important since if you ready each small directory one block at a time, it is very slow. You want to queue up reads to all of them at once so they can be batched. > FIEMAP suggestion is only if you think you need to issue reads for > multiple blocks in the _same_ directory in parallel. From what you say, > I doubt that's important. That may be why you suggested it, but it is also exactly what readahead() does. It also queues the read asynchronously which is what I really want so that I can queue more reads on other directories in one big batch. > That was my first suggestion: threads with readdir(); I thought it had > been rejected hence the further discussion. Yes, it was sort of rejected, which is why I said it's just a workaround for now until readahead() works on directories. It will produce the desired IO pattern but at the expense of ram and cpu cycles creating a bunch of short lived threads that go to sleep almost immediately after being created, and exit when they wake up. readahead() would be much more efficient.