Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932620AbYCEAc0 (ORCPT ); Tue, 4 Mar 2008 19:32:26 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1758100AbYCEAcR (ORCPT ); Tue, 4 Mar 2008 19:32:17 -0500 Received: from saeurebad.de ([85.214.36.134]:45649 "EHLO saeurebad.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754397AbYCEAcQ (ORCPT ); Tue, 4 Mar 2008 19:32:16 -0500 From: Johannes Weiner To: Rik van Riel Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, KOSAKI Motohiro , Lee Schermerhorn , Christoph Lameter Subject: Re: [patch 02/20] Use an indexed array for LRU variables References: <20080304225157.573336066@redhat.com> <20080304225226.653954413@redhat.com> Date: Wed, 05 Mar 2008 01:31:10 +0100 In-Reply-To: <20080304225226.653954413@redhat.com> (Rik van Riel's message of "Tue, 04 Mar 2008 17:51:59 -0500") Message-ID: <87lk4yc8q9.fsf@saeurebad.de> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.1.3 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1979 Lines: 50 Hi Rik, Rik van Riel writes: > Index: linux-2.6.25-rc3-mm1/include/linux/mmzone.h > =================================================================== > --- linux-2.6.25-rc3-mm1.orig/include/linux/mmzone.h 2008-03-04 14:12:52.000000000 -0500 > +++ linux-2.6.25-rc3-mm1/include/linux/mmzone.h 2008-03-04 14:59:31.000000000 -0500 > @@ -80,8 +80,8 @@ struct zone_padding { > enum zone_stat_item { > /* First 128 byte cacheline (assuming 64 bit words) */ > NR_FREE_PAGES, > - NR_INACTIVE, > - NR_ACTIVE, > + NR_INACTIVE, /* must match order of LRU_[IN]ACTIVE */ > + NR_ACTIVE, /* " " " " " */ > NR_ANON_PAGES, /* Mapped anonymous pages */ > NR_FILE_MAPPED, /* pagecache pages mapped into pagetables. > only modified from process context */ > @@ -105,6 +105,13 @@ enum zone_stat_item { > #endif > NR_VM_ZONE_STAT_ITEMS }; How about a #define LRU_STAT_BASE NR_INACTIVE ... > Index: linux-2.6.25-rc3-mm1/include/linux/mm_inline.h > =================================================================== > --- linux-2.6.25-rc3-mm1.orig/include/linux/mm_inline.h 2007-07-08 19:32:17.000000000 -0400 > +++ linux-2.6.25-rc3-mm1/include/linux/mm_inline.h 2008-03-04 14:59:31.000000000 -0500 > @@ -1,40 +1,51 @@ > static inline void > +add_page_to_lru_list(struct zone *zone, struct page *page, enum lru_list l) > +{ > + list_add(&page->lru, &zone->list[l]); > + __inc_zone_state(zone, NR_INACTIVE + l); ... in order to avoid using NR_INACTIVE in places like this? (LRU_STAT_BASE is a bad name, I apologize) Or perhaps a macro lru_stat (it's getting worse...) that yields the zone stat index corresponding to the lru list type? I think this would increase readability. Hannes -- 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/