From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753408Ab3DKF6q (ORCPT ); Thu, 11 Apr 2013 01:58:46 -0400 Received: from mail-ia0-f173.google.com ([209.85.210.173]:60031 "EHLO mail-ia0-f173.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753018Ab3DKF6p (ORCPT ); Thu, 11 Apr 2013 01:58:45 -0400 Message-ID: <5166510E.2050709@gmail.com> Date: Thu, 11 Apr 2013 13:58:38 +0800 From: Will Huck User-Agent: Mozilla/5.0 (X11; Linux i686; rv:17.0) Gecko/20130308 Thunderbird/17.0.4 MIME-Version: 1.0 To: Rik van Riel CC: Johannes Weiner , Mel Gorman , Linux-MM , Jiri Slaby , Valdis Kletnieks , Zlatko Calusic , dormando , Satoru Moriya , Michal Hocko , LKML Subject: Re: [PATCH 01/10] mm: vmscan: Limit the number of pages kswapd reclaims at each priority References: <1363525456-10448-1-git-send-email-mgorman@suse.de> <1363525456-10448-2-git-send-email-mgorman@suse.de> <20130321155705.GA27848@cmpxchg.org> <514BA04D.2090002@gmail.com> <514BD56F.6050709@redhat.com> In-Reply-To: <514BD56F.6050709@redhat.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Rik, On 03/22/2013 11:52 AM, Rik van Riel wrote: > On 03/21/2013 08:05 PM, Will Huck wrote: > >> One offline question, how to understand this in function balance_pgdat: >> /* >> * Do some background aging of the anon list, to give >> * pages a chance to be referenced before reclaiming. >> */ >> age_acitve_anon(zone, &sc); > > The anon lrus use a two-handed clock algorithm. New anonymous pages > start off on the active anon list. Older anonymous pages get moved > to the inactive anon list. The downside of page cache use-once replacement algorithm is inter-reference distance, corret? Does it have any other downside? What's the downside of two-handed clock algorithm against anonymous pages? > > If they get referenced before they reach the end of the inactive anon > list, they get moved back to the active list. > > If we need to swap something out and find a non-referenced page at the > end of the inactive anon list, we will swap it out. > > In order to make good pageout decisions, pages need to stay on the > inactive anon list for a longer time, so they have plenty of time to > get referenced, before the reclaim code looks at them. > > To achieve that, we will move some active anon pages to the inactive > anon list even when we do not want to swap anything out - as long as > the inactive anon list is below its target size. > > Does that make sense? > From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from psmtp.com (na3sys010amx203.postini.com [74.125.245.203]) by kanga.kvack.org (Postfix) with SMTP id 75A536B0005 for ; Thu, 11 Apr 2013 01:58:45 -0400 (EDT) Received: by mail-ie0-f171.google.com with SMTP id e14so1597888iej.30 for ; Wed, 10 Apr 2013 22:58:44 -0700 (PDT) Message-ID: <5166510E.2050709@gmail.com> Date: Thu, 11 Apr 2013 13:58:38 +0800 From: Will Huck MIME-Version: 1.0 Subject: Re: [PATCH 01/10] mm: vmscan: Limit the number of pages kswapd reclaims at each priority References: <1363525456-10448-1-git-send-email-mgorman@suse.de> <1363525456-10448-2-git-send-email-mgorman@suse.de> <20130321155705.GA27848@cmpxchg.org> <514BA04D.2090002@gmail.com> <514BD56F.6050709@redhat.com> In-Reply-To: <514BD56F.6050709@redhat.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Sender: owner-linux-mm@kvack.org List-ID: To: Rik van Riel Cc: Johannes Weiner , Mel Gorman , Linux-MM , Jiri Slaby , Valdis Kletnieks , Zlatko Calusic , dormando , Satoru Moriya , Michal Hocko , LKML Hi Rik, On 03/22/2013 11:52 AM, Rik van Riel wrote: > On 03/21/2013 08:05 PM, Will Huck wrote: > >> One offline question, how to understand this in function balance_pgdat: >> /* >> * Do some background aging of the anon list, to give >> * pages a chance to be referenced before reclaiming. >> */ >> age_acitve_anon(zone, &sc); > > The anon lrus use a two-handed clock algorithm. New anonymous pages > start off on the active anon list. Older anonymous pages get moved > to the inactive anon list. The downside of page cache use-once replacement algorithm is inter-reference distance, corret? Does it have any other downside? What's the downside of two-handed clock algorithm against anonymous pages? > > If they get referenced before they reach the end of the inactive anon > list, they get moved back to the active list. > > If we need to swap something out and find a non-referenced page at the > end of the inactive anon list, we will swap it out. > > In order to make good pageout decisions, pages need to stay on the > inactive anon list for a longer time, so they have plenty of time to > get referenced, before the reclaim code looks at them. > > To achieve that, we will move some active anon pages to the inactive > anon list even when we do not want to swap anything out - as long as > the inactive anon list is below its target size. > > Does that make sense? > -- 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