On Sat, 2 Mar 2013, Simon Jeons wrote:On 03/02/2013 09:42 AM, Hugh Dickins wrote:A shmem page is swap-backed file-cache, and it may get transferred to orOn Sat, 2 Mar 2013, Simon Jeons wrote:shmem page should be treated as file-cache or swap-cache? It is strange sinceIn function __add_to_swap_cache if add to radix tree successfully willRight, that's hard to understand without historical background.
result
in increase NR_FILE_PAGES, why? This is anonymous page instead of file
backed
page.
I think the quick answer would be that we used to (and still do) think
of file-cache and swap-cache as two halves of page-cache. And then when
it is consist of anonymous pages and these pages establish files.
from swap-cache: yes, it's a difficult and confusing case, as I said below.
I would never call it "anonymous", but it is counted in /proc/meminfo's
Active(anon) or Inactive(anon) rather than in (file), because "anon"
there is shorthand for "swap-backed".
HughSo you'll find that shmem and swap are counted as file in some places
and anon in others, and it's hard to grasp which is where and why,
without remembering the history.