]> git.baikalelectronics.ru Git - kernel.git/commit
mm, memcg: fix corruption on 64-bit divisor in memory.high throttling
authorChris Down <chris@chrisdown.name>
Sun, 22 Mar 2020 01:22:20 +0000 (18:22 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Sun, 22 Mar 2020 01:56:06 +0000 (18:56 -0700)
commit6f9e594af100890d34cb3922971187a91633d68e
tree8cfe10ae8aa3e16783822ad867e1d5b8b615228a
parentb78ae5b0496f4a5c4db5f9b49e360a98959811d6
mm, memcg: fix corruption on 64-bit divisor in memory.high throttling

Commit d5e7ccefdea7 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: d5e7ccefdea7 ("mm, memcg: throttle allocators when failing reclaim over memory.high")
Reported-by: Johannes Weiner <hannes@cmpxchg.org>
Signed-off-by: Chris Down <chris@chrisdown.name>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Acked-by: Johannes Weiner <hannes@cmpxchg.org>
Cc: Tejun Heo <tj@kernel.org>
Cc: Roman Gushchin <guro@fb.com>
Cc: Michal Hocko <mhocko@kernel.org>
Cc: Nathan Chancellor <natechancellor@gmail.com>
Cc: <stable@vger.kernel.org> [5.4.x+]
Link: http://lkml.kernel.org/r/80780887060514967d414b3cd91f9a316a16ab98.1584036142.git.chris@chrisdown.name
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
mm/memcontrol.c