linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Joseph A Knapka <jknapka@earthlink.net>
To: Benjamin Redelings I <bredelin@ucla.edu>, linux-mm@kvack.org
Subject: Re: VM question: side effect of not scanning Active pages?
Date: Sun, 14 Oct 2001 23:58:36 +0000	[thread overview]
Message-ID: <3BCA26AC.98F5747C@earthlink.net> (raw)
In-Reply-To: <3BCA6F25.2000807@ucla.edu>

Benjamin Redelings I wrote:
> 
> Hi Joe,
>         Thanks for the answer.
> 
> > Well, you will never unmap active page. Essentially,
> > that means that once a page gets onto the active
> > list, it is effectively pinned in memory until all processes
> > using the page exit.
> 
>         I'm not sure why this would be true.  Shouldn't any pages on the Active
> list be moved to the Inactive list eventually if they are not used?  In
> refill_inactive (vmscan.c), there is a loop over the active list with
> this code:
> 
>                  if (PageTestandClearReferenced(page)) {
>                          list_del(&page->lru);
>                          list_add(&page->lru, &active_list);
>                          continue;
>                  }
> 
>                  del_page_from_active_list(page);
>                  add_page_to_inactive_list(page);
> 
>         So, if the page is referenced, then it gets moved to the head of the
> active list, and the referenced bit cleared.  But if it is NOT marked
> referenced (which is what should happen for unused system daemons), then
> it should get added to the inactive list, right?
>         Please, let me know if I'm missing something :)

Well, that's what I get for reading 2.4.5 code :-) The active
list scanning used to check that a page was unreferenced by any
process PTEs before deactivating. Now that's unnecessary, since
it appears all the complicated machinery to support direct
reclaim of clean pages from the LRU has gone away, and
shrink_cache() nee page_launder() just directly frees
pages back into the free pool. Cool! So there's nothing
preventing mapped pages from being deactivated, which means
my previous assertion was just silly.

OK, here's what's happening, I think.  Bailing out of
try_to_swap_out() when a page is active simply prevents
active pages (eg, glibc pages) from being evicted from
a process's memory map. So even if the process isn't
using a page, any -other- process that's using it will
prevent it from being evicted from the VM of all the
other procs that have it mapped, whether they are using
the page or not. Presumably, RSS reflects the number
of pages a process has mapped, so you see your daemons
with big RSS because some other process is using their
pages. I don't know if that will cause problems at present
or not. I think accurate RSS figures would be necessary
for global kinds of VM balancing and control.

Cheers,

-- Joe
# "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/

  parent reply	other threads:[~2001-10-14 23:58 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2001-10-14 23:30 Benjamin Redelings I
2001-10-14 18:55 ` Joseph A Knapka
     [not found]   ` <3BCA6F25.2000807@ucla.edu>
2001-10-14 23:58     ` Joseph A Knapka [this message]
2001-10-15 12:38 ` Jonathan Morton

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=3BCA26AC.98F5747C@earthlink.net \
    --to=jknapka@earthlink.net \
    --cc=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