mm/vmscan: remove redundant current_may_throttle() check
authorAndrey Ryabinin <aryabinin@virtuozzo.com>
Tue, 10 Apr 2018 23:27:55 +0000 (16:27 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Wed, 11 Apr 2018 17:28:29 +0000 (10:28 -0700)
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 <aryabinin@virtuozzo.com>
Acked-by: Michal Hocko <mhocko@suse.com>
Cc: Shakeel Butt <shakeelb@google.com>
Cc: Mel Gorman <mgorman@techsingularity.net>
Cc: Tejun Heo <tj@kernel.org>
Cc: Johannes Weiner <hannes@cmpxchg.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
mm/vmscan.c

index 6d74b12099bdee287edb85640ad013a886402f1f..403f59edd53e9d58a59783be96d6c42627ca46a2 100644 (file)
@@ -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);
        }