From patchwork Mon Sep 28 17:54:13 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zi Yan X-Patchwork-Id: 11804467 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 CEC62618 for ; Mon, 28 Sep 2020 17:55:54 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 9278D2311C for ; Mon, 28 Sep 2020 17:55:54 +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="gog8QY/C"; dkim=temperror (0-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="OzCZjtAW" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9278D2311C 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 57B5390000E; 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 5523290000B; 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 3A73090000E; 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 (smtprelay0126.hostedemail.com [216.40.44.126]) by kanga.kvack.org (Postfix) with ESMTP id 2305A90000B for ; Mon, 28 Sep 2020 13:55:27 -0400 (EDT) Received: from smtpin18.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id CF3B2181AE86D for ; Mon, 28 Sep 2020 17:55:26 +0000 (UTC) X-FDA: 77313222252.18.spy40_0813b4127183 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin18.hostedemail.com (Postfix) with ESMTP id AD1F6101CE720 for ; Mon, 28 Sep 2020 17:55:26 +0000 (UTC) X-Spam-Summary: 1,0,0,962fc68e599a4bba,d41d8cd98f00b204,zi.yan@sent.com,,RULES_HIT:41:355:379:541:800:960:968:973:988:989:1260:1261:1311:1314:1345:1359:1437:1515:1534:1540:1711:1714:1730:1747:1777:1792:2198:2199:2393:2559:2562:2693:3138:3139:3140:3141:3142:3351:3865:3867:3871:3872:4250:4321:5007:6119:6120:6261:6653:6742:7576:7901:9010:9012:10004:11026:11473:11658:11914:12043:12438:12555:12679:12895:12986:13069:13255:13311:13357:13894:14096:14181:14384:14721:21080:21627:21990:30054:30064,0,RBL:64.147.123.17:@sent.com:.lbl8.mailshell.net-62.18.0.100 64.100.201.100;04y84ugay8pi84nnxbi6n9j5i1k4pocptkwj9djzrnik61mewaye4wxyy6b6rcw.pm9osk5schxzrybeowys4hzbphd846ek5x49rqg9cu8rxbteiscjhc1ewb9uj7p.o-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: spy40_0813b4127183 X-Filterd-Recvd-Size: 4928 Received: from wnew3-smtp.messagingengine.com (wnew3-smtp.messagingengine.com [64.147.123.17]) by imf47.hostedemail.com (Postfix) with ESMTP for ; Mon, 28 Sep 2020 17:55:26 +0000 (UTC) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailnew.west.internal (Postfix) with ESMTP id 4A58FE33; Mon, 28 Sep 2020 13:55:24 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Mon, 28 Sep 2020 13:55:25 -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=bn+CdI2mzadwD 3ISILwshyyh0HI8VM1uFL6AVtefXJ4=; b=gog8QY/CSxCjynTpVZ4HAGDug73ke xX+kcrWQkb94b5wOhnLbNTiVsR/ruk8Mwbqk8F/EaLhCJPayGmXCWfyspc+ao2eJ 0C3vNpyaK4saUjBDQF3SdVlZu54ar6WDhOfx5d+9jUl3nwsb+wqiSHH/8WkE0PRV hoalI72wNNOumDkz1Mxfn/qi2Lrcj7wmZ3mDCEP/ZlzkNeMf9i+1L3dbY/qehCcQ Bc/vlHiyu0rYdUDIZ5oIt05j0evLgPe1nDfPW6VF+JYJYLK3XHMtWl8HzjsqfdwU BGCNi6/dor+Qe9uduRF4QKg1PFeyAuobUZjKrqNUUFCOw16tlYrmsMFTQ== 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=bn+CdI2mzadwD3ISILwshyyh0HI8VM1uFL6AVtefXJ4=; b=OzCZjtAW gBaouZLgxnDnH+V9Qh7yqZfg3+GMmnaV90PS0NnKH4niDr8ak1EhQKjAjBLitU2c uRjYzKlOhRmuadaAIZzBb92TcJRFvBdMl219MpHLAgtvkOmvrPGLdL1q/dqU+IWL S50+m1VzPZb1u5B+pivVc2DUyNnjSJuHIxpHBqzzxn8VQXeNmaoIlEoHI288xt8o AX+YhkFNhpUlEnU7/bC3Dl4l+mo72ywtGBmBfR06Q7oD6MjIcGg4qG6lE1kXyKY9 Q2c2kRM/1DBjzyjVX3fsrreEfsUpKFV+P9CBmKcg9ylR5pGHOjo2H+1UAPnvfU+n hHLnAyIFe1WZzA== 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 686373064685; Mon, 28 Sep 2020 13:55:23 -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 15/30] mm: thp: add PUD THP to deferred split list when PUD mapping is gone. Date: Mon, 28 Sep 2020 13:54:13 -0400 Message-Id: <20200928175428.4110504-16-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 PUD mapping is gone, there is no need to keep the PUD THP. Add it to deferred split list, so when memory pressure comes, the THP will be split. Signed-off-by: Zi Yan --- mm/rmap.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/mm/rmap.c b/mm/rmap.c index b4950f7a0978..424322807966 100644 --- a/mm/rmap.c +++ b/mm/rmap.c @@ -1329,6 +1329,9 @@ static void page_remove_anon_compound_rmap(struct page *page, int map_order) } __dec_node_page_state(page, NR_ANON_THPS); } + /* deferred split huge pud page if PUD map is gone */ + if (!compound_mapcount(head)) + deferred_split_huge_page(head); nr += HPAGE_PMD_NR; __mod_node_page_state(page_pgdat(head), NR_ANON_MAPPED, -nr); return;