Skip to contentSkip to conversation

try_to_swap_out() deactivating pages w. count > 2

DISCUSSION Rik van Riel 2 participants 3 messages Apr 21, 2001 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw
Quoted 7 lines · Linus Torvalds

In article <Pine.LNX.4.21.0104211336390.1685-100000@imladris.rielhome.conectiva>,

Quoted 4 lines · Rik van Riel

What I _am_ worried about is the fact that we do this to pages with a really high page age. These things are in active use and cannot be swapped out any time soon, yet we do claim swap space for it ...

Quoted 5 lines

Ehh... And if we didn't do that, then how could they every become less active?

We should _absolutely_ do the swap space reclaiming without looking at the page count.

page->age != page->count

Rik
--
Virtual memory is like a game you can't win; However, without VM there's truly nothing to lose...

		http://www.surriel.com/

http://www.conectiva.com/ http://distro.conectiva.com.br/

#2 lore raw
Quoted 9 lines · Rik van Riel
Quoted 5 lines · Linus Torvalds

Ehh... And if we didn't do that, then how could they every become less active?

We should _absolutely_ do the swap space reclaiming without looking at the page count.

page->age != page->count

Umm, forget that. We only decrease page->age in refill_inactive_scan, so we NEED to put it there. You're right, I should wake up and think a bit more about my own code ;)

Rik
--
Virtual memory is like a game you can't win; However, without VM there's truly nothing to lose...

		http://www.surriel.com/

http://www.conectiva.com/ http://distro.conectiva.com.br/

#3 lore raw
In reply to Rik van Riel
Quoted 5 lines · Rik van Riel
Quoted 3 lines

We should _absolutely_ do the swap space reclaiming without looking at the page count.

page->age != page->count

It's all the same thing.

The page age and count are used to decice when the page actually gets thrown _out_ of memory. That's a decision that is based on the _physical_ page attributes.

But try_to_swap_out() is based on the attribute on this particular virtual mapping of the page. If this particular virtual mapping does not have the "accessed" bit set, then try_to_swap_out() should get rid of that virtual mapping. It should absolutely not use the global page characteristics (either global usage count or global age) in making that decision. Because those do not matter - they have absoilutely no meaning for this virtual mapping of the page.

Put another way: if process A is a heavy user of a page, and process B just touched it once and will never touch it again, what do you think should happen?

Answer: the page should be dropped from process B. It's a cheap thing to do (we can get it back if necessary without any IO), and it means that if we end up having toi actually swap out the page eventually, we will not be confused by "noise" in the page count from a mappign that hasn't been active for a long time.

Linus