OSDN Git Service

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)
commit2cf855837b89d92996cf264713f3bed2bf9b0b4f
treed2e61e78a5dce7925bebb7c50d345838aa948b4a
parentd09d8df3a29403693d9d20cc34ed101f2c558e2b
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