]> git.baikalelectronics.ru Git - kernel.git/commit
memcontrol: schedule throttling if we are congested
authorTejun Heo <tj@kernel.org>
Tue, 3 Jul 2018 15:14:56 +0000 (11:14 -0400)
committerJens Axboe <axboe@kernel.dk>
Mon, 9 Jul 2018 15:07:54 +0000 (09:07 -0600)
commit0041ffe490507d3d88c598506baa4fdabd92ee0f
treed2e61e78a5dce7925bebb7c50d345838aa948b4a
parentccde7bc7c2b85daa7b80b06c2daa4ee44a3ec7eb
memcontrol: schedule throttling if we are congested

Memory allocations can induce swapping via kswapd or direct reclaim.  If
we are having IO done for us by kswapd and don't actually go into direct
reclaim we may never get scheduled for throttling.  So instead check to
see if our cgroup is congested, and if so schedule the throttling.
Before we return to user space the throttling stuff will only throttle
if we actually required it.

Signed-off-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Josef Bacik <jbacik@fb.com>
Acked-by: Johannes Weiner <hannes@cmpxchg.org>
Acked-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
include/linux/memcontrol.h
include/linux/swap.h
mm/huge_memory.c
mm/memcontrol.c
mm/memory.c
mm/shmem.c
mm/swapfile.c