From: Roger Larsson <roger.larsson@norran.net>
To: Rik van Riel <riel@conectiva.com.br>
Cc: linux-mm@kvack.org
Subject: Re: [patch] page aging and deferred swapping for 2.4.0-test1
Date: Fri, 26 May 2000 16:59:59 +0200 [thread overview]
Message-ID: <392E916F.E102551D@norran.net> (raw)
In-Reply-To: <Pine.LNX.4.21.0005251936390.7453-100000@duckman.distro.conectiva>
Hi,
Shouldn't lru_cache_add in swap.h initialize age?
#define lru_cache_add(page) \
do { \
spin_lock(&pagemap_lru_lock); \
list_add(&(page)->lru, &lru_cache); \
(page)->age = 5; \
nr_lru_pages++; \
spin_unlock(&pagemap_lru_lock); \
} while (0)
Rik van Riel wrote:
> --- linux-2.4.0-test1/mm/page_alloc.c.orig Thu May 25 12:27:47 2000
> +++ linux-2.4.0-test1/mm/page_alloc.c Thu May 25 18:37:44 2000
> @@ -94,6 +94,8 @@
> if (PageDecrAfter(page))
> BUG();
>
> + page->age = 2;
> +
hmm...
If this is a page that has beed used much, isn't it penalized to
much, and don't we loose information...??? (all fread pages are the
same)
how about:
page->age /= 2;
Ok, it could race (read/write)...
and in try_to_swap_out (mm/vmscan.c) we could change to
/* Don't look at this pte if it's been accessed recently. */
if (pte_young(pte)) {
/*
* Transfer the "accessed" bit from the page
* tables to the global page map.
*/
set_pte(page_table, pte_mkold(pte));
page->age += 3;
goto out_failed;
}
/* Can only do this if we age all active pages. */
// if (page->age > 1)
// goto out_failed;
this would free a bit (PG_referenced would not be needed).
But it can race (read, write)
The races when updating page->age should not be critical.
(statistics...)
/RogerL
--
Home page:
http://www.norran.net/nra02596/
--
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 14:59 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
2000-05-26 14:59 ` Roger Larsson [this message]
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=392E916F.E102551D@norran.net \
--to=roger.larsson@norran.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox