linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* A question about page aging in page frame reclaimation
@ 2007-04-04 10:33 Zhao Forrest
  2007-04-04 10:50 ` Peter Zijlstra
  2007-04-05  4:03 ` Rik van Riel
  0 siblings, 2 replies; 3+ messages in thread
From: Zhao Forrest @ 2007-04-04 10:33 UTC (permalink / raw)
  To: riel; +Cc: linux-mm

Hi Riel,

I'm studying the code of page frame reclaimation in 2.6 kernel. From
my understanding, there should be kernel thread periodically scanning
the active and inactive list and move the page frames between active
and inactive list according to LRU rule.

But I can't find the related code.....would you please point me to the
code piece that implement this "page aging" functionality?
Sorry for the stupid question, but I think I don't have a very strong
code-reading ability.

Thanks in advance,
Forrest

--
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/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: A question about page aging in page frame reclaimation
  2007-04-04 10:33 A question about page aging in page frame reclaimation Zhao Forrest
@ 2007-04-04 10:50 ` Peter Zijlstra
  2007-04-05  4:03 ` Rik van Riel
  1 sibling, 0 replies; 3+ messages in thread
From: Peter Zijlstra @ 2007-04-04 10:50 UTC (permalink / raw)
  To: Zhao Forrest; +Cc: riel, linux-mm

On Wed, 2007-04-04 at 18:33 +0800, Zhao Forrest wrote:
> Hi Riel,
> 
> I'm studying the code of page frame reclaimation in 2.6 kernel. From
> my understanding, there should be kernel thread periodically scanning
> the active and inactive list and move the page frames between active
> and inactive list according to LRU rule.
> 
> But I can't find the related code.....would you please point me to the
> code piece that implement this "page aging" functionality?
> Sorry for the stupid question, but I think I don't have a very strong
> code-reading ability.

There is no time related scanning; we only scan when we wake up kswapd
or in direct reclaim. 

We wake kswapd when the free page count drops below the high watermark.
(look for callers of wakeup_kswapd()).

Direct reclaim is a per task reclaim, entered when the free page count
drops below the low watermark, this provides per task feedback when
under heavy pressure.

So reclaim is driven purely by page allocation.

The active -> inactive shuffling is a tad involved. But basically: we
scan the active list proportionally to its size to move active pages to
the inactive list, then scan the inactive list (proportional to its size
before the active->inactive move).

Pages on the inactive list that are referenced are moved to the active
list. Unreferenced pages in the active list are moved to the inactive
list. (Checking the reference bit also clears it).

And a gazillion exceptions and details...

--
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/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: A question about page aging in page frame reclaimation
  2007-04-04 10:33 A question about page aging in page frame reclaimation Zhao Forrest
  2007-04-04 10:50 ` Peter Zijlstra
@ 2007-04-05  4:03 ` Rik van Riel
  1 sibling, 0 replies; 3+ messages in thread
From: Rik van Riel @ 2007-04-05  4:03 UTC (permalink / raw)
  To: Zhao Forrest; +Cc: linux-mm

Zhao Forrest wrote:
> Hi Riel,
> 
> I'm studying the code of page frame reclaimation in 2.6 kernel. From
> my understanding, there should be kernel thread periodically scanning
                           ^^^^^^^^^

"should be"?  What makes you think that?

> But I can't find the related code.....

That's probably because it doesn't exist.

-- 
Politics is the struggle between those who want to make their country
the best in the world, and those who believe it already is.  Each group
calls the other unpatriotic.

--
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/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2007-04-05  4:03 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-04-04 10:33 A question about page aging in page frame reclaimation Zhao Forrest
2007-04-04 10:50 ` Peter Zijlstra
2007-04-05  4:03 ` 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