diff options
author | Johannes Weiner <hannes@cmpxchg.org> | 2016-01-20 15:03:16 -0800 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2016-01-20 17:09:18 -0800 |
commit | 44b7a8d33d666268062e0f725d5f14813a63a6ea (patch) | |
tree | 976a8ef6d69e8d34be1b07ec5f5d75e26b291ceb /mm/rmap.c | |
parent | 3e24b19dd5ff0587674ac7578cc11ef079708327 (diff) | |
download | op-kernel-dev-44b7a8d33d666268062e0f725d5f14813a63a6ea.zip op-kernel-dev-44b7a8d33d666268062e0f725d5f14813a63a6ea.tar.gz |
mm: memcontrol: do not uncharge old page in page cache replacement
Changing page->mem_cgroup of a live page is tricky and fragile. In
particular, the memcg writeback code relies on that mapping being stable
and users of mem_cgroup_replace_page() not overlapping with dirtyable
inodes.
Page cache replacement doesn't have to do that, though. Instead of being
clever and transferring the charge from the old page to the new,
force-charge the new page and leave the old page alone. A temporary
overcharge won't matter in practice, and the old page is going to be freed
shortly after this anyway. And this is not performance critical.
Signed-off-by: Johannes Weiner <hannes@cmpxchg.org>
Cc: Michal Hocko <mhocko@suse.cz>
Cc: Vladimir Davydov <vdavydov@virtuozzo.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/rmap.c')
0 files changed, 0 insertions, 0 deletions