From patchwork Mon Sep 28 17:54:11 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zi Yan X-Patchwork-Id: 11804469 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 79C986CA for ; Mon, 28 Sep 2020 17:55:58 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 304EE21924 for ; Mon, 28 Sep 2020 17:55:57 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=sent.com header.i=@sent.com header.b="RIm6Hu50"; dkim=temperror (0-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="S2bT/ZI0" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 304EE21924 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=sent.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 9C9F090000F; Mon, 28 Sep 2020 13:55:27 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 9772F90000B; Mon, 28 Sep 2020 13:55:27 -0400 (EDT) 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 6E30690000F; Mon, 28 Sep 2020 13:55:27 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0085.hostedemail.com [216.40.44.85]) by kanga.kvack.org (Postfix) with ESMTP id 36D2990000D for ; Mon, 28 Sep 2020 13:55:27 -0400 (EDT) Received: from smtpin24.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 1F76D8249980 for ; Mon, 28 Sep 2020 17:55:26 +0000 (UTC) X-FDA: 77313222252.24.seed78_4c0a37527183 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin24.hostedemail.com (Postfix) with ESMTP id 060F81A4A0 for ; Mon, 28 Sep 2020 17:55:26 +0000 (UTC) X-Spam-Summary: 1,0,0,56438345c8f07fb7,d41d8cd98f00b204,zi.yan@sent.com,,RULES_HIT:41:355:379:541:560:800:960:968:973:988:989:1260:1261:1311:1314:1345:1359:1437:1515:1535:1541:1711:1730:1747:1777:1792:2198:2199:2393:2559:2562:3138:3139:3140:3141:3142:3352:3865:3871:3874:5007:6119:6120:6261:6653:6742:7576:7903:10004:11026:11473:11658:11914:12043:12114:12296:12438:12555:12679:12895:13069:13311:13357:13894:14096:14181:14384:14721:21080:21627:21990:30054:30064,0,RBL:64.147.123.17:@sent.com:.lbl8.mailshell.net-64.100.201.100 62.18.0.100;04y8ejow9hkeezn7pph7fnm6fgrxfopfmymf5mahnobtpwknej5fg8gddr5m8tr.rz3obnxg81chfqfiuymt7xjzqzxj4yp1e3oneisromsds6af43brn938afjitkt.6-lbl8.mailshell.net-223.238.255.100,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fp,MSBL:0,DNSBL:neutral,Custom_rules:0:0:0,LFtime:24,LUA_SUMMARY:none X-HE-Tag: seed78_4c0a37527183 X-Filterd-Recvd-Size: 5423 Received: from wnew3-smtp.messagingengine.com (wnew3-smtp.messagingengine.com [64.147.123.17]) by imf14.hostedemail.com (Postfix) with ESMTP for ; Mon, 28 Sep 2020 17:55:25 +0000 (UTC) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailnew.west.internal (Postfix) with ESMTP id 9BF05E79; Mon, 28 Sep 2020 13:55:23 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Mon, 28 Sep 2020 13:55:24 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sent.com; h=from :to:cc:subject:date:message-id:in-reply-to:references:reply-to :mime-version:content-transfer-encoding; s=fm1; bh=M3Z5iltvAqpPX zgr4nDP3SM4M0PVu4wUve2VkVgkarQ=; b=RIm6Hu50wQRzGwujXp7gxNqIZcVKi KpBjCp4WeVNao7jLnVzlYFRx/wq6Ony32NdgfgQuswGC92phH9PfzBvoCsvoqyxZ KND7r3CEXZOqnam2Kkl0QxdDGe3FQcpmCImJ7YkOgPLqErBwe1IQ033ZDdn8l36Z pcp8v78qe6g1cKLPFOTxeSnwNSvCwEBvOwTZbW32BXE7elOyHbIRQWVn9jBRh9yC l8Z7TiBLaLN2BTSsBI3yoreMaPfQEf0jYXen2dndh7zrCjO7mPbn5sPfVxunUhpd rw3r5DdVtQJIQ33GFJCQa3yC/Zw9kT7UzmMuu2XeU+34FAaLEjMbzMYbg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:reply-to:subject :to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm3; bh=M3Z5iltvAqpPXzgr4nDP3SM4M0PVu4wUve2VkVgkarQ=; b=S2bT/ZI0 ecspBpXxJ0fmgANiN86cZWhwvxMJoG724bYeA/5cCMMK9pe6O6vuIb96paQmfKLi Tbf3NccwNxQQbHQp0T5GYaRmGIeoZvos8t2GPlI41g37ie21tyF8OqeX/23jbiWA CHn36krd80hPd67dEpYjRqwwFFRdRez+JK2CgQmrcU8EwaCw/SHzrAjcj/jY41bH LwgH09D2ZYk0eO6IQtC9eQXYttV5k1o6dymMEj3aDKrD1odPZI49qXZAp31kMtkY dTPMvvgnMzFDSNri+kSIZ+9HZB3vx4CFYmobc2mq3CBvSLGKlLWegc1pyDwzddvm v+fPZp3vbVFv0A== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedujedrvdeigdeliecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvffufffkofgjfhhrggfgsedtkeertdertddtnecuhfhrohhmpegkihcujggr nhcuoeiiihdrhigrnhesshgvnhhtrdgtohhmqeenucggtffrrghtthgvrhhnpeduhfffve ektdduhfdutdfgtdekkedvhfetuedufedtgffgvdevleehheevjefgtdenucfkphepuddv rdegiedruddtiedrudeigeenucevlhhushhtvghrufhiiigvpeduvdenucfrrghrrghmpe hmrghilhhfrhhomhepiihirdihrghnsehsvghnthdrtghomh X-ME-Proxy: Received: from nvrsysarch6.NVidia.COM (unknown [12.46.106.164]) by mail.messagingengine.com (Postfix) with ESMTPA id 88CE33064683; Mon, 28 Sep 2020 13:55:22 -0400 (EDT) From: Zi Yan To: linux-mm@kvack.org Cc: "Kirill A . Shutemov" , Roman Gushchin , Rik van Riel , Matthew Wilcox , Shakeel Butt , Yang Shi , Jason Gunthorpe , Mike Kravetz , Michal Hocko , David Hildenbrand , William Kucharski , Andrea Arcangeli , John Hubbard , David Nellans , linux-kernel@vger.kernel.org, Zi Yan Subject: [RFC PATCH v2 13/30] mm: rmap: add map_order to page_remove_anon_compound_rmap. Date: Mon, 28 Sep 2020 13:54:11 -0400 Message-Id: <20200928175428.4110504-14-zi.yan@sent.com> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200928175428.4110504-1-zi.yan@sent.com> References: <20200928175428.4110504-1-zi.yan@sent.com> Reply-To: Zi Yan 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: From: Zi Yan When PMD-mapped PUD THP is enabled by the upcoming commits, we can unmap a PMD-mapped PUD THP that should be counted as NR_ANON_THPS. The added map_order tells us about this situation. Signed-off-by: Zi Yan --- mm/rmap.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mm/rmap.c b/mm/rmap.c index 0d922e5fb38c..7fc0bf07b9bc 100644 --- a/mm/rmap.c +++ b/mm/rmap.c @@ -1292,7 +1292,7 @@ static void page_remove_file_rmap(struct page *page, bool compound) clear_page_mlock(page); } -static void page_remove_anon_compound_rmap(struct page *page) +static void page_remove_anon_compound_rmap(struct page *page, int map_order) { int i, nr; @@ -1306,7 +1306,7 @@ static void page_remove_anon_compound_rmap(struct page *page) if (!IS_ENABLED(CONFIG_TRANSPARENT_HUGEPAGE)) return; - if (thp_nr_pages(page) == HPAGE_PMD_NR) + if (map_order == HPAGE_PMD_ORDER) __dec_lruvec_page_state(page, NR_ANON_THPS); else __dec_lruvec_page_state(page, NR_ANON_THPS_PUD); @@ -1357,7 +1357,7 @@ void page_remove_rmap(struct page *page, int map_order) } if (compound) { - page_remove_anon_compound_rmap(page); + page_remove_anon_compound_rmap(page, map_order); goto out; }