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=-12.3 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham 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 1A6D0C4727E 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 ABA5E208FE for ; Mon, 28 Sep 2020 17:55:41 +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 ABA5E208FE 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) Received: by kanga.kvack.org (Postfix, from userid 40) id B1FE9900007; Mon, 28 Sep 2020 13:55:25 -0400 (EDT) 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-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-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 Content-Transfer-Encoding: quoted-printable 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 *pag= e) { VM_BUG_ON_PGFLAGS(PageTail(page), page); if (PageHead(page)) - return HPAGE_PMD_ORDER; + return page[1].compound_order; return 0; } =20 @@ -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<