From patchwork Mon Jan 14 16:20:24 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kirill Tkhai X-Patchwork-Id: 10763017 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 294F914E5 for ; Mon, 14 Jan 2019 16:20:31 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 188D7292C0 for ; Mon, 14 Jan 2019 16:20:31 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0CD0429486; Mon, 14 Jan 2019 16:20:31 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8EDC2294E7 for ; Mon, 14 Jan 2019 16:20:30 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 7E2508E000E; Mon, 14 Jan 2019 11:20:29 -0500 (EST) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 768258E0002; Mon, 14 Jan 2019 11:20:29 -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 631C68E000E; Mon, 14 Jan 2019 11:20:29 -0500 (EST) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-lj1-f198.google.com (mail-lj1-f198.google.com [209.85.208.198]) by kanga.kvack.org (Postfix) with ESMTP id E446F8E0002 for ; Mon, 14 Jan 2019 11:20:28 -0500 (EST) Received: by mail-lj1-f198.google.com with SMTP id k22-v6so5469732ljk.12 for ; Mon, 14 Jan 2019 08:20:28 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-original-authentication-results:x-gm-message-state:subject:from :to:date:message-id:user-agent:mime-version :content-transfer-encoding; bh=wrLBDh2If8P88TOGaR3/pMEMs2gdQk7Lu919K847epo=; b=fvytZFVm+r8w1H2GyKFmtKna6WBcQjUXdN0qYyX7efdIAAmY3yAIQaixVBYRG0Yly5 fGzXWNrMdELTbRxhcvTmQk+iQXo7mTuZh/9C+oVOg6JNB8mwNGQx7iTq2FKk4ejmkrJ7 6IT31EzlrkqoDXeaCaNM8rvQyhGswH2hP5sJk46cFhg8BTZ8W/i/d68++O85V26b8wyr /aZQXCJGZFb4zSz6wX58Y5qB0FrTBLgX8WEs9mw08wjBsGn1QN5yjL6g7NWqyxtz1R+Y bZIcMidbRB5JUOPKaQrtKZe57l4vtCpzLwoJnelcWKnjngY7PkA+mB8DsR3kfXQO3nBp 9Dxg== X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of ktkhai@virtuozzo.com designates 185.231.240.75 as permitted sender) smtp.mailfrom=ktkhai@virtuozzo.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=virtuozzo.com X-Gm-Message-State: AJcUukdith+H5pHVwbPLid7sjT8oYInwJ/cXXwysYQ9T7BhSVAyv85RS pkzqU1nG6WquY4NVzDKl2Iz8TKuj0bJjb3B72Xn++D/bbOSSJlF7P8+mTG6/cclwhLNHy9njgjf X+ov7WTzu5DeylVPA0RFZmeyh37w13E0/Z2zvSySimoTEgDf/T7mM8fJEmaTlOBQJ6g== X-Received: by 2002:a2e:8719:: with SMTP id m25-v6mr12260315lji.121.1547482828261; Mon, 14 Jan 2019 08:20:28 -0800 (PST) X-Google-Smtp-Source: ALg8bN7fdYhzZjERElm2wYnTJVXJlZ+V+3BMAmx2Y7K9rHasUNCzCjSMCDtMWrKFRS/r26XnJsky X-Received: by 2002:a2e:8719:: with SMTP id m25-v6mr12260239lji.121.1547482826841; Mon, 14 Jan 2019 08:20:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547482826; cv=none; d=google.com; s=arc-20160816; b=lHfHw3B8umvl9SFaRDqbb5HWX11+bp56Z0aSCqee8wEYDDG78gOK+h21vaSNrDWoiJ FDPBURneoFNZHdPV3BFKcAkPohC+F5JEi5GcvgA6B/2X6uq23MknTzvidwzXPsbondE0 aPFCbpmOFNLrpY5IvJ24NBKh2FOvRYYLG16QmqRax2RCTyyK/AcPx6o3h7Tdbfs4TrFA OU07rbSPIbMShABf9OLjoRKX/+XovcC3S6GXtzxnvHecxEjajC0Z8OgCedmafT2DKDDD IiGhOgecTl6NRU3am47KHlRZ4/qfQeZade3IfTUId2lE1G9wMUW9HRoyRHHu2ekvMGa3 Hsbg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:user-agent:message-id:date :to:from:subject; bh=wrLBDh2If8P88TOGaR3/pMEMs2gdQk7Lu919K847epo=; b=CdOfuK2RDiRh1aTyKSyP1dJGLGGqs4n9gqAcALJTeoRYia+mr4Bi93nt1sbLMOCTmN qOuDmHKqumO35LAbDt6tvnsxTIMkdIcpVp14Ku/KWP7aZ3X/QsxgAkceRj1zCh1NeRfm jVyPzn7Ndnrh5lMuapnaM/VCj5L+xsxsbcgCcjreea+M1xPlkK5eShZ07v19KkyfqJM9 Wct7A8JY7u4ukdMJFIPi6Iq7jvo2m9u0b+UbHOKF8PuCwALV8jDfy7RDpt3HeYe8LVl7 5H3PNI1ozCshzu33l95mp/CSeZy9qel/OVYD1OR/I/JdiZHNOLkPa+pQ6rlYKNN9JMoU m4Cg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of ktkhai@virtuozzo.com designates 185.231.240.75 as permitted sender) smtp.mailfrom=ktkhai@virtuozzo.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=virtuozzo.com Received: from relay.sw.ru (relay.sw.ru. [185.231.240.75]) by mx.google.com with ESMTPS id y7-v6si654518ljj.102.2019.01.14.08.20.26 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 14 Jan 2019 08:20:26 -0800 (PST) Received-SPF: pass (google.com: domain of ktkhai@virtuozzo.com designates 185.231.240.75 as permitted sender) client-ip=185.231.240.75; Authentication-Results: mx.google.com; spf=pass (google.com: domain of ktkhai@virtuozzo.com designates 185.231.240.75 as permitted sender) smtp.mailfrom=ktkhai@virtuozzo.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=virtuozzo.com Received: from [172.16.25.169] (helo=localhost.localdomain) by relay.sw.ru with esmtp (Exim 4.91) (envelope-from ) id 1gj4yP-0004dT-6S; Mon, 14 Jan 2019 19:20:25 +0300 Subject: [PATCH] mm: Remove 7th argument of isolate_lru_pages() From: Kirill Tkhai To: akpm@linux-foundation.org, mhocko@suse.com, ktkhai@virtuozzo.com, linux-mm@kvack.org Date: Mon, 14 Jan 2019 19:20:24 +0300 Message-ID: <154748280735.29962.15867846875217618569.stgit@localhost.localdomain> User-Agent: StGit/0.18 MIME-Version: 1.0 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: X-Virus-Scanned: ClamAV using ClamSMTP We may simply check for sc->may_unmap in isolate_lru_pages() instead of doing that in both of its callers. Signed-off-by: Kirill Tkhai Acked-by: Michal Hocko --- mm/vmscan.c | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/mm/vmscan.c b/mm/vmscan.c index a714c4f800e9..8202f8eb602d 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c @@ -1663,7 +1663,7 @@ static __always_inline void update_lru_sizes(struct lruvec *lruvec, static unsigned long isolate_lru_pages(unsigned long nr_to_scan, struct lruvec *lruvec, struct list_head *dst, unsigned long *nr_scanned, struct scan_control *sc, - isolate_mode_t mode, enum lru_list lru) + enum lru_list lru) { struct list_head *src = &lruvec->lists[lru]; unsigned long nr_taken = 0; @@ -1672,6 +1672,7 @@ static unsigned long isolate_lru_pages(unsigned long nr_to_scan, unsigned long skipped = 0; unsigned long scan, total_scan, nr_pages; LIST_HEAD(pages_skipped); + isolate_mode_t mode = (sc->may_unmap ? 0 : ISOLATE_UNMAPPED); scan = 0; for (total_scan = 0; @@ -1910,7 +1911,6 @@ shrink_inactive_list(unsigned long nr_to_scan, struct lruvec *lruvec, unsigned long nr_reclaimed = 0; unsigned long nr_taken; struct reclaim_stat stat = {}; - isolate_mode_t isolate_mode = 0; int file = is_file_lru(lru); struct pglist_data *pgdat = lruvec_pgdat(lruvec); struct zone_reclaim_stat *reclaim_stat = &lruvec->reclaim_stat; @@ -1931,13 +1931,10 @@ shrink_inactive_list(unsigned long nr_to_scan, struct lruvec *lruvec, lru_add_drain(); - if (!sc->may_unmap) - isolate_mode |= ISOLATE_UNMAPPED; - spin_lock_irq(&pgdat->lru_lock); nr_taken = isolate_lru_pages(nr_to_scan, lruvec, &page_list, - &nr_scanned, sc, isolate_mode, lru); + &nr_scanned, sc, lru); __mod_node_page_state(pgdat, NR_ISOLATED_ANON + file, nr_taken); reclaim_stat->recent_scanned[file] += nr_taken; @@ -2094,19 +2091,15 @@ static void shrink_active_list(unsigned long nr_to_scan, struct zone_reclaim_stat *reclaim_stat = &lruvec->reclaim_stat; unsigned nr_deactivate, nr_activate; unsigned nr_rotated = 0; - isolate_mode_t isolate_mode = 0; int file = is_file_lru(lru); struct pglist_data *pgdat = lruvec_pgdat(lruvec); lru_add_drain(); - if (!sc->may_unmap) - isolate_mode |= ISOLATE_UNMAPPED; - spin_lock_irq(&pgdat->lru_lock); nr_taken = isolate_lru_pages(nr_to_scan, lruvec, &l_hold, - &nr_scanned, sc, isolate_mode, lru); + &nr_scanned, sc, lru); __mod_node_page_state(pgdat, NR_ISOLATED_ANON + file, nr_taken); reclaim_stat->recent_scanned[file] += nr_taken;