From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753680Ab1DZJvY (ORCPT ); Tue, 26 Apr 2011 05:51:24 -0400 Received: from mga09.intel.com ([134.134.136.24]:46561 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753537Ab1DZJvH (ORCPT ); Tue, 26 Apr 2011 05:51:07 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.64,267,1301900400"; d="scan'208";a="634172778" Message-Id: <20110426094859.463438303@intel.com> User-Agent: quilt/0.48-1 Date: Tue, 26 Apr 2011 17:43:54 +0800 From: Wu Fengguang To: Andrew Morton To: Andi Kleen cc: Tim Chen , Andi Kleen , Wu Fengguang cc: Li Shaohua Cc: LKML cc: Linux Memory Management List Subject: [PATCH 2/3] readahead: reduce unnecessary mmap_miss increases References: <20110426094352.030753173@intel.com> Content-Disposition: inline; filename=readahead-reduce-mmap_miss-increases.patch Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Andi Kleen The original INT_MAX is too large, reduce it to - avoid unnecessarily dirtying/bouncing the cache line - restore mmap read-around faster on changed access pattern Tested-by: Tim Chen Signed-off-by: Andi Kleen Signed-off-by: Wu Fengguang --- mm/filemap.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) --- linux-next.orig/mm/filemap.c 2011-04-23 09:01:44.000000000 +0800 +++ linux-next/mm/filemap.c 2011-04-23 09:17:21.000000000 +0800 @@ -1538,7 +1538,8 @@ static void do_sync_mmap_readahead(struc return; } - if (ra->mmap_miss < INT_MAX) + /* Avoid banging the cache line if not needed */ + if (ra->mmap_miss < MMAP_LOTSAMISS * 10) ra->mmap_miss++; /* From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail202.messagelabs.com (mail202.messagelabs.com [216.82.254.227]) by kanga.kvack.org (Postfix) with SMTP id 24ED99000C2 for ; Tue, 26 Apr 2011 05:51:08 -0400 (EDT) Message-Id: <20110426094859.463438303@intel.com> Date: Tue, 26 Apr 2011 17:43:54 +0800 From: Wu Fengguang Subject: [PATCH 2/3] readahead: reduce unnecessary mmap_miss increases References: <20110426094352.030753173@intel.com> Content-Disposition: inline; filename=readahead-reduce-mmap_miss-increases.patch Sender: owner-linux-mm@kvack.org List-ID: To: Andrew Morton , Andi Kleen Cc: Tim Chen , Andi Kleen , Wu Fengguang , Li Shaohua , LKML , Linux Memory Management List From: Andi Kleen The original INT_MAX is too large, reduce it to - avoid unnecessarily dirtying/bouncing the cache line - restore mmap read-around faster on changed access pattern Tested-by: Tim Chen Signed-off-by: Andi Kleen Signed-off-by: Wu Fengguang --- mm/filemap.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) --- linux-next.orig/mm/filemap.c 2011-04-23 09:01:44.000000000 +0800 +++ linux-next/mm/filemap.c 2011-04-23 09:17:21.000000000 +0800 @@ -1538,7 +1538,8 @@ static void do_sync_mmap_readahead(struc return; } - if (ra->mmap_miss < INT_MAX) + /* Avoid banging the cache line if not needed */ + if (ra->mmap_miss < MMAP_LOTSAMISS * 10) ra->mmap_miss++; /* -- 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/ . Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/ Don't email: email@kvack.org