From mboxrd@z Thu Jan 1 00:00:00 1970 From: Olivier Galibert Subject: Re: [PATCH 10/11] readahead: dont do start-of-file readahead after lseek() Date: Tue, 2 Feb 2010 19:13:21 +0100 Message-ID: <20100202181321.GB75577@dspnet.fr.eu.org> References: <20100202152835.683907822@intel.com> <20100202153317.644170708@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Andrew Morton , Jens Axboe , Linus Torvalds , Peter Zijlstra , Linux Memory Management List , linux-fsdevel@vger.kernel.org, LKML To: Wu Fengguang Return-path: Content-Disposition: inline In-Reply-To: <20100202153317.644170708@intel.com> Sender: owner-linux-mm@kvack.org List-Id: linux-fsdevel.vger.kernel.org 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, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org