Received: by 10.213.65.68 with SMTP id h4csp465779imn; Fri, 23 Mar 2018 08:22:17 -0700 (PDT) X-Google-Smtp-Source: AG47ELtcJ9XIfbFk+a3eX41g2pvhEQJWN6KXD5vcX51RmW7pXzI2Clmhsg48oEoEPqKYFM8sZ2kb X-Received: by 2002:a17:902:5388:: with SMTP id c8-v6mr19081345pli.90.1521818537627; Fri, 23 Mar 2018 08:22:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521818537; cv=none; d=google.com; s=arc-20160816; b=Bzvv0tZ1+AJi9geh8mB+2/6EjyVEHEduEsGSyFWXZdngCMIeGRGcry88BqIauyigkc xkqUkP7fSLdu1uOmdoriMGFe7C/RnqAph7x/55hJOJBQPLGWjYdor9kPsxvqJZblYqjD UmHqMitD/EkmdoCcsBUgKvjOWwgdceHPvSD0uMfWqVpv0qu9PYtNLV1m18dd7ALB++Ku KDXpPH1Sf4BXCks77okCHb3gF3fWsjOdizZvbe5AP6Ejtggyn5IOsS/gwQLiTxyBlLs+ mppsAPqt4Zym2LfYzKg9OAtyPL+ZJTOtB1JhcAmEmBSBbJM9hKS2Xc0AdbpuW5B/vs0U lPpw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:spamdiagnosticmetadata :spamdiagnosticoutput:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature:arc-authentication-results; bh=meYmxX9z9mCik64rbClE5+1kbzT/+N4qr5R4QpZxW4w=; b=r+79cazDNb9kROh9LDPYeOhm/RMvJ5ncdl9//rsNa30owQzbF769C9fcwiUQYlHDZ3 6uIbr+cW9RshznD76N4BT+DJ4gCvfG5mql4odrCG48IpxEJMHpxRyVhWGbRyM6NqKbAT 5lm/3LEAxaONc7UNZZi/zKMyFTE6uTW7MT9Gu/EXcoawrYt5aiK+ml+ON0UbWYpjybER jONK8Z46mU6yGxUiI7zr+hK8GyYqdwFI8S2JkXCB3zu76kHjp2HMAeP3PHewaLM0jrcc bH8bhjVcZ9VvMTD3Z5oNfBpNIuRvRfh+mOqKZQZdc6HHxmn2o3zAA2E/7vAkKm5fQG6U 9Vwg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@virtuozzo.com header.s=selector1 header.b=f8HSQTLq; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=virtuozzo.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s11si6253928pgn.207.2018.03.23.08.22.03; Fri, 23 Mar 2018 08:22:17 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@virtuozzo.com header.s=selector1 header.b=f8HSQTLq; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=virtuozzo.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752019AbeCWPUK (ORCPT + 99 others); Fri, 23 Mar 2018 11:20:10 -0400 Received: from mail-he1eur01on0107.outbound.protection.outlook.com ([104.47.0.107]:19840 "EHLO EUR01-HE1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751400AbeCWPUG (ORCPT ); Fri, 23 Mar 2018 11:20:06 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=virtuozzo.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=meYmxX9z9mCik64rbClE5+1kbzT/+N4qr5R4QpZxW4w=; b=f8HSQTLqohHWd1INhJVfjYzAxRHiyeFcE0v8auaUoxC2UzjZKjddltYNaQ1d2g8+QBTPXjCbo3Byz/mv+tG1eG1czaXidIbCkxfoixC/fwGhQW3ZHqxqhPPcviZd3iaQxd9UqvA9soXHPqnnl1pRgkEIJ/ssE8Xct27QJD72MNs= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=aryabinin@virtuozzo.com; Received: from i7.sw.ru (195.214.232.6) by AM6PR08MB3253.eurprd08.prod.outlook.com (2603:10a6:209:47::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.609.10; Fri, 23 Mar 2018 15:20:00 +0000 From: Andrey Ryabinin To: Andrew Morton Cc: Andrey Ryabinin , Mel Gorman , Tejun Heo , Johannes Weiner , Michal Hocko , Shakeel Butt , Steven Rostedt , linux-mm@kvack.org, linux-kernel@vger.kernel.org, cgroups@vger.kernel.org Subject: [PATCH v2 2/4] mm/vmscan: remove redundant current_may_throttle() check Date: Fri, 23 Mar 2018 18:20:27 +0300 Message-Id: <20180323152029.11084-3-aryabinin@virtuozzo.com> X-Mailer: git-send-email 2.16.1 In-Reply-To: <20180323152029.11084-1-aryabinin@virtuozzo.com> References: <20180323152029.11084-1-aryabinin@virtuozzo.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [195.214.232.6] X-ClientProxiedBy: HE1PR0101CA0011.eurprd01.prod.exchangelabs.com (2603:10a6:3:77::21) To AM6PR08MB3253.eurprd08.prod.outlook.com (2603:10a6:209:47::18) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 3eef8b2a-4bcc-400e-00cb-08d590d18bd1 X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(5600026)(4604075)(4534165)(7168020)(4627221)(201703031133081)(201702281549075)(2017052603328)(7153060)(7193020);SRVR:AM6PR08MB3253; X-Microsoft-Exchange-Diagnostics: 1;AM6PR08MB3253;3:jkoGO6DJSCUCO20AOjUIiSnOijEb/ZL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WamByh1wOJZpRydj6JB26/1g09P9rDYpd6CkAUBw3+znpYN/esYGIsod+l3cvCI4T661CDaXE32D/d8ryooYGwOwEz1NrA3qC0TWvo+jjYpQwwVWnjw7NmGQ0iEdyrRzKnLKj3PaM77gI0quh4H2OZYCLx2iz4d+Qg7NDOZbIIF5ORN59QTXpIr5+WvKVuspxbTU0PZts+3AcYN/cTcwa4l9YCToRDTzOOsuUmfxyybM7q+n4cNJGZA+i2lhM3M6ziGv4o9eb2BKpBin2uYiesJw+wcmprWlqWccPcH7IYYY+NDY5T5Nop5JazKzPz;4:Ey0PvH7kNhuixM4kRIigwTnlK4NnxIAlbqSPlNG9m+vcQkWl6/5e6khqVYYnYBx6cUzXuPzJnnB9Q+yiePw3juThD9Kvajmx+ALahPacQ2PRWKTML64VRogoYII1n8IAot/6rjcDHUKWpnqE0o8JERB9O+8IhNFsQs/AC+MO86+50z1xlo/scQkqUNw/c5At2W3MSZZeiIoz0gc2aix0AeQhabrvfdhLcyF8cfEZvARbOAPXayf7L8WAFQ0nTNfYXIQsws2FsmksM4lPaLk2Bg== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(6040522)(2401047)(5005006)(8121501046)(3231221)(944501327)(52105095)(93006095)(93001095)(10201501046)(3002001)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(20161123564045)(20161123560045)(20161123562045)(6072148)(201708071742011);SRVR:AM6PR08MB3253;BCL:0;PCL:0;RULEID:;SRVR:AM6PR08MB3253; X-Forefront-PRVS: 0620CADDF3 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10019020)(346002)(39850400004)(39380400002)(366004)(396003)(376002)(189003)(199004)(36756003)(25786009)(186003)(97736004)(1076002)(3846002)(53416004)(478600001)(48376002)(11346002)(50466002)(66066001)(47776003)(105586002)(106356001)(53936002)(305945005)(6512007)(4326008)(7736002)(50226002)(81156014)(8936002)(52116002)(6666003)(54906003)(76176011)(81166006)(386003)(86362001)(6506007)(7416002)(2906002)(59450400001)(51416003)(316002)(68736007)(55236004)(6486002)(446003)(6116002)(6916009)(5660300001)(16586007)(8676002)(26005)(16526019);DIR:OUT;SFP:1102;SCL:1;SRVR:AM6PR08MB3253;H:i7.sw.ru;FPR:;SPF:None;PTR:InfoNoRecords;MX:1;A:1;LANG:en; Received-SPF: None (protection.outlook.com: virtuozzo.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;AM6PR08MB3253;23:pXV9Lh6I/NnY2nqbGYadDxYz5bKiAVn4gRcNKPoRd?= =?us-ascii?Q?IZ186IUEWklR2Alu8XIN8+jCUxuANYb+WcEr6itD7ti1I7zP5sUC4l8HfXuI?= =?us-ascii?Q?JVUrvrmHqNHj9rNVhjeClniWtIX7Lhq8xCkjgMLLNiLhjawBhVjDCWfgPTGQ?= =?us-ascii?Q?/2L1D4A4o8vDc3OaSOnd1XYO025jT7uoVG6z/bs7y++aoB18W6fMekgJNW2q?= =?us-ascii?Q?q0CMYWp7awm7CUpzJVyUYfVEWF8iX8uzBRnEBf24cVY/rOtdyhxtcV4xdQxL?= =?us-ascii?Q?ToG26GC1wH7/W4Lj6rzxa7OMKBI7jGlsa7Ls/woBAXkTevH2W9tcghGujLhc?= =?us-ascii?Q?L/mMwRqUO3+S69vCq07hPlyfjcakHMteSoWhXB5BIR4yl+8vjE69HOME6mYL?= =?us-ascii?Q?Zi2U71WnBlFzuEYSak2q+rQIa/BWWlCmZ5PfmkWjJ+f7qBA9Dqijj6q4YZMA?= =?us-ascii?Q?v3Nl0//c+eIpTq/rfYRD03lFkMZFX3GZWngIRmJuuY1f2ubLDBPl+vS85Bgi?= =?us-ascii?Q?7Blb5ZpuPA8D7qIqTqJYhML6P//S8Ukbpl3DFq77m7jMUkEcAoURB80p2dKc?= =?us-ascii?Q?EkMVCbuQJelo6xD043nlHPjSSxpvgl+YlhoQkFCopEOiIYZM14ujCHvMSYc1?= =?us-ascii?Q?OCp5H5Tvh65ak/TDF+WuvYaWRw/lqQuEyBIxJkkKZqtlABESdslNENAqJMjz?= =?us-ascii?Q?Pm5RXr0KBzutWCzJTO1enr5OZBJAs15B1N8sp51oStrPM1yyFjMpN2U0HnlD?= =?us-ascii?Q?swrPoK1VjC61anQu3o2pA4AzzA+qMOMKO4mXSDaZrw/4imbIXDa0GHGIhlyC?= =?us-ascii?Q?yFJ/7p9iM+ZvPl+4JJQqn+Cp5cTrKyQRJKRCz3V13I+njVMvIVeHsk1GOVBr?= =?us-ascii?Q?Kb39UkjGg45H92b7FycUA5zdcpjjcSIum0Jv5/gLVwlgaQ1qP7MK1qR/bua9?= =?us-ascii?Q?oe3t72PcObV3z9nIusTcUqjgDmE/c27jHQAaeLA47sb9UNa3z7ayAaazi9FU?= =?us-ascii?Q?l8ywv2rMWZhVFM6voZ47rCoUp+BByAbqaazxP789lF4WxuyAHLSduoCH1s56?= =?us-ascii?Q?jv8EhgLrS8FqIbNq5b6d+pSijfMFv+a1zLQVTTStT9EsqE+btFUeovincYPI?= =?us-ascii?Q?UsIDBgDu1T6r42oiWcTWEFjs9h6XqXvo6RxCff4+/t/Jn9/V/ePyaoyFJTfD?= =?us-ascii?Q?RECFiJYWsD8pj5oTfY9oHQGeBMIEDm93WgF7dqFuW4TxVREQXuD3+7c7qv0z?= =?us-ascii?Q?BQMwe1VuKRhMH8zbNc=3D?= X-Microsoft-Antispam-Message-Info: yZ4KmyXYWzwX0mr8B0F1xrFUdzn30CjreZ0yvKqS9KhXy4LBGoqrO8sPHKUkio2clFHxK5x/6yr26ykjWPBhA05g6g83sfVvr66LMgozrojSDpi8z9DXzXVDSowBy95RHH+MUrFu07nJRNEHMnWxLc10k0NrHlXzGyuVHzDzTMOhxEMc0pTncBxhit7bGdaQ X-Microsoft-Exchange-Diagnostics: 1;AM6PR08MB3253;6:ElpDxo7lceDpeYAJpqZ4V96EVcOjZduv5TGOu8SndIK4XyI6L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Zgw9ZaeIdvrdT569qSFd/k3k5Wr8V6I834aYPmAwnONMncodlmKjwjdosrIMq5zrWSEtKPys1DOT2Z41YYG0CPqlSkKnQZ25t77HkOv1R7B+O0G0LjZqyC8S1AA2AWaR7Og= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 23 Mar 2018 15:20:00.3588 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 3eef8b2a-4bcc-400e-00cb-08d590d18bd1 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 0bc7f26d-0264-416e-a6fc-8352af79c58f X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM6PR08MB3253 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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 Acked-by: Michal Hocko --- mm/vmscan.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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); } -- 2.16.1