Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755377AbbGCMrH (ORCPT ); Fri, 3 Jul 2015 08:47:07 -0400 Received: from e06smtp13.uk.ibm.com ([195.75.94.109]:51151 "EHLO e06smtp13.uk.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754330AbbGCMqV (ORCPT ); Fri, 3 Jul 2015 08:46:21 -0400 X-Helo: d06dlp02.portsmouth.uk.ibm.com X-MailFrom: dingel@linux.vnet.ibm.com X-RcptTo: linux-s390@vger.kernel.org From: Dominik Dingel 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 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> X-Mailer: git-send-email 2.3.8 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> X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 15070312-0013-0000-0000-00000493430E Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1501 Lines: 48 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 from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/