From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id ; Thu, 20 Sep 2001 09:24:57 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id ; Thu, 20 Sep 2001 09:24:47 -0400 Received: from humbolt.nl.linux.org ([131.211.28.48]:53255 "EHLO humbolt.nl.linux.org") by vger.kernel.org with ESMTP id ; Thu, 20 Sep 2001 09:24:43 -0400 Content-Type: text/plain; charset=US-ASCII From: Daniel Phillips To: Jan Harkes , Rik van Riel Subject: Re: [PATCH] fix page aging (2.4.9-ac12) Date: Thu, 20 Sep 2001 15:32:26 +0200 X-Mailer: KMail [version 1.3.1] Cc: linux-kernel@vger.kernel.org In-Reply-To: <20010919143958.A1466@cs.cmu.edu> In-Reply-To: <20010919143958.A1466@cs.cmu.edu> MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Message-Id: <20010920132504Z16271-2758+295@humbolt.nl.linux.org> Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org On September 19, 2001 08:40 pm, Jan Harkes wrote: > On Wed, Sep 19, 2001 at 03:25:29PM -0300, Rik van Riel wrote: > > No more mr. overcareful, obviously that doesn't work ;) > > Finally ;) > > > static inline void age_page_down(struct page *page) > > { > ... > > + unsigned long age = page->age; > > + if (age > 0) > > + age -= PAGE_AGE_DECL; > > + page->age = age; > > } > > Perhaps the following would be better, just in case anyone sets > PAGE_AGE_DECL to something other than 1. > > static inline void age_page_down(struct page *page) > { > unsigned long age = page->age; > if (age > PAGE_AGE_DECL) > age -= PAGE_AGE_DECL; > else > age = 0; > page->age = age; > } static inline void age_page_down(struct page *page) { page->age = max((int) (age - PAGE_AGE_DECL), 0); } ;-) -- Daniel