summaryrefslogtreecommitdiffstats
path: root/mm/memcontrol.c
diff options
context:
space:
mode:
Diffstat (limited to 'mm/memcontrol.c')
-rw-r--r--mm/memcontrol.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/mm/memcontrol.c b/mm/memcontrol.c
index 9be3cf8a5da4..0e3fdbd809c7 100644
--- a/mm/memcontrol.c
+++ b/mm/memcontrol.c
@@ -1485,7 +1485,8 @@ void mem_cgroup_update_file_mapped(struct page *page, int val)
SetPageCgroupFileMapped(pc);
} else {
__this_cpu_dec(mem->stat->count[MEM_CGROUP_STAT_FILE_MAPPED]);
- ClearPageCgroupFileMapped(pc);
+ if (!page_mapped(page)) /* for race between dec->inc counter */
+ ClearPageCgroupFileMapped(pc);
}
done:
OpenPOWER on IntegriCloud