diff options
Diffstat (limited to 'mm/memcontrol.c')
-rw-r--r-- | mm/memcontrol.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/mm/memcontrol.c b/mm/memcontrol.c index a7ecf23150c5..0ed61e27d526 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c | |||
@@ -1169,10 +1169,11 @@ void mem_cgroup_commit_charge_swapin(struct page *page, struct mem_cgroup *ptr) | |||
1169 | /* | 1169 | /* |
1170 | * Now swap is on-memory. This means this page may be | 1170 | * Now swap is on-memory. This means this page may be |
1171 | * counted both as mem and swap....double count. | 1171 | * counted both as mem and swap....double count. |
1172 | * Fix it by uncharging from memsw. This SwapCache is stable | 1172 | * Fix it by uncharging from memsw. Basically, this SwapCache is stable |
1173 | * because we're still under lock_page(). | 1173 | * under lock_page(). But in do_swap_page()::memory.c, reuse_swap_page() |
1174 | * may call delete_from_swap_cache() before reach here. | ||
1174 | */ | 1175 | */ |
1175 | if (do_swap_account) { | 1176 | if (do_swap_account && PageSwapCache(page)) { |
1176 | swp_entry_t ent = {.val = page_private(page)}; | 1177 | swp_entry_t ent = {.val = page_private(page)}; |
1177 | struct mem_cgroup *memcg; | 1178 | struct mem_cgroup *memcg; |
1178 | memcg = swap_cgroup_record(ent, NULL); | 1179 | memcg = swap_cgroup_record(ent, NULL); |