From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753295Ab2AZRb0 (ORCPT ); Thu, 26 Jan 2012 12:31:26 -0500 Received: from e9.ny.us.ibm.com ([32.97.182.139]:46125 "EHLO e9.ny.us.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751557Ab2AZRbZ (ORCPT ); Thu, 26 Jan 2012 12:31:25 -0500 Message-ID: <4F218D36.2060308@linux.vnet.ibm.com> Date: Thu, 26 Jan 2012 09:28:22 -0800 From: Dave Hansen User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.24) Gecko/20111109 Lightning/1.0b2 Thunderbird/3.1.16 MIME-Version: 1.0 To: Dan Magenheimer CC: linux-kernel@vger.kernel.org, linux-mm@kvack.org, Andrew Morton , Konrad Wilk , Seth Jennings , Nitin Gupta , Nebojsa Trpkovic , minchan@kernel.org, KAMEZAWA Hiroyuki , riel@redhat.com, Chris Mason Subject: Re: [PATCH] mm: implement WasActive page flag (for improving cleancache) References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Content-Scanned: Fidelis XPS MAILER x-cbid: 12012617-7182-0000-0000-000000950811 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 01/25/2012 01:58 PM, Dan Magenheimer wrote: > (Feedback welcome if there is a different/better way to do this > without using a page flag!) > > Since about 2.6.27, the page replacement algorithm maintains > an "active" bit to help decide which pages are most eligible > to reclaim, see http://linux-mm.org/PageReplacementDesign > > This "active' information is also useful to cleancache but is lost > by the time that cleancache has the opportunity to preserve the > pageful of data. This patch adds a new page flag "WasActive" to > retain the state. The flag may possibly be useful elsewhere. I guess cleancache itself is clearing the bit, right? I didn't see any clearing going on in the patch. I do think it also needs to get cleared on the way in to the page allocator. Otherwise: PageSetWasActive(page); free_page(page); ... another_user_page = get_free_page() // now cleancache sees the active bit for the prev user Or am I missing somewhere it gets cleared non-explicitly somewhere?