linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Benjamin Redelings I <bredelin@ucla.edu>
To: linux-mm@kvack.org
Subject: VM change in 2.4.10-pre3: don't call swap_out unless shortage
Date: Sat, 01 Sep 2001 16:32:03 -0700	[thread overview]
Message-ID: <3B916FF3.6040300@ucla.edu> (raw)

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/

             reply	other threads:[~2001-09-01 23:32 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-09-01 23:32 Benjamin Redelings I [this message]
2001-09-02 13:14 ` 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=3B916FF3.6040300@ucla.edu \
    --to=bredelin@ucla.edu \
    --cc=linux-mm@kvack.org \
    /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