From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1764568AbYFGB32 (ORCPT ); Fri, 6 Jun 2008 21:29:28 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1760905AbYFGBKL (ORCPT ); Fri, 6 Jun 2008 21:10:11 -0400 Received: from mx1.redhat.com ([66.187.233.31]:51655 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1760695AbYFGBKJ (ORCPT ); Fri, 6 Jun 2008 21:10:09 -0400 Date: Fri, 6 Jun 2008 21:08:58 -0400 From: Rik van Riel To: Andrew Morton Cc: linux-kernel@vger.kernel.org, lee.schermerhorn@hp.com, kosaki.motohiro@jp.fujitsu.com, mbligh@mbligh.org Subject: Re: [PATCH -mm 09/25] fix pagecache reclaim referenced bit check Message-ID: <20080606210858.32fd6f48@bree.surriel.com> In-Reply-To: <20080606180451.31f01e70.akpm@linux-foundation.org> References: <20080606202838.390050172@redhat.com> <20080606202858.867179392@redhat.com> <20080606180451.31f01e70.akpm@linux-foundation.org> Organization: Red Hat, Inc. X-Mailer: Claws Mail 3.0.2 (GTK+ 2.10.4; x86_64-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 6 Jun 2008 18:04:51 -0700 Andrew Morton wrote: > On Fri, 06 Jun 2008 16:28:47 -0400 > Rik van Riel wrote: > > > From: Rik van Riel > > > > The -mm tree contains the patch > > vmscan-give-referenced-active-and-unmapped-pages-a-second-trip-around-the-lru.patch > > which gives referenced pagecache pages another trip around > > the active list. This seems to help keep frequently accessed > > pagecache pages in memory. > > > > However, it means that pagecache pages that get moved to the > > inactive list do not have their referenced bit set, and a > > reference to the page will not get it moved back to the active > > list > > Should that be "the next reference"? Because two references _will_ cause > the page to be activated? Indeed, next reference would be a more accurate description. > >. This patch sets the referenced bit on pagecache pages > > that get deactivated, so the next access to the page will promote > > it back to the active list. > > > > --- > > mm/vmscan.c | 4 ++++ > > 1 file changed, 4 insertions(+) > > > > Index: linux-2.6.26-rc2-mm1/mm/vmscan.c > > =================================================================== > > --- linux-2.6.26-rc2-mm1.orig/mm/vmscan.c 2008-05-28 12:11:51.000000000 -0400 > > +++ linux-2.6.26-rc2-mm1/mm/vmscan.c 2008-05-28 12:14:34.000000000 -0400 > > @@ -1062,8 +1062,13 @@ static void shrink_active_list(unsigned > > list_add(&page->lru, &l_inactive); > > pgmoved++; > > } > > - } else > > + } else { > > list_add(&page->lru, &l_inactive); > > + if (file && !page_mapped(page)) > > + /* Bypass use-once, make the next access count. > > + * See mark_page_accessed. */ > > + SetPageReferenced(page); > > + } > > } > > Will this change also cause these pages to get a second trip around the > inactive list? Or do we at the end of the patch series end up > reclaiming pagecache regardless of their PageReferenced()? If so, it > seems that we're making the pagecache pages a _lot_ stickier with this > change and my one - an additional trip around the active list and an > additional one around the inactive list. At the end of the inactive list, we reclaim it regardless of PageReferenced(). As for making the pagecache pages stickier, we can balance that out by tweaking swappiness now that we have page cache and swap/ram backed pages living on separate sets of LRU lists. The balancing becomes a lot easier than before. > Changelog should spell all this out, I guess. It's not the Changelog I'm worried about as much as the people who are trying to read the code afterwards. -- All rights reversed.