* VM change in 2.4.10-pre3: don't call swap_out unless shortage
@ 2001-09-01 23:32 Benjamin Redelings I
2001-09-02 13:14 ` Rik van Riel
0 siblings, 1 reply; 2+ messages in thread
From: Benjamin Redelings I @ 2001-09-01 23:32 UTC (permalink / raw)
To: linux-mm
Hi list,
I saw this change in 2.4.10-pre3, which seems to have some disadvantages:
> static int do_try_to_free_pages(unsigned int gfp_mask, int user)
> {
> - /* Always walk at least the active queue when called */
> - int shortage = INACTIVE_SHORTAGE;
> + int shortage = 0;
> int maxtry;
>
> + /* Always walk at least the active queue when called */
> + refill_inactive_scan(DEF_PRIORITY);
This avoids swapping when there is no shortage, but it ALSO avoids
looking at any hardware accessed bits, since swap_out does that.
In fact, I thought that Linus was thinking of renaming swap_out to
something like scan_pages, since it doesn't actually swap things out -
it just moves them to the swap cache. So, if the purpose of this change
is to "avoid swapping when it is unnecessary" then isn't it doing the
wrong thing? Shouldn't it instead make the kernel less aggressive in
moving pages to the swap cache when there is no shortage (since we can't
look at the hardware accessed bits any-more) or delay write-out of
swap-cached pages until there is a shortage?
On the other hand, perhaps the intension is to avoid doing swap-out when
there is a free shortage, but no inactive shortage? Or perhaps the
intention is to avoid running swap_out every time kswapd runs?
I guess what I am really wondering is if there is some way that we could
continue calling refill_inactive_scan while never calling swap_out (or
only rarely). Because in that case it seems that page age's would be
fairly innaccurate, since this test would almost never be true:
/* Do aging on the pages. */
if (PageTestandClearReferenced(page)) {
age_page_up(page);
Anyway, thanks for any explanation of what I'm missing!
-BenRI, looking forwards to reverse mapping...
--
"At this time Frodo was still in his 'tweens', as the hobbits called
the irresponsible twenties between childhood and coming-of-age at
thirty three" - The Fellowship of the Ring, J.R.R. Tolkein
Benjamin Redelings I <>< http://www.bol.ucla.edu/~bredelin/
--
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/
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: VM change in 2.4.10-pre3: don't call swap_out unless shortage
2001-09-01 23:32 VM change in 2.4.10-pre3: don't call swap_out unless shortage Benjamin Redelings I
@ 2001-09-02 13:14 ` Rik van Riel
0 siblings, 0 replies; 2+ messages in thread
From: Rik van Riel @ 2001-09-02 13:14 UTC (permalink / raw)
To: Benjamin Redelings I; +Cc: linux-mm
On Sat, 1 Sep 2001, Benjamin Redelings I wrote:
> I guess what I am really wondering is if there is some way that we
> could continue calling refill_inactive_scan while never calling
> swap_out (or only rarely).
You're absolutely right. Guess why Linus moved swap_out()
to before refill_inactive_scan() in the first place ? ;)
> Anyway, thanks for any explanation of what I'm missing!
>
> -BenRI, looking forwards to reverse mapping...
I think you haven't missed a single detail here. Reverse
mappings would indeed get rid of the whole unbalanced mess
we have right now.
regards,
Rik
--
IA64: a worthy successor to i860.
http://www.surriel.com/ http://distro.conectiva.com/
Send all your spam to aardvark@nl.linux.org (spam digging piggy)
--
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/
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2001-09-02 13:14 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-09-01 23:32 VM change in 2.4.10-pre3: don't call swap_out unless shortage Benjamin Redelings I
2001-09-02 13:14 ` Rik van Riel
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox