From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D7D80C433E7 for ; Tue, 13 Oct 2020 23:52:11 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 6991F22200 for ; Tue, 13 Oct 2020 23:52:11 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="R97dwIHx" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6991F22200 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 F2E176B00BA; Tue, 13 Oct 2020 19:52:10 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id EB89B6B00BB; Tue, 13 Oct 2020 19:52:10 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id DA70E900002; Tue, 13 Oct 2020 19:52:10 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0163.hostedemail.com [216.40.44.163]) by kanga.kvack.org (Postfix) with ESMTP id A9A866B00BA for ; Tue, 13 Oct 2020 19:52:10 -0400 (EDT) Received: from smtpin07.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 40B6D181AEF00 for ; Tue, 13 Oct 2020 23:52:10 +0000 (UTC) X-FDA: 77368553220.07.oil73_1d1782d27207 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin07.hostedemail.com (Postfix) with ESMTP id 2799C1803F9A9 for ; Tue, 13 Oct 2020 23:52:10 +0000 (UTC) X-HE-Tag: oil73_1d1782d27207 X-Filterd-Recvd-Size: 4386 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by imf44.hostedemail.com (Postfix) with ESMTP for ; Tue, 13 Oct 2020 23:52:09 +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 6C1E4221FF; Tue, 13 Oct 2020 23:52:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1602633129; bh=3Oh9NoQfOfeuqoJnuHiHWrmYR6Nn6zNwERHM9YBzDL4=; h=Date:From:To:Subject:In-Reply-To:From; b=R97dwIHxseoA0RgCSzYdqDNoB8rxKklkqntgQu+HGvFuAs4l4aeLj3RfF0g0Dxpzw ObrwWQa9mWVODt3O1q5+S5xIvfrvw1UqU4r817wsEFmYKWAO3uMB0r8LtNFIUfshjv Xcva0Y8w5yaB9TVzVRqeHJT8Cl/IMAwGBQTE+bpg= Date: Tue, 13 Oct 2020 16:52:08 -0700 From: Andrew Morton To: akpm@linux-foundation.org, alexander.h.duyck@linux.intel.com, cai@lca.pw, david@redhat.com, hughd@google.com, iamjoonsoo.kim@lge.com, linux-mm@kvack.org, mgorman@techsingularity.net, mhocko@suse.com, mm-commits@vger.kernel.org, npiggin@gmail.com, shy828301@gmail.com, torvalds@linux-foundation.org, ying.huang@intel.com, yuzhao@google.com Subject: [patch 069/181] mm: remove activate_page() from unuse_pte() Message-ID: <20201013235208.LREX_xdii%akpm@linux-foundation.org> In-Reply-To: <20201013164658.3bfd96cc224d8923e66a9f4e@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: Yu Zhao Subject: mm: remove activate_page() from unuse_pte() We don't initially add anon pages to active lruvec after commit b518154e59aa ("mm/vmscan: protect the workingset on anonymous LRU"). Remove activate_page() from unuse_pte(), which seems to be missed by the commit. And make the function static while we are at it. Before the commit, we called lru_cache_add_active_or_unevictable() to add new ksm pages to active lruvec. Therefore, activate_page() wasn't necessary for them in the first place. Link: http://lkml.kernel.org/r/20200818184704.3625199-1-yuzhao@google.com Signed-off-by: Yu Zhao Reviewed-by: Yang Shi Cc: Alexander Duyck Cc: Huang Ying Cc: David Hildenbrand Cc: Michal Hocko Cc: Qian Cai Cc: Mel Gorman Cc: Nicholas Piggin Cc: Hugh Dickins Cc: Joonsoo Kim Signed-off-by: Andrew Morton --- include/linux/swap.h | 1 - mm/swap.c | 4 ++-- mm/swapfile.c | 5 ----- 3 files changed, 2 insertions(+), 8 deletions(-) --- a/include/linux/swap.h~mm-remove-activate_page-from-unuse_pte +++ a/include/linux/swap.h @@ -340,7 +340,6 @@ extern void lru_note_cost_page(struct pa extern void lru_cache_add(struct page *); extern void lru_add_page_tail(struct page *page, struct page *page_tail, struct lruvec *lruvec, struct list_head *head); -extern void activate_page(struct page *); extern void mark_page_accessed(struct page *); extern void lru_add_drain(void); extern void lru_add_drain_cpu(int cpu); --- a/mm/swap.c~mm-remove-activate_page-from-unuse_pte +++ a/mm/swap.c @@ -348,7 +348,7 @@ static bool need_activate_page_drain(int return pagevec_count(&per_cpu(lru_pvecs.activate_page, cpu)) != 0; } -void activate_page(struct page *page) +static void activate_page(struct page *page) { page = compound_head(page); if (PageLRU(page) && !PageActive(page) && !PageUnevictable(page)) { @@ -368,7 +368,7 @@ static inline void activate_page_drain(i { } -void activate_page(struct page *page) +static void activate_page(struct page *page) { pg_data_t *pgdat = page_pgdat(page); --- a/mm/swapfile.c~mm-remove-activate_page-from-unuse_pte +++ a/mm/swapfile.c @@ -1929,11 +1929,6 @@ static int unuse_pte(struct vm_area_stru lru_cache_add_inactive_or_unevictable(page, vma); } swap_free(entry); - /* - * Move the page to the active list so it is not - * immediately swapped out again after swapon. - */ - activate_page(page); out: pte_unmap_unlock(pte, ptl); if (page != swapcache) { _