diff --git a/mm/memcontrol.c b/mm/memcontrol.c index 6a641c103567e91c4819450acf86cc96054e6ca0..ace7391e5d2852ad360709afa9750cb5ddfca96a 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c @@ -3274,13 +3274,17 @@ void obj_cgroup_uncharge(struct obj_cgroup *objcg, size_t size) void split_page_memcg(struct page *head, unsigned int nr) { struct mem_cgroup *memcg = head->mem_cgroup; + int kmemcg = PageKmemcg(head); int i; if (mem_cgroup_disabled() || !memcg) return; - for (i = 1; i < nr; i++) + for (i = 1; i < nr; i++) { head[i].mem_cgroup = memcg; + if (kmemcg) + __SetPageKmemcg(head + i); + } css_get_many(&memcg->css, nr - 1); }