Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp329027pxx; Thu, 29 Oct 2020 03:48:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz4+UQQscABjEz3Ro5WiTkAZYCnE/6GcoO7vIaefnX+KhdihQBpMF4PHGIWJUmoU5Nm2diO X-Received: by 2002:a05:6402:10c7:: with SMTP id p7mr3315891edu.34.1603968513666; Thu, 29 Oct 2020 03:48:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603968513; cv=none; d=google.com; s=arc-20160816; b=TvScMXF7xZHlGU9iDEibDeL0MUcmTmHwoMTHR7BeLsha2Z/gXm+iWvJKbRHaVKJHCw R7QozhSdsAXt+IvJ9i7KG27EhzVdYXQTqv5P5n377r+6b1ApAI6tIAEHSMC2xAjxXbya ETz1mg8BeIR/r02lba2G+NhWYG07NYOA9BVb3bIIOilrWoCYTikBKVDWbvTA7JQx+Etp i5WD9Lyy3NpQPkAxVuLYXcYLWqsId905p4JsBJyDfMpryI+NmZIs6LZT+U6yg89r/5Ce 4n7g171Ny930hgtYRi9efXR1h86OBGwcxhIAPZdvBzGcgV4hIrQz2MxNYBWQn3EZhNvM G8DA== 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=n8EiQDRnQAxsL9FUHbey2F5g9SOsmk27fd6W3WnsqMJBCqpmFbDuf7bzLlNa9vLaM4 B0f1JQuXPHlF6FZ5wHPeyI6BIzXw6THgHN/v6XKiAW0oWgFXJvkFENrHAZcpwIggOrHb FHYGxDsXCX1mZ2mtau7Mk2O5nq7YnwZdhw2Nd5+oo9nZd2kk1uMBp3V97GM02mQZhLDu FqiZ8zl7yFyX5vMO2zz/f1I15WRAAMHaLycVJHLC7xAUf3ii9zl8LhTs5M5/+uLKZcxj iLtyJbxXXk7eYrJ1eeCkWfqUu0h+aWWljFvsQmCUZA2w/1CdFAmxYuD3uE1RA8CdvY6D yWgg== 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 l27si1415730ejg.591.2020.10.29.03.48.11; Thu, 29 Oct 2020 03:48:33 -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 S1727073AbgJ2KqP (ORCPT + 99 others); Thu, 29 Oct 2020 06:46:15 -0400 Received: from out30-130.freemail.mail.aliyun.com ([115.124.30.130]:52646 "EHLO out30-130.freemail.mail.aliyun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726843AbgJ2Kpm (ORCPT ); Thu, 29 Oct 2020 06:45:42 -0400 X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R271e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01e01424;MF=alex.shi@linux.alibaba.com;NM=1;PH=DS;RN=23;SR=0;TI=SMTPD_---0UDXwDyN_1603968328; Received: from aliy80.localdomain(mailfrom:alex.shi@linux.alibaba.com fp:SMTPD_---0UDXwDyN_1603968328) by smtp.aliyun-inc.com(127.0.0.1); Thu, 29 Oct 2020 18:45:34 +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 Cc: "Kirill A. Shutemov" , Vlastimil Babka Subject: [PATCH v20 14/20] mm/mlock: remove __munlock_isolate_lru_page Date: Thu, 29 Oct 2020 18:44:59 +0800 Message-Id: <1603968305-8026-15-git-send-email-alex.shi@linux.alibaba.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1603968305-8026-1-git-send-email-alex.shi@linux.alibaba.com> References: <1603968305-8026-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