From: Andrey Ryabinin Date: Tue, 10 Apr 2018 23:27:55 +0000 (-0700) Subject: mm/vmscan: remove redundant current_may_throttle() check X-Git-Tag: v4.17-rc1~52^2~134 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=c4fd4fa58018bab781c17c8d92d70106a37b6a5c;p=users%2Fhch%2Fmisc.git mm/vmscan: remove redundant current_may_throttle() check Only kswapd can have non-zero nr_immediate, and current_may_throttle() is always true for kswapd (PF_LESS_THROTTLE bit is never set) thus it's enough to check stat.nr_immediate only. Link: http://lkml.kernel.org/r/20180315164553.17856-4-aryabinin@virtuozzo.com Signed-off-by: Andrey Ryabinin Acked-by: Michal Hocko Cc: Shakeel Butt Cc: Mel Gorman Cc: Tejun Heo Cc: Johannes Weiner Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/mm/vmscan.c b/mm/vmscan.c index 6d74b12099bd..403f59edd53e 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c @@ -1807,7 +1807,7 @@ shrink_inactive_list(unsigned long nr_to_scan, struct lruvec *lruvec, * that pages are cycling through the LRU faster than * they are written so also forcibly stall. */ - if (stat.nr_immediate && current_may_throttle()) + if (stat.nr_immediate) congestion_wait(BLK_RW_ASYNC, HZ/10); }