From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752615Ab0KIGQ1 (ORCPT ); Tue, 9 Nov 2010 01:16:27 -0500 Received: from fgwmail5.fujitsu.co.jp ([192.51.44.35]:40564 "EHLO fgwmail5.fujitsu.co.jp" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752218Ab0KIGQ0 (ORCPT ); Tue, 9 Nov 2010 01:16:26 -0500 X-SecurityPolicyCheck-FJ: OK by FujitsuOutboundMailChecker v1.3.1 From: KOSAKI Motohiro To: Andrea Arcangeli Subject: Re: [PATCH 64 of 66] scale nr_rotated to balance memory pressure Cc: kosaki.motohiro@jp.fujitsu.com, linux-mm@kvack.org, Linus Torvalds , Andrew Morton , linux-kernel@vger.kernel.org, Marcelo Tosatti , Adam Litke , Avi Kivity , Hugh Dickins , Rik van Riel , Mel Gorman , Dave Hansen , Benjamin Herrenschmidt , Ingo Molnar , Mike Travis , KAMEZAWA Hiroyuki , Christoph Lameter , Chris Wright , bpicco@redhat.com, Balbir Singh , "Michael S. Tsirkin" , Peter Zijlstra , Johannes Weiner , Daisuke Nishimura , Chris Mason , Borislav Petkov In-Reply-To: <54b5b2d012ff38e341ad.1288798119@v2.random> References: <54b5b2d012ff38e341ad.1288798119@v2.random> Message-Id: <20101109151605.BC78.A69D9226@jp.fujitsu.com> MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit X-Mailer: Becky! ver. 2.50.07 [ja] Date: Tue, 9 Nov 2010 15:16:21 +0900 (JST) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > From: Rik van Riel > > Make sure we scale up nr_rotated when we encounter a referenced > transparent huge page. This ensures pageout scanning balance > is not distorted when there are huge pages on the LRU. > > Signed-off-by: Rik van Riel > Signed-off-by: Andrea Arcangeli > --- > > diff --git a/mm/vmscan.c b/mm/vmscan.c > --- a/mm/vmscan.c > +++ b/mm/vmscan.c > @@ -1259,7 +1259,8 @@ putback_lru_pages(struct zone *zone, str > add_page_to_lru_list(zone, page, lru); > if (is_active_lru(lru)) { > int file = is_file_lru(lru); > - reclaim_stat->recent_rotated[file]++; > + int numpages = hpage_nr_pages(page); > + reclaim_stat->recent_rotated[file] += numpages; > } > if (!pagevec_add(&pvec, page)) { > spin_unlock_irq(&zone->lru_lock); I haven't seen this patch series carefully yet. So, probably my question is dumb. Why don't we need to change ->recent_scanned[] too? > @@ -1535,7 +1536,7 @@ static void shrink_active_list(unsigned > } > > if (page_referenced(page, 0, sc->mem_cgroup, &vm_flags)) { > - nr_rotated++; > + nr_rotated += hpage_nr_pages(page); > /* > * Identify referenced, file-backed active pages and > * give them one more trip around the active list. So From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail143.messagelabs.com (mail143.messagelabs.com [216.82.254.35]) by kanga.kvack.org (Postfix) with SMTP id 39FB08D0005 for ; Tue, 9 Nov 2010 01:16:28 -0500 (EST) Received: from m5.gw.fujitsu.co.jp ([10.0.50.75]) by fgwmail6.fujitsu.co.jp (Fujitsu Gateway) with ESMTP id oA96GOue007065 for (envelope-from kosaki.motohiro@jp.fujitsu.com); Tue, 9 Nov 2010 15:16:24 +0900 Received: from smail (m5 [127.0.0.1]) by outgoing.m5.gw.fujitsu.co.jp (Postfix) with ESMTP id 0C22245DE4E for ; Tue, 9 Nov 2010 15:16:24 +0900 (JST) Received: from s5.gw.fujitsu.co.jp (s5.gw.fujitsu.co.jp [10.0.50.95]) by m5.gw.fujitsu.co.jp (Postfix) with ESMTP id E056845DE4F for ; Tue, 9 Nov 2010 15:16:23 +0900 (JST) Received: from s5.gw.fujitsu.co.jp (localhost.localdomain [127.0.0.1]) by s5.gw.fujitsu.co.jp (Postfix) with ESMTP id CB1EF1DB8043 for ; Tue, 9 Nov 2010 15:16:23 +0900 (JST) Received: from m105.s.css.fujitsu.com (m105.s.css.fujitsu.com [10.249.87.105]) by s5.gw.fujitsu.co.jp (Postfix) with ESMTP id 841621DB8038 for ; Tue, 9 Nov 2010 15:16:23 +0900 (JST) From: KOSAKI Motohiro Subject: Re: [PATCH 64 of 66] scale nr_rotated to balance memory pressure In-Reply-To: <54b5b2d012ff38e341ad.1288798119@v2.random> References: <54b5b2d012ff38e341ad.1288798119@v2.random> Message-Id: <20101109151605.BC78.A69D9226@jp.fujitsu.com> MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Date: Tue, 9 Nov 2010 15:16:21 +0900 (JST) Sender: owner-linux-mm@kvack.org To: Andrea Arcangeli Cc: kosaki.motohiro@jp.fujitsu.com, linux-mm@kvack.org, Linus Torvalds , Andrew Morton , linux-kernel@vger.kernel.org, Marcelo Tosatti , Adam Litke , Avi Kivity , Hugh Dickins , Rik van Riel , Mel Gorman , Dave Hansen , Benjamin Herrenschmidt , Ingo Molnar , Mike Travis , KAMEZAWA Hiroyuki , Christoph Lameter , Chris Wright , bpicco@redhat.com, Balbir Singh , "Michael S. Tsirkin" , Peter Zijlstra , Johannes Weiner , Daisuke Nishimura , Chris Mason , Borislav Petkov List-ID: > From: Rik van Riel > > Make sure we scale up nr_rotated when we encounter a referenced > transparent huge page. This ensures pageout scanning balance > is not distorted when there are huge pages on the LRU. > > Signed-off-by: Rik van Riel > Signed-off-by: Andrea Arcangeli > --- > > diff --git a/mm/vmscan.c b/mm/vmscan.c > --- a/mm/vmscan.c > +++ b/mm/vmscan.c > @@ -1259,7 +1259,8 @@ putback_lru_pages(struct zone *zone, str > add_page_to_lru_list(zone, page, lru); > if (is_active_lru(lru)) { > int file = is_file_lru(lru); > - reclaim_stat->recent_rotated[file]++; > + int numpages = hpage_nr_pages(page); > + reclaim_stat->recent_rotated[file] += numpages; > } > if (!pagevec_add(&pvec, page)) { > spin_unlock_irq(&zone->lru_lock); I haven't seen this patch series carefully yet. So, probably my question is dumb. Why don't we need to change ->recent_scanned[] too? > @@ -1535,7 +1536,7 @@ static void shrink_active_list(unsigned > } > > if (page_referenced(page, 0, sc->mem_cgroup, &vm_flags)) { > - nr_rotated++; > + nr_rotated += hpage_nr_pages(page); > /* > * Identify referenced, file-backed active pages and > * give them one more trip around the active list. So -- 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 policy in Canada: sign http://dissolvethecrtc.ca/ Don't email: email@kvack.org