From mboxrd@z Thu Jan 1 00:00:00 1970 Date: Tue, 14 Feb 2006 16:29:17 +0900 From: IWAMOTO Toshihiro Subject: Re: [PATCH 6/9] clockpro-clockpro.patch In-Reply-To: <20051230224312.765.58575.sendpatchset@twins.localnet> References: <20051230223952.765.21096.sendpatchset@twins.localnet> <20051230224312.765.58575.sendpatchset@twins.localnet> MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII Message-Id: <20060214072917.926A97402D@sv1.valinux.co.jp> Sender: owner-linux-mm@kvack.org Return-Path: To: Peter Zijlstra Cc: linux-mm@kvack.org, Andrew Morton , Christoph Lameter , Wu Fengguang , Nick Piggin , Marijn Meijles , Rik van Riel , Marcelo Tosatti List-ID: At Fri, 30 Dec 2005 23:43:34 +0100, Peter Zijlstra wrote: > Index: linux-2.6-git/mm/clockpro.c > =================================================================== > --- /dev/null > +++ linux-2.6-git/mm/clockpro.c > @@ -0,0 +1,557 @@ > +/* > + * Insert page into @zones clock and update adaptive parameters. > + * > + * Several page flags are used for insertion hints: > + * PG_active - insert as an active page > + * PG_test - use the use-once logic > + * > + * For now we will ignore the active hint; the use once logic is > + * explained below. > + * > + * @zone: target zone. > + * @page: new page. > + */ > +void __page_replace_insert(struct zone *zone, struct page *page) > +{ > + unsigned int rflags; > + > + rflags = nonresident_get(page_mapping(page), page_index(page)); > + > + /* ignore the PG_active hint */ > + ClearPageActive(page); > + > + /* abuse the PG_test flag for pagecache use-once */ > + if (!TestClearPageTest(page)) { > + /* > + * Insert (hot) when found in the nonresident list, otherwise > + * insert as (cold,test). Insert at the head of the Hhot list, > + * ie. right behind Hcold. > + */ > + if (rflags & NR_found) { > + SetPageActive(page); > + __cold_target_inc(zone, 1); > + } else { > + SetPageTest(page); > + ++zone->nr_cold; > + } > + ++zone->nr_resident; > + __select_list_hand(zone, &zone->list_hand[hand_hot]); > + list_add(&page->lru, &zone->list_hand[hand_hot]); Why do you put non-pagecache pages into hot lists? For hot pages, it means less time allowed to get their reference bits set. For cold test pages, test bits will be just cleared when Hhot passes. > + } else { > + /* > + * Pagecache insert; we want to avoid activation on the first > + * reference (which we know will come); use-once logic. -- IWAMOTO Toshihiro -- 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