]> Git Repo - linux.git/commit
memcg: remove PCG_CACHE page_cgroup flag
authorKAMEZAWA Hiroyuki <[email protected]>
Wed, 21 Mar 2012 23:34:22 +0000 (16:34 -0700)
committerLinus Torvalds <[email protected]>
Thu, 22 Mar 2012 00:55:01 +0000 (17:55 -0700)
commitb24028572fb69e9dd6de8c359eba2b2c66baa889
tree563594eba40e5fd0b61c36c09705f128a8dfbe40
parentca464d69b19120a826aa2534de2511a6f542edf5
memcg: remove PCG_CACHE page_cgroup flag

We record 'the page is cache' with the PCG_CACHE bit in page_cgroup.
Here, "CACHE" means anonymous user pages (and SwapCache).  This doesn't
include shmem.

Considering callers, at charge/uncharge, the caller should know what the
page is and we don't need to record it by using one bit per page.

This patch removes PCG_CACHE bit and make callers of
mem_cgroup_charge_statistics() to specify what the page is.

About page migration: Mapping of the used page is not touched during migra
tion (see page_remove_rmap) so we can rely on it and push the correct
charge type down to __mem_cgroup_uncharge_common from end_migration for
unused page.  The force flag was misleading was abused for skipping the
needless page_mapped() / PageCgroupMigration() check, as we know the
unused page is no longer mapped and cleared the migration flag just a few
lines up.  But doing the checks is no biggie and it's not worth adding
another flag just to skip them.

[[email protected]: checkpatch fixes]
[[email protected]: fix PageAnon uncharging]
Signed-off-by: KAMEZAWA Hiroyuki <[email protected]>
Acked-by: Michal Hocko <[email protected]>
Acked-by: Johannes Weiner <[email protected]>
Cc: Hugh Dickins <[email protected]>
Cc: Ying Han <[email protected]>
Acked-by: Johannes Weiner <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
include/linux/page_cgroup.h
mm/memcontrol.c
This page took 0.055108 seconds and 4 git commands to generate.