From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: From: Dominik Dingel Subject: [PATCH 3/4] mm: hugetlb: allow hugepages_supported to be architecture specific Date: Fri, 3 Jul 2015 14:46:08 +0200 Message-Id: <1435927569-41132-4-git-send-email-dingel@linux.vnet.ibm.com> In-Reply-To: <1435927569-41132-1-git-send-email-dingel@linux.vnet.ibm.com> References: <1435927569-41132-1-git-send-email-dingel@linux.vnet.ibm.com> Sender: owner-linux-mm@kvack.org List-Archive: List-Post: To: Andrew Morton , linux-kernel@vger.kernel.org Cc: Martin Schwidefsky , Heiko Carstens , linux390@de.ibm.com, Dominik Dingel , Christian Borntraeger , Michael Holzheu , linux-s390@vger.kernel.org, linux-mm@kvack.org, Gerald Schaefer List-ID: s390 has a constant hugepage size, by setting HPAGE_SHIFT we also change e.g. the pageblock_order, which should be independent in respect to hugepage support. With this patch every architecture is free to define how to check for hugepage support. Signed-off-by: Dominik Dingel --- include/linux/hugetlb.h | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h index 2050261..d891f94 100644 --- a/include/linux/hugetlb.h +++ b/include/linux/hugetlb.h @@ -460,15 +460,14 @@ static inline spinlock_t *huge_pte_lockptr(struct hstate *h, return &mm->page_table_lock; } -static inline bool hugepages_supported(void) -{ - /* - * Some platform decide whether they support huge pages at boot - * time. On these, such as powerpc, HPAGE_SHIFT is set to 0 when - * there is no such support - */ - return HPAGE_SHIFT != 0; -} +#ifndef hugepages_supported +/* + * Some platform decide whether they support huge pages at boot + * time. Some of them, such as powerpc, set HPAGE_SHIFT to 0 + * when there is no such support + */ +#define hugepages_supported() (HPAGE_SHIFT != 0) +#endif #else /* CONFIG_HUGETLB_PAGE */ struct hstate {}; -- 2.3.8 -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org