Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751610AbWE0P6L (ORCPT ); Sat, 27 May 2006 11:58:11 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751608AbWE0PwG (ORCPT ); Sat, 27 May 2006 11:52:06 -0400 Received: from smtp.ustc.edu.cn ([202.38.64.16]:16861 "HELO ustc.edu.cn") by vger.kernel.org with SMTP id S1751610AbWE0Pvm (ORCPT ); Sat, 27 May 2006 11:51:42 -0400 Message-ID: <348745099.16246@ustc.edu.cn> X-EYOUMAIL-SMTPAUTH: wfg@mail.ustc.edu.cn Message-Id: <20060527155140.035991503@localhost.localdomain> References: <20060527154849.927021763@localhost.localdomain> Date: Sat, 27 May 2006 23:49:16 +0800 From: Wu Fengguang To: Andrew Morton Cc: linux-kernel@vger.kernel.org, Wu Fengguang Subject: [PATCH 27/32] readahead: loop case Content-Disposition: inline; filename=readahead-loop-case.patch Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1138 Lines: 36 Disable look-ahead for loop file. Loopback files normally contain filesystems, in which case there are already proper look-aheads in the upper layer, more look-aheads on the loopback file only ruins the read-ahead hit rate. Signed-off-by: Wu Fengguang --- I'd like to thank Tero Grundstr?m for uncovering the loopback problem. drivers/block/loop.c | 6 ++++++ 1 files changed, 6 insertions(+) --- linux-2.6.17-rc4-mm3.orig/drivers/block/loop.c +++ linux-2.6.17-rc4-mm3/drivers/block/loop.c @@ -779,6 +779,12 @@ static int loop_set_fd(struct loop_devic mapping = file->f_mapping; inode = mapping->host; + /* + * The upper layer should already do proper look-ahead, + * one more look-ahead here only ruins the cache hit rate. + */ + file->f_ra.flags |= RA_FLAG_NO_LOOKAHEAD; + if (!(file->f_mode & FMODE_WRITE)) lo_flags |= LO_FLAGS_READ_ONLY; -- - 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/