From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pf0-f197.google.com (mail-pf0-f197.google.com [209.85.192.197]) by kanga.kvack.org (Postfix) with ESMTP id 9ADAB6B000C for ; Thu, 15 Mar 2018 12:45:56 -0400 (EDT) Received: by mail-pf0-f197.google.com with SMTP id s25so3491790pfh.9 for ; Thu, 15 Mar 2018 09:45:56 -0700 (PDT) Received: from EUR01-DB5-obe.outbound.protection.outlook.com (mail-db5eur01on0138.outbound.protection.outlook.com. [104.47.2.138]) by mx.google.com with ESMTPS id o2si4068393pfg.286.2018.03.15.09.45.55 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 15 Mar 2018 09:45:55 -0700 (PDT) From: Andrey Ryabinin Subject: [PATCH 4/6] mm/vmscan: remove redundant current_may_throttle() check Date: Thu, 15 Mar 2018 19:45:51 +0300 Message-Id: <20180315164553.17856-4-aryabinin@virtuozzo.com> In-Reply-To: <20180315164553.17856-1-aryabinin@virtuozzo.com> References: <20180315164553.17856-1-aryabinin@virtuozzo.com> MIME-Version: 1.0 Content-Type: text/plain Sender: owner-linux-mm@kvack.org List-ID: To: Andrew Morton Cc: Andrey Ryabinin , Mel Gorman , Tejun Heo , Johannes Weiner , Michal Hocko , linux-mm@kvack.org, linux-kernel@vger.kernel.org, cgroups@vger.kernel.org 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. Signed-off-by: Andrey Ryabinin --- mm/vmscan.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/vmscan.c b/mm/vmscan.c index 0d5ab312a7f4..a8f6e4882e00 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c @@ -1806,7 +1806,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); } -- 2.16.1