From: Rik van Riel <riel@conectiva.com.br>
To: Roger Larsson <roger.larsson@norran.net>
Cc: linux-mm@kvack.org
Subject: Re: [patch] page aging and deferred swapping for 2.4.0-test1
Date: Fri, 26 May 2000 10:41:04 -0300 (BRST) [thread overview]
Message-ID: <Pine.LNX.4.21.0005261038340.26570-100000@duckman.distro.conectiva> (raw)
In-Reply-To: <392E7CFD.C9017833@norran.net>
On Fri, 26 May 2000, Roger Larsson wrote:
> Rik van Riel wrote:
> > the attached patch attempts to implement the following two
> > things (which we'll probably want in the active/inactive
> > design later on):
> > - page aging (for active pages)
> > - deferred swap IO, with only unmapping in try_to_swap_out()
> The aging code can not be correct.
> if (PageTestandClearReferenced(page)) {
> page->age += 3;
> if (page->age > 10)
> page->age = 0;
> goto dispose_continue;
> }
> page->age--;
>
> if (page->age)
> goto dispose_continue;
True, there is one obvious error here...
> I would say it should be:
>
> if (PageTestandClearReferenced(page)) {
> page->age += 3;
> if (page->age > 10)
> page->age = 10;
> goto dispose_continue;
> }
>
> if (page->age && priority) // at zero priority ignore age
> goto dispose_continue;
>
> page->age--;
This is wrong too. It would mean that we'd never decrease the
page age unless priority == 0 ;)
The fix is this:
}
- page->age--;
+ if (page->age)
+ page->age--;
(so we cannot get into a near-infinite loop when we decrease
the unsigned age when it's zero and have it wrap to infinite)
regards,
Rik
--
The Internet is not a network of computers. It is a network
of people. That is its real strength.
Wanna talk about the kernel? irc.openprojects.net / #kernelnewbies
http://www.conectiva.com/ http://www.surriel.com/
--
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.eu.org/Linux-MM/
next prev parent reply other threads:[~2000-05-26 13:41 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2000-05-25 23:03 Rik van Riel
2000-05-25 23:48 ` Neil Schemenauer
2000-05-26 13:32 ` Roger Larsson
2000-05-26 13:41 ` Rik van Riel [this message]
2000-05-26 14:59 ` Roger Larsson
2000-05-26 15:16 ` Rik van Riel
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=Pine.LNX.4.21.0005261038340.26570-100000@duckman.distro.conectiva \
--to=riel@conectiva.com.br \
--cc=linux-mm@kvack.org \
--cc=roger.larsson@norran.net \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox