LRU for recycling shadow pages
Hi all,
Can anyone give me an description on how LRU for recycling shadow pages is implemented?
Thanks,
Sangmin
Quoted 2 lines · Sangmin Lee
Can anyone give me an description on how LRU for recycling shadow pages is implemented?
The LRU is only very approximate: we keep a linked list of the top-level shadow pages, and pull entries to the front when they're used in a CR3 write. Each entry on the list has an extra "pin" reference taken to stop it being torn down when it's not in a CR3.
When we need to reclaim shadow memory, we drop those pin references, starting from the tail end of the list, which causes shadow pagetable hierarchies to be recursively torn down.
Code is in shadow_prealloc() in arch/x86/mm/shadow/common.c
Cheers,
Tim.
Signature · 2 lines
Tim Deegan <[email protected]>, XenSource UK Limited Registered office c/o EC2Y 5EB, UK; company number 05334508