Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756550Ab0BBSNX (ORCPT ); Tue, 2 Feb 2010 13:13:23 -0500 Received: from alt.dspnet.fr.eu.org ([213.186.44.138]:4473 "EHLO dspnet.fr.eu.org" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1756476Ab0BBSNW (ORCPT ); Tue, 2 Feb 2010 13:13:22 -0500 Date: Tue, 2 Feb 2010 19:13:21 +0100 From: Olivier Galibert To: Wu Fengguang Cc: Andrew Morton , Jens Axboe , Linus Torvalds , Peter Zijlstra , Linux Memory Management List , linux-fsdevel@vger.kernel.org, LKML Subject: Re: [PATCH 10/11] readahead: dont do start-of-file readahead after lseek() Message-ID: <20100202181321.GB75577@dspnet.fr.eu.org> Mail-Followup-To: Olivier Galibert , Wu Fengguang , Andrew Morton , Jens Axboe , Linus Torvalds , Peter Zijlstra , Linux Memory Management List , linux-fsdevel@vger.kernel.org, LKML References: <20100202152835.683907822@intel.com> <20100202153317.644170708@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20100202153317.644170708@intel.com> User-Agent: Mutt/1.4.2.3i Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 818 Lines: 23 On Tue, Feb 02, 2010 at 11:28:45PM +0800, Wu Fengguang wrote: > Some applications (eg. blkid, id3tool etc.) seek around the file > to get information. For example, blkid does > seek to 0 > read 1024 > seek to 1536 > read 16384 > > The start-of-file readahead heuristic is wrong for them, whose > access pattern can be identified by lseek() calls. > > So test-and-set a READAHEAD_LSEEK flag on lseek() and don't > do start-of-file readahead on seeing it. Proposed by Linus. Wouldn't that trigger on lseeks to end of file to get the size? OG. -- 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/