Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1030349AbWAXGaN (ORCPT ); Tue, 24 Jan 2006 01:30:13 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1030350AbWAXGaN (ORCPT ); Tue, 24 Jan 2006 01:30:13 -0500 Received: from sv1.valinux.co.jp ([210.128.90.2]:8877 "EHLO sv1.valinux.co.jp") by vger.kernel.org with ESMTP id S1030349AbWAXGaL (ORCPT ); Tue, 24 Jan 2006 01:30:11 -0500 Date: Tue, 24 Jan 2006 15:30:10 +0900 From: IWAMOTO Toshihiro To: Rik van Riel Cc: IWAMOTO Toshihiro , Peter Zijlstra , Marcelo Tosatti , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Andrew Morton , Christoph Lameter , Wu Fengguang , Nick Piggin , Marijn Meijles Subject: Re: [PATCH 6/9] clockpro-clockpro.patch In-Reply-To: <20060106090135.3525D74031@sv1.valinux.co.jp> References: <20051230223952.765.21096.sendpatchset@twins.localnet> <20051230224312.765.58575.sendpatchset@twins.localnet> <20051231002417.GA4913@dmt.cnet> <1136028546.17853.69.camel@twins> <20060105094722.897C574030@sv1.valinux.co.jp> <20060106090135.3525D74031@sv1.valinux.co.jp> User-Agent: Wanderlust/2.15.1 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.7 (=?ISO-8859-4?Q?Sanj=F2?=) APEL/10.6 Emacs/21.4 (i386-pc-linux-gnu) MULE/5.0 (SAKAKI) MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII Message-Id: <20060124063010.B85C77402D@sv1.valinux.co.jp> Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 4579 Lines: 104 At Fri, 06 Jan 2006 18:01:35 +0900, IWAMOTO Toshihiro wrote: > > At Thu, 5 Jan 2006 08:32:19 -0500 (EST), > Rik van Riel wrote: > > > > On Thu, 5 Jan 2006, IWAMOTO Toshihiro wrote: > > > > In my understanding of CLOCK-Pro, such lapping causes sudden increase > > > in the distance between Hhot and Hcold. As that distance is an > > > important parameter of page aging/replacement decisions, I'm afraid > > > that such lapping would result in incorrect page aging and bad > > > performance. > > > > Hcold only manipulates cold pages, Hhot only manipulates hot > > pages and the test bit on cold pages. Having one hand overtake > > the other should not disturb things at all, since they both do > > something different. > > I don't think so. Hhot turns unreferenced hot pages into cold ones, > and those are freed if they aren't referenced before Hcold passes. > So, the distance between those hands is a sort of "expiry timer" of > such pages. > The distance also affects aging of newly inserted pages. I've added the following code to count lappings. I also measured speeds of hands from pgrefill* and pgscan* in /proc/vmstat. While executing $ while true; do cksum zero; done , where zero is a 1100MB file and the amount of the system RAM is 1GB, Hcold was almost twice faster than Hhot in ZONE_DMA32 (the system was x86_64), and Hcold was steadily overtaking Hhot. (Interestingly, in ZONE_DMA, Hhot was faster than Hcold. I think this can be ignored for now.) I thought this situation means that page access frequencies cannot be correctly compared and leads to suboptimal performance, but I couldn't prove that. However, I've managed to create an example workload where clockpro performs worse. I'm not sure if the example is related to this hand problem. I'll describe it in the next mail. diff -urp linux-2.6.15-rc5-clockpro-orig/mm/clockpro.c linux-2.6.15-rc5-clockpro-20051231/mm/clockpro.c --- linux-2.6.15-rc5-clockpro-orig/mm/clockpro.c 2006-01-24 15:05:01.000000000 +0900 +++ linux-2.6.15-rc5-clockpro-20051231/mm/clockpro.c 2006-01-13 16:36:16.000000000 +0900 @@ -119,8 +119,13 @@ static void swap_lists(struct zone *zone static inline void __select_list_hand(struct zone *zone, struct list_head *list) { - if (list_empty(list)) + if (list_empty(list)) { swap_lists(zone); + if (list == &zone->list_hand[hand_hot]) + zone->handswapcnt++; + else + zone->handswapcnt--; + } } /* @@ -589,6 +594,7 @@ static int stats_show(struct seq_file *m seq_printf(m, " zone->nr_cold: %lu\n", zone->nr_cold); seq_printf(m, " zone->nr_cold_target: %lu\n", zone->nr_cold_target); seq_printf(m, " zone->nr_nonresident_scale: %lu\n", zone->nr_nonresident_scale); + seq_printf(m, " zone->handswapcnt: %ld\n", zone->handswapcnt); seq_printf(m, " zone->present_pages: %lu\n", zone->present_pages); seq_printf(m, " zone->free_pages: %lu\n", zone->free_pages); seq_printf(m, " zone->pages_min: %lu\n", zone->pages_min); diff -urp linux-2.6.15-rc5-clockpro-orig/include/linux/mmzone.h linux-2.6.15-rc5-clockpro-20051231/include/linux/mmzone.h --- linux-2.6.15-rc5-clockpro-orig/include/linux/mmzone.h 2006-01-24 15:05:01.000000000 +0900 +++ linux-2.6.15-rc5-clockpro-20051231/include/linux/mmzone.h 2006-01-13 16:33:32.000000000 +0900 @@ -146,6 +146,7 @@ struct zone { unsigned long nr_cold; unsigned long nr_cold_target; unsigned long nr_nonresident_scale; + long handswapcnt; unsigned long pages_scanned; /* since last reclaim */ int all_unreclaimable; /* All pages pinned */ diff -urp linux-2.6.15-rc5-clockpro-orig/include/linux/page-flags.h linux-2.6.15-rc5-clockpro-20051231/include/linux/page-flags.h --- linux-2.6.15-rc5-clockpro-orig/include/linux/page-flags.h 2006-01-24 15:05:01.000000000 +0900 +++ linux-2.6.15-rc5-clockpro-20051231/include/linux/page-flags.h 2006-01-16 18:17:19.000000000 +0900 @@ -155,7 +155,7 @@ extern void __mod_page_state(unsigned lo #define mod_page_state_zone(zone, member, delta) \ do { \ unsigned offset; \ - if (is_highmem(zone)) \ + if (is_highmem(zone) || zone == zone->zone_pgdat->node_zones + ZONE_DMA32) \ offset = offsetof(struct page_state, member##_high); \ else if (is_normal(zone)) \ offset = offsetof(struct page_state, member##_normal); \ -- IWAMOTO Toshihiro - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/