mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 10:41:38 -04:00
hugetlb/cgroup: migrate hugetlb cgroup info from oldpage to new page during migration
With HugeTLB pages, hugetlb cgroup is uncharged in compound page destructor. Since we are holding a hugepage reference, we can be sure that old page won't get uncharged till the last put_page(). Signed-off-by: Aneesh Kumar K.V <[email protected]> Cc: David Rientjes <[email protected]> Acked-by: KAMEZAWA Hiroyuki <[email protected]> Cc: Hillf Danton <[email protected]> Cc: Michal Hocko <[email protected]> Cc: KOSAKI Motohiro <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
parent
abb8206cb0
commit
8e6ac7fab3
3 changed files with 33 additions and 0 deletions
|
|
@ -33,6 +33,7 @@
|
|||
#include <linux/memcontrol.h>
|
||||
#include <linux/syscalls.h>
|
||||
#include <linux/hugetlb.h>
|
||||
#include <linux/hugetlb_cgroup.h>
|
||||
#include <linux/gfp.h>
|
||||
|
||||
#include <asm/tlbflush.h>
|
||||
|
|
@ -931,6 +932,10 @@ static int unmap_and_move_huge_page(new_page_t get_new_page,
|
|||
|
||||
if (anon_vma)
|
||||
put_anon_vma(anon_vma);
|
||||
|
||||
if (!rc)
|
||||
hugetlb_cgroup_migrate(hpage, new_hpage);
|
||||
|
||||
unlock_page(hpage);
|
||||
out:
|
||||
put_page(new_hpage);
|
||||
|
|
|
|||
Loading…
Reference in a new issue