From patchwork Mon Sep 28 17:54:04 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zi Yan X-Patchwork-Id: 11804457 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 F08A9618 for ; Mon, 28 Sep 2020 17:55:42 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id A71B221548 for ; Mon, 28 Sep 2020 17:55:42 +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="bPqHgoSe"; dkim=temperror (0-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="QysaKMya" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A71B221548 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 143B790000C; Mon, 28 Sep 2020 13:55:26 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id B1FE9900007; Mon, 28 Sep 2020 13:55:25 -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 86415900003; Mon, 28 Sep 2020 13:55:25 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0169.hostedemail.com [216.40.44.169]) by kanga.kvack.org (Postfix) with ESMTP id 58947900003 for ; Mon, 28 Sep 2020 13:55:25 -0400 (EDT) Received: from smtpin30.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 137602471 for ; Mon, 28 Sep 2020 17:55:25 +0000 (UTC) X-FDA: 77313222210.30.grass25_5a0e2e627183 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin30.hostedemail.com (Postfix) with ESMTP id D94EE180B3C83 for ; Mon, 28 Sep 2020 17:55:24 +0000 (UTC) X-Spam-Summary: 1,0,0,acce637484332813,d41d8cd98f00b204,zi.yan@sent.com,,RULES_HIT:41:355:379:541:560:800:960:973:988:989:1260:1261:1311:1314:1345:1359:1437:1515:1535:1540:1711:1730:1747:1777:1792:2198:2199:2393:2559:2562:3138:3139:3140:3141:3142:3352:3865:3867:3868:3870:3871:4321:5007:6119:6120:6261:6653:6742:7576:7901:8957:10004:11026:11473:11658:11914:12043:12296:12555:12679:12895:13069:13255:13311:13357:13894:14181:14384:14721:21080:21627:21990:30054:30064:30070,0,RBL:64.147.123.17:@sent.com:.lbl8.mailshell.net-62.18.0.100 64.100.201.100;04yfr1zyguu9nyjk4oo9ijjn3mphfophgroy5sqojm1ikafndzkjwttf74qd7qe.64hx7wfq96b5su9q8ym4k8etn8633716rdgworpoki9wagqhfoge87m5eyfp5p5.n-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:22,LUA_SUMMARY:none X-HE-Tag: grass25_5a0e2e627183 X-Filterd-Recvd-Size: 5050 Received: from wnew3-smtp.messagingengine.com (wnew3-smtp.messagingengine.com [64.147.123.17]) by imf24.hostedemail.com (Postfix) with ESMTP for ; Mon, 28 Sep 2020 17:55:24 +0000 (UTC) Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailnew.west.internal (Postfix) with ESMTP id 4B923D71; Mon, 28 Sep 2020 13:55:21 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Mon, 28 Sep 2020 13:55:22 -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=o0WCxQyI2O6mh GAJROeebiC+vwx5YKmyUHqh7AyOuKk=; b=bPqHgoSeqVUscY4YGUlnjKCBypnig 5aMXn+EAoCrtOBY2XDUZPdAPt5U7Ph8M1/lmYI6nREKNcIe+D8AY1DU6eFN5C3XM mXAwgVfDTUnvxoztaJBlvYp77fqBu4URm4CCrqOCE5e9sMcxa6TjYTLGZjSW6Tjd I57SIz+rUbDqedJVEtqyfVNT+JdQh/YHHOILb8/80o5CetepUBvvfKXEJC3ShCS2 /VmVr9d7pAW8aV112CnvU4OgSChzFoN7vKUC/oV2dj4x6hUp4Ps2EBXQjEzCK8tp Nd7U6yPMpK3jzIHGmkpPdzjXCGSxDwFcnIIghXX7HkgdfaGIPBnB+Q6Uw== 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=o0WCxQyI2O6mhGAJROeebiC+vwx5YKmyUHqh7AyOuKk=; b=QysaKMya UJNPeNsO849elS+MTT/9LzLCGhmvb8wCwheU+6wpcxcQcvl5inN6+T3xCfyyserm tit146y3F1jwZIr3CgYnUme7wTZPnTifUUxNf+YaFYnYiYKMiddk1/S+1nG7WdW6 2tmUJoQrtL2Gr38eHnqkDQOCnIh9oljmd9krdx9NSs+zMdCa5/d8AWYqIJTAsGrX RZ4Q2WWj9QgJAKDWCxUqbzj+7aMIWiWJjutoAfczhV0excCHFUqu7twiVmCn9rM1 aWCMN+P4ZtVZXgAcvkq246wTpMrplnEDqNfAOmaU3fP3uUJ6zWet150RHynWkEgm SMpQk4Vgfy4wZw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedujedrvdeigdeliecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvffufffkofgjfhhrggfgsedtkeertdertddtnecuhfhrohhmpegkihcujggr nhcuoeiiihdrhigrnhesshgvnhhtrdgtohhmqeenucggtffrrghtthgvrhhnpeduhfffve ektdduhfdutdfgtdekkedvhfetuedufedtgffgvdevleehheevjefgtdenucfkphepuddv rdegiedruddtiedrudeigeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmh grihhlfhhrohhmpeiiihdrhigrnhesshgvnhhtrdgtohhm X-ME-Proxy: Received: from nvrsysarch6.NVidia.COM (unknown [12.46.106.164]) by mail.messagingengine.com (Postfix) with ESMTPA id 0EF7F306468C; Mon, 28 Sep 2020 13:55:20 -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 06/30] mm: change thp_order and thp_nr as we will have not just PMD THPs. Date: Mon, 28 Sep 2020 13:54:04 -0400 Message-Id: <20200928175428.4110504-7-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 As PUD THP is going to be added in the following patches, thp_order and thp_nr can be HPAGE_PUD_ORDER and HPAGE_PUD_NR, respectively. Signed-off-by: Zi Yan --- include/linux/huge_mm.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/linux/huge_mm.h b/include/linux/huge_mm.h index e9d228d4fc69..addd206150e2 100644 --- a/include/linux/huge_mm.h +++ b/include/linux/huge_mm.h @@ -279,7 +279,7 @@ static inline unsigned int thp_order(struct page *page) { VM_BUG_ON_PGFLAGS(PageTail(page), page); if (PageHead(page)) - return HPAGE_PMD_ORDER; + return page[1].compound_order; return 0; } @@ -291,7 +291,7 @@ static inline int thp_nr_pages(struct page *page) { VM_BUG_ON_PGFLAGS(PageTail(page), page); if (PageHead(page)) - return HPAGE_PMD_NR; + return (1<