Received: by 2002:a05:6902:102b:0:0:0:0 with SMTP id x11csp333928ybt; Mon, 6 Jul 2020 10:23:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxfJTpOBVSTWdDT4uX3qM+OuuvioRu6liE6fTkAjZ8Q7WQvkPNyYs/nSNrDPr/CbPbIyvLt X-Received: by 2002:a17:906:6897:: with SMTP id n23mr42652253ejr.473.1594056219435; Mon, 06 Jul 2020 10:23:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1594056219; cv=none; d=google.com; s=arc-20160816; b=ouxCMbBJn83KqJwIvkBQutSmfxs/0wM9PZin9uGq+i/cwZQ4GcDe+v/aIFRJb1Sp25 XimGCmUp4SdO6jzSEEoD9lWCDdpaNV0V7KAO/GpA7CnbaC3rPRJ1A1V0nompnly5uQDe aN/VNOmauUpWxUaN1SO+rFbR/L6FFYeORu4XHQoD+YyBgZ5qfJPZ0rhQj/DLFr2B/2zP 1Yo5ePs8XD3p8nh2XadBrQh+gXmppEkpTPlDcNRu0/owash4jiiXBHhyu16tGYXLydRZ 6b31zV1myFzbfGRXKev8Iy/IWtFz+2Weo7nOHuT/OyuUkU/q7LlNb392lvLl6D8SENjH RpKg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=vYxdq0fqVTuVb1ZX3KmGzTC0xDKHhmuejGkzcPQVKDU=; b=tg8psYHLkqhjRYR+cCr35/C9IXitNdt4isEa8L9LzxBS7SDvmsoC0a20WzoaIX2Ipm Wp3f7QF8AsNsHO0Pm+CmBeu5PahjgtW/NIx+g8AsA9yvfnFvOC4A+TQmuW31OVcKp45E K7IGkv2/97N9WLC703oc6pKT1AEzyBGhlTcUSvgCyV6lFLzZXt2YJUMJtxE+iyUdEixs M6B0Jh5C7HMGlqNOA34L0mYFSZ15PsxPTRXyUphMoBjxXjDZy9kxCtLcpA42SwhVvLu9 48OYF6fMR4mvboKRuYvRn55xsSNKI3iHz8xCJjOskn60o+LJFzD/8pm6BhO6vqHLzFUQ JYOQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=s0pZXDzW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u13si13335979edl.463.2020.07.06.10.23.16; Mon, 06 Jul 2020 10:23:39 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=s0pZXDzW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729671AbgGFRVF (ORCPT + 99 others); Mon, 6 Jul 2020 13:21:05 -0400 Received: from mail.kernel.org ([198.145.29.99]:55384 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729664AbgGFRVF (ORCPT ); Mon, 6 Jul 2020 13:21:05 -0400 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 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Mike Rapoport The definitions of shift, mask and size for the second and the third level 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 forbidden 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<