Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id ; Wed, 11 Sep 2002 14:59:22 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id ; Wed, 11 Sep 2002 14:59:22 -0400 Received: from louise.pinerecords.com ([212.71.160.16]:14853 "EHLO louise.pinerecords.com") by vger.kernel.org with ESMTP id ; Wed, 11 Sep 2002 14:59:20 -0400 Date: Wed, 11 Sep 2002 21:03:37 +0200 From: Tomas Szepe To: Rik van Riel Cc: Xuan Baldauf , linux-kernel@vger.kernel.org, Reiserfs List Subject: Re: Heuristic readahead for filesystems Message-ID: <20020911190337.GG14900@louise.pinerecords.com> References: <3D7F647B.1E0707FB@baldauf.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4i X-OS: GNU/Linux 2.4.20-pre1/sparc SMP X-Uptime: 16 days, 22:08 Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1441 Lines: 34 > > I wonder wether Linux implements a kind of heuristic > > readahead for filesystems: > > > If an application did a stat()..open()..read() sequence on a > > file, it is likely that, after the next stat(), it will open > > and read the mentioned file. Thus, one could readahead the > > start of a file on stat() of that file. > > > Example: See this diff strace: > > Your observation is right, but I'm not sure how much it will > matter if we start reading the file at stat() time or at > read() time. > > This is because one disk seek takes about 10 million CPU > cycles on modern systems and we'll have completed the stat(), > open() and started the read() before the disk arm has started > moving ;) Please correct me if I'm missing something: I tend to assume that if the cost of the disk seek is known to be a relatively huge value, a fraction of it could be used as a timeout for disk read request reordering with performance not deteriorating (except for the heuristics overhead of course). I.e., if some code in the block layer were able to detect a lot of "parallel yet sequential" reads were going on, the amount of seeks could be minimized for the price of the final timeout. T. - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/