From: Joseph A Knapka <jknapka@earthlink.net>
To: Rik van Riel <riel@conectiva.com.br>
Cc: linux-mm@kvack.org
Subject: Re: [PATCH] fix page aging (2.4.9-ac12)
Date: Wed, 19 Sep 2001 12:53:54 +0000 [thread overview]
Message-ID: <3BA89562.CAED589C@earthlink.net> (raw)
In-Reply-To: Pine.LNX.4.33L.0109191454570.8191-100000@imladris.rielhome.conectiva
Hi Rik,
static inline void age_page_down(struct page *page)
{
- switch (vm_page_aging_tactic) {
- case PAGE_AGE_LINEAR:
- case PAGE_AGE_EXPUP:
- if (page->age)
- page->age -= PAGE_AGE_DECL;
- break;
- case PAGE_AGE_EXPDOWN:
- default:
- page->age /= 2;
- break;
- case PAGE_AGE_NULL:
- case PAGE_AGE_SINGLEBIT:
- page->age = 0;
- break;
- }
+ unsigned long age = page->age;
+ if (age > 0)
+ age -= PAGE_AGE_DECL;
+ page->age = age;
}
A nit: if PAGE_AGE_DECL is ever changed to be > 1
for some reason, we could end up with negative/huge
page ages (I had that problem some time ago
when experimenting with aging strategies). So
maybe an "if (age < 0) age = 0" is in order.
Cheers,
-- Joe
-- Joe Knapka
# Replace the pink stuff with net to reply.
# "You know how many remote castles there are along the
# gorges? You can't MOVE for remote castles!" - Lu Tze re. Uberwald
# Linux MM docs:
http://home.earthlink.net/~jknapka/linux-mm/vmoutline.html
--
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/
next prev parent reply other threads:[~2001-09-19 12:53 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2001-09-19 18:25 [PATCH] fix page aging (2.4.9-ac12) Rik van Riel
2001-09-19 18:25 ` Rik van Riel
2001-09-19 12:53 ` Joseph A Knapka [this message]
2001-09-19 18:40 ` Jan Harkes
2001-09-19 18:44 ` Rik van Riel
2001-09-20 13:32 ` Daniel Phillips
2001-09-20 13:29 ` Rik van Riel
2001-09-20 13:31 ` Martin Josefsson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3BA89562.CAED589C@earthlink.net \
--to=jknapka@earthlink.net \
--cc=linux-mm@kvack.org \
--cc=riel@conectiva.com.br \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.