mm, memcg: fix corruption on 64-bit divisor in memory.high throttling

Commit 0e4b01df8659 had a bunch of fixups to use the right division
method.  However, it seems that after all that it still wasn't right --
div_u64 takes a 32-bit divisor.

The headroom is still large (2^32 pages), so on mundane systems you
won't hit this, but this should definitely be fixed.

Fixes: 0e4b01df8659 ("mm, memcg: throttle allocators when failing reclaim over memory.high")
Reported-by: Johannes Weiner <>
Signed-off-by: Chris Down <>
Signed-off-by: Andrew Morton <>
Acked-by: Johannes Weiner <>
Cc: Tejun Heo <>
Cc: Roman Gushchin <>
Cc: Michal Hocko <>
Cc: Nathan Chancellor <>
Cc: <>	[5.4.x+]
Signed-off-by: Linus Torvalds <>
1 file changed