From patchwork Sun Dec 1 01:55:24 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Morton X-Patchwork-Id: 11268381 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 82E59921 for ; Sun, 1 Dec 2019 01:55:28 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 5056A208C3 for ; Sun, 1 Dec 2019 01:55:28 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="gxHvrEoT" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5056A208C3 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linux-foundation.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 498896B0326; Sat, 30 Nov 2019 20:55:27 -0500 (EST) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 421806B0328; Sat, 30 Nov 2019 20:55:27 -0500 (EST) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 2E9286B0329; Sat, 30 Nov 2019 20:55:27 -0500 (EST) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0133.hostedemail.com [216.40.44.133]) by kanga.kvack.org (Postfix) with ESMTP id 123936B0326 for ; Sat, 30 Nov 2019 20:55:27 -0500 (EST) Received: from smtpin21.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with SMTP id C0AB92C7C for ; Sun, 1 Dec 2019 01:55:26 +0000 (UTC) X-FDA: 76214905452.21.pain72_2f81fc2463b4c X-Spam-Summary: 2,0,0,6026af9875612be1,d41d8cd98f00b204,akpm@linux-foundation.org,:akpm@linux-foundation.org:aryabinin@virtuozzo.com:hannes@cmpxchg.org:jhubbard@nvidia.com::mgorman@techsingularity.net:mhocko@kernel.org:mm-commits@vger.kernel.org:riel@surriel.com:torvalds@linux-foundation.org:vbabka@suse.cz:william.kucharski@oracle.com,RULES_HIT:41:69:355:379:800:960:966:967:968:973:988:989:1260:1263:1345:1381:1431:1437:1535:1543:1711:1730:1747:1777:1792:2196:2198:2199:2200:2393:2525:2559:2563:2682:2685:2693:2859:2902:2933:2937:2939:2942:2945:2947:2951:2954:3022:3138:3139:3140:3141:3142:3355:3865:3867:3868:3871:3872:3934:3936:3938:3941:3944:3947:3950:3953:3956:3959:4321:4385:4605:5007:6119:6261:6653:6737:7576:7903:7974:7996:8599:9025:9545:10004:10913:11026:11473:11658:11914:12043:12048:12296:12297:12438:12517:12519:12555:12679:12783:12986:13846:14096:14181:14721:14849:21080:21325:21451:21611:21627:21939:30054:30064,0,RBL:error,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,Do mainCach X-HE-Tag: pain72_2f81fc2463b4c X-Filterd-Recvd-Size: 5209 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by imf26.hostedemail.com (Postfix) with ESMTP for ; Sun, 1 Dec 2019 01:55:26 +0000 (UTC) Received: from localhost.localdomain (c-73-231-172-41.hsd1.ca.comcast.net [73.231.172.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 53457208E4; Sun, 1 Dec 2019 01:55:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1575165325; bh=XGALu3sZP0/tYYPJ3ERo8kH7ajG0VBmkhcN1xJPi5wQ=; h=Date:From:To:Subject:From; b=gxHvrEoTwhQ3VbZJ61RU+hI4rmleahg3NjxcTolYiFJeJVeUwD9ucLW/Tf5SlChx8 9LvqFqZLJX1xqTUXxnOm+S4NQbSHTdhNS351S7RCYi/MfbD6L58VBI6dM5qLLHun6r i045LBFC8/ef27VHngDYUfSyfCjOjzD1PbGeMRlY= Date: Sat, 30 Nov 2019 17:55:24 -0800 From: akpm@linux-foundation.org To: akpm@linux-foundation.org, aryabinin@virtuozzo.com, hannes@cmpxchg.org, jhubbard@nvidia.com, linux-mm@kvack.org, mgorman@techsingularity.net, mhocko@kernel.org, mm-commits@vger.kernel.org, riel@surriel.com, torvalds@linux-foundation.org, vbabka@suse.cz, william.kucharski@oracle.com Subject: [patch 102/158] mm/vmscan: remove unused lru_pages argument Message-ID: <20191201015524.fXucDKo4z%akpm@linux-foundation.org> User-Agent: s-nail v14.8.16 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: From: Andrey Ryabinin Subject: mm/vmscan: remove unused lru_pages argument Since 9092c71bb724 ("mm: use sc->priority for slab shrink targets") the argument 'unsigned long *lru_pages' passed around with no purpose. Remove it. Link: http://lkml.kernel.org/r/20190228083329.31892-4-aryabinin@virtuozzo.com Signed-off-by: Andrey Ryabinin Acked-by: Johannes Weiner Acked-by: Vlastimil Babka Acked-by: Mel Gorman Cc: Michal Hocko Cc: Rik van Riel Cc: William Kucharski Cc: John Hubbard Signed-off-by: Andrew Morton --- mm/vmscan.c | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) --- a/mm/vmscan.c~mm-vmscan-remove-unused-lru_pages-argument +++ a/mm/vmscan.c @@ -2302,8 +2302,7 @@ enum scan_balance { * nr[2] = file inactive pages to scan; nr[3] = file active pages to scan */ static void get_scan_count(struct lruvec *lruvec, struct mem_cgroup *memcg, - struct scan_control *sc, unsigned long *nr, - unsigned long *lru_pages) + struct scan_control *sc, unsigned long *nr) { int swappiness = mem_cgroup_swappiness(memcg); struct zone_reclaim_stat *reclaim_stat = &lruvec->reclaim_stat; @@ -2454,7 +2453,6 @@ static void get_scan_count(struct lruvec fraction[1] = fp; denominator = ap + fp + 1; out: - *lru_pages = 0; for_each_evictable_lru(lru) { int file = is_file_lru(lru); unsigned long lruvec_size; @@ -2549,7 +2547,6 @@ out: BUG(); } - *lru_pages += lruvec_size; nr[lru] = scan; } } @@ -2558,7 +2555,7 @@ out: * This is a basic per-node page freer. Used by both kswapd and direct reclaim. */ static void shrink_node_memcg(struct pglist_data *pgdat, struct mem_cgroup *memcg, - struct scan_control *sc, unsigned long *lru_pages) + struct scan_control *sc) { struct lruvec *lruvec = mem_cgroup_lruvec(pgdat, memcg); unsigned long nr[NR_LRU_LISTS]; @@ -2570,7 +2567,7 @@ static void shrink_node_memcg(struct pgl struct blk_plug plug; bool scan_adjusted; - get_scan_count(lruvec, memcg, sc, nr, lru_pages); + get_scan_count(lruvec, memcg, sc, nr); /* Record the original scan target for proportional adjustments later */ memcpy(targets, nr, sizeof(nr)); @@ -2758,7 +2755,6 @@ static bool shrink_node(pg_data_t *pgdat do { struct mem_cgroup *root = sc->target_mem_cgroup; - unsigned long node_lru_pages = 0; struct mem_cgroup *memcg; memset(&sc->nr, 0, sizeof(sc->nr)); @@ -2768,7 +2764,6 @@ static bool shrink_node(pg_data_t *pgdat memcg = mem_cgroup_iter(root, NULL, NULL); do { - unsigned long lru_pages; unsigned long reclaimed; unsigned long scanned; @@ -2805,8 +2800,7 @@ static bool shrink_node(pg_data_t *pgdat reclaimed = sc->nr_reclaimed; scanned = sc->nr_scanned; - shrink_node_memcg(pgdat, memcg, sc, &lru_pages); - node_lru_pages += lru_pages; + shrink_node_memcg(pgdat, memcg, sc); shrink_slab(sc->gfp_mask, pgdat->node_id, memcg, sc->priority); @@ -3317,7 +3311,6 @@ unsigned long mem_cgroup_shrink_node(str .reclaim_idx = MAX_NR_ZONES - 1, .may_swap = !noswap, }; - unsigned long lru_pages; WARN_ON_ONCE(!current->reclaim_state); @@ -3334,7 +3327,7 @@ unsigned long mem_cgroup_shrink_node(str * will pick up pages from other mem cgroup's as well. We hack * the priority and make it zero. */ - shrink_node_memcg(pgdat, memcg, &sc, &lru_pages); + shrink_node_memcg(pgdat, memcg, &sc); trace_mm_vmscan_memcg_softlimit_reclaim_end(sc.nr_reclaimed);