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=-9.8 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS, 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 DD366C433E0 for ; Mon, 6 Jul 2020 17:21:06 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id A556C2070C for ; Mon, 6 Jul 2020 17:21:06 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="s0pZXDzW" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A556C2070C Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 449156B0005; Mon, 6 Jul 2020 13:21:06 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 3D1BC6B0006; Mon, 6 Jul 2020 13:21:06 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 2E7766B0007; Mon, 6 Jul 2020 13:21:06 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0171.hostedemail.com [216.40.44.171]) by kanga.kvack.org (Postfix) with ESMTP id 18E096B0005 for ; Mon, 6 Jul 2020 13:21:06 -0400 (EDT) Received: from smtpin27.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id C80621EE6 for ; Mon, 6 Jul 2020 17:21:05 +0000 (UTC) X-FDA: 77008316490.27.grade30_0904cea26ead Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin27.hostedemail.com (Postfix) with ESMTP id 973093D66D for ; Mon, 6 Jul 2020 17:21:05 +0000 (UTC) X-HE-Tag: grade30_0904cea26ead X-Filterd-Recvd-Size: 3950 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by imf29.hostedemail.com (Postfix) with ESMTP for ; Mon, 6 Jul 2020 17:21:05 +0000 (UTC) Received: from aquarius.haifa.ibm.com (nesher1.haifa.il.ibm.com [195.110.40.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 185372070C; Mon, 6 Jul 2020 17:20:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1594056064; bh=MWHYORZMEjUSzCSQkeZzYrQp9re20hGQqezlYYHuB94=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=s0pZXDzWq1ti+TdYy2gBZD3Y73VYnvfnm3tEJXPJ88SIvsg6MmXc/qFAFzTIwpFqP 7TbW5C3oY64sMzALUCOf30npQlHdVoThRIoAdo0uUz+uIycFvotPVG82yGOKJ/oJMg 1L5566MpNGCUtD5oEaYzAvNOrrsH2kjQEDvmFXfs= From: Mike Rapoport To: linux-kernel@vger.kernel.org Cc: Alan Cox , Andrew Morton , Andy Lutomirski , Christopher Lameter , Dave Hansen , Idan Yaniv , James Bottomley , "Kirill A. Shutemov" , Matthew Wilcox , Peter Zijlstra , "Reshetova, Elena" , Thomas Gleixner , Tycho Andersen , linux-api@vger.kernel.org, linux-mm@kvack.org, Mike Rapoport Subject: [RFC PATCH v2 1/5] mm: make HPAGE_PxD_{SHIFT,MASK,SIZE} always available Date: Mon, 6 Jul 2020 20:20:47 +0300 Message-Id: <20200706172051.19465-2-rppt@kernel.org> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200706172051.19465-1-rppt@kernel.org> References: <20200706172051.19465-1-rppt@kernel.org> MIME-Version: 1.0 X-Rspamd-Queue-Id: 973093D66D X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam02 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: Mike Rapoport The definitions of shift, mask and size for the second and the third leve= l of the leaf pages are available only when CONFIG_TRANSPARENT_HUGEPAGE is set. Otherwise they evaluate to BUILD_BUG(). There is no explanation neither in the code nor in the changelog why the usage of, e.g. HPAGE_PMD_SIZE should be only allowed with THP and forbidd= en otherwise while the definitions of HPAGE_PMD_SIZE and HPAGE_PUD_SIZE express the sizes better than ambiguous HPAGE_SIZE. Make HPAGE_PxD_{SHIFT,MASK,SIZE} definitions available unconditionally. Signed-off-by: Mike Rapoport --- include/linux/huge_mm.h | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/include/linux/huge_mm.h b/include/linux/huge_mm.h index 71f20776b06c..1f4b44a76e31 100644 --- a/include/linux/huge_mm.h +++ b/include/linux/huge_mm.h @@ -115,7 +115,6 @@ extern struct kobj_attribute shmem_enabled_attr; #define HPAGE_PMD_ORDER (HPAGE_PMD_SHIFT-PAGE_SHIFT) #define HPAGE_PMD_NR (1<