Commit 0247f3f4 authored by James Morse's avatar James Morse Committed by Linus Torvalds
Browse files

mm/memcontrol.c: make the walk_page_range() limit obvious

mem_cgroup_count_precharge() and mem_cgroup_move_charge() both call
walk_page_range() on the range 0 to ~0UL, neither provide a pte_hole
callback, which causes the current implementation to skip non-vma
regions.  This is all fine but follow up changes would like to make
walk_page_range more generic so it is better to be explicit about which
range to traverse so let's use highest_vm_end to explicitly traverse
only user mmaped memory.

[ rewrote changelog]

Signed-off-by: default avatarJames Morse <>
Acked-by: default avatarNaoya Horiguchi <>
Cc: Johannes Weiner <>
Cc: Michal Hocko <>
Cc: Vladimir Davydov <>
Signed-off-by: default avatarAndrew Morton <>
Signed-off-by: default avatarLinus Torvalds <>
parent 6fcb52a5
......@@ -4681,7 +4681,8 @@ static unsigned long mem_cgroup_count_precharge(struct mm_struct *mm)
.mm = mm,
walk_page_range(0, ~0UL, &mem_cgroup_count_precharge_walk);
walk_page_range(0, mm->highest_vm_end,
precharge = mc.precharge;
......@@ -4969,7 +4970,8 @@ static void mem_cgroup_move_charge(void)
* When we have consumed all precharges and failed in doing
* additional charge, the page walk just aborts.
walk_page_range(0, ~0UL, &mem_cgroup_move_charge_walk);
walk_page_range(0,>highest_vm_end, &mem_cgroup_move_charge_walk);
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment