lkml.org 
[lkml]   [2001]   [Sep]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH] fix page aging (2.4.9-ac12)
Date
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
-
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/

\
 
 \ /
  Last update: 2005-03-22 13:03    [W:0.042 / U:3.108 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site