Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp13209pxk; Wed, 23 Sep 2020 20:34:02 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxjhoMdiE8s7N0CIFrRgu9i4f5P1qFUAd2PqAnJXZ1cSMVYV7nTOxsbWRQvz4y296xf9+CA X-Received: by 2002:a17:906:4046:: with SMTP id y6mr2750859ejj.148.1600918442629; Wed, 23 Sep 2020 20:34:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600918442; cv=none; d=google.com; s=arc-20160816; b=USryYS70uHmFHyiMzpRvHuHmgmds3XpMNuo/XQDgfnotbPwGArLEj+qmYLyX4S8zMH /d0MBnWO5Ei0lOf+hKXVNiahJYMash25/vwejdFWewuvGvSxHRtP4Y8hcvHFwXFD/odp f8fFFsa0BlEaUkw0reoJ2VcRPBv/wo2IHr8zBW8IsooGrtIphQDB3o5qV5r2B/fVf1Ks R6qU4i6hzAZrm/tJ88VzFn+X+QtQS1DiYV+/FtZNqcyoJGjChIHllngEwErucqVUJ5gD DdCwIkmD7m3DRxE0iuArV2g10lo5JNDCJdxnHJftO8FouQwerlbVHRaPnhlAkokwZwgk 2ZJA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:in-reply-to:message-id:date:subject :cc:to:from; bh=ZJARdfqOKYCUOFceG3DbJYd3xgpGteIPOnjLw7NUHwM=; b=puIv2zgiguWORCFZNhPRKFxhhnWvPFme4wKRw/f6JDl+7oYxHQJ/rVV9mihSq/cg1R bXm75nmlHSzk0gzTMTXtue33r8ixsnu1L/nfZcjXczylgqjEXKomxD3v7B+lPZtd7oZq s9xRdPwh4pj+w+CtSGGJM24f0A35UkX4EkEAp1buvVL3cBdg7p89DT5aYs9/Ui8ZiXwv SfvbIg7RjAZzNFy8oCwgZMPE2hu8/SpW/pfTulQekZQm9ml57tJAuZecJprMWm/KXDUp Qbp2uKllL2LcTNss9tW5NN+xKkXFVujmAL1s7v3kHLd6N7Na1iTImmCdXtoXyNinHQIV y3Pg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c21si1344684edx.296.2020.09.23.20.33.39; Wed, 23 Sep 2020 20:34:02 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726840AbgIXD3p (ORCPT + 99 others); Wed, 23 Sep 2020 23:29:45 -0400 Received: from out30-44.freemail.mail.aliyun.com ([115.124.30.44]:49672 "EHLO out30-44.freemail.mail.aliyun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726702AbgIXD2s (ORCPT ); Wed, 23 Sep 2020 23:28:48 -0400 X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R261e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01e04420;MF=alex.shi@linux.alibaba.com;NM=1;PH=DS;RN=24;SR=0;TI=SMTPD_---0U9w0Ss1_1600918116; Received: from aliy80.localdomain(mailfrom:alex.shi@linux.alibaba.com fp:SMTPD_---0U9w0Ss1_1600918116) by smtp.aliyun-inc.com(127.0.0.1); Thu, 24 Sep 2020 11:28:43 +0800 From: Alex Shi To: akpm@linux-foundation.org, mgorman@techsingularity.net, tj@kernel.org, hughd@google.com, khlebnikov@yandex-team.ru, daniel.m.jordan@oracle.com, willy@infradead.org, hannes@cmpxchg.org, lkp@intel.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org, cgroups@vger.kernel.org, shakeelb@google.com, iamjoonsoo.kim@lge.com, richard.weiyang@gmail.com, kirill@shutemov.name, alexander.duyck@gmail.com, rong.a.chen@intel.com, mhocko@suse.com, vdavydov.dev@gmail.com, shy828301@gmail.com, aaron.lwe@gmail.com Cc: "Kirill A. Shutemov" , Vlastimil Babka Subject: [PATCH v19 14/20] mm/mlock: remove __munlock_isolate_lru_page Date: Thu, 24 Sep 2020 11:28:29 +0800 Message-Id: <1600918115-22007-15-git-send-email-alex.shi@linux.alibaba.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1600918115-22007-1-git-send-email-alex.shi@linux.alibaba.com> References: <1600918115-22007-1-git-send-email-alex.shi@linux.alibaba.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The func only has one caller, remove it to clean up code and simplify code. Signed-off-by: Alex Shi Acked-by: Hugh Dickins Cc: Hugh Dickins Cc: Kirill A. Shutemov Cc: Vlastimil Babka Cc: Andrew Morton Cc: linux-mm@kvack.org Cc: linux-kernel@vger.kernel.org --- mm/mlock.c | 31 +++++++++---------------------- 1 file changed, 9 insertions(+), 22 deletions(-) diff --git a/mm/mlock.c b/mm/mlock.c index 796c726a0407..d487aa864e86 100644 --- a/mm/mlock.c +++ b/mm/mlock.c @@ -106,26 +106,6 @@ void mlock_vma_page(struct page *page) } /* - * Isolate a page from LRU with optional get_page() pin. - * Assumes lru_lock already held and page already pinned. - */ -static bool __munlock_isolate_lru_page(struct page *page, bool getpage) -{ - if (PageLRU(page)) { - struct lruvec *lruvec; - - lruvec = mem_cgroup_page_lruvec(page, page_pgdat(page)); - if (getpage) - get_page(page); - ClearPageLRU(page); - del_page_from_lru_list(page, lruvec, page_lru(page)); - return true; - } - - return false; -} - -/* * Finish munlock after successful page isolation * * Page must be locked. This is a wrapper for try_to_munlock() @@ -296,9 +276,16 @@ static void __munlock_pagevec(struct pagevec *pvec, struct zone *zone) * We already have pin from follow_page_mask() * so we can spare the get_page() here. */ - if (__munlock_isolate_lru_page(page, false)) + if (PageLRU(page)) { + struct lruvec *lruvec; + + ClearPageLRU(page); + lruvec = mem_cgroup_page_lruvec(page, + page_pgdat(page)); + del_page_from_lru_list(page, lruvec, + page_lru(page)); continue; - else + } else __munlock_isolation_failed(page); } else { delta_munlocked++; -- 1.8.3.1