From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from psmtp.com (na3sys010amx112.postini.com [74.125.245.112]) by kanga.kvack.org (Postfix) with SMTP id 3C5436B0023 for ; Thu, 21 Feb 2013 11:48:03 -0500 (EST) Received: from /spool/local by e28smtp04.in.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 21 Feb 2013 22:15:30 +0530 Received: from d28relay01.in.ibm.com (d28relay01.in.ibm.com [9.184.220.58]) by d28dlp03.in.ibm.com (Postfix) with ESMTP id B822D1258052 for ; Thu, 21 Feb 2013 22:18:45 +0530 (IST) Received: from d28av02.in.ibm.com (d28av02.in.ibm.com [9.184.220.64]) by d28relay01.in.ibm.com (8.13.8/8.13.8/NCO v10.0) with ESMTP id r1LGlsA229622370 for ; Thu, 21 Feb 2013 22:17:54 +0530 Received: from d28av02.in.ibm.com (loopback [127.0.0.1]) by d28av02.in.ibm.com (8.14.4/8.13.1/NCO v10.0 AVout) with ESMTP id r1LGlsfR011039 for ; Fri, 22 Feb 2013 03:47:56 +1100 From: "Aneesh Kumar K.V" Subject: [RFC PATCH -V2 13/21] mm/THP: HPAGE_SHIFT is not a #define on some arch Date: Thu, 21 Feb 2013 22:17:20 +0530 Message-Id: <1361465248-10867-14-git-send-email-aneesh.kumar@linux.vnet.ibm.com> In-Reply-To: <1361465248-10867-1-git-send-email-aneesh.kumar@linux.vnet.ibm.com> References: <1361465248-10867-1-git-send-email-aneesh.kumar@linux.vnet.ibm.com> Sender: owner-linux-mm@kvack.org List-ID: To: benh@kernel.crashing.org, paulus@samba.org Cc: linuxppc-dev@lists.ozlabs.org, linux-mm@kvack.org, "Aneesh Kumar K.V" From: "Aneesh Kumar K.V" On archs like powerpc that support different huge page sizes, HPAGE_SHIFT and other derived values like HPAGE_PMD_ORDER are not constants. So move that to hugepage_init Signed-off-by: Aneesh Kumar K.V --- include/linux/huge_mm.h | 3 --- mm/huge_memory.c | 9 ++++++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/include/linux/huge_mm.h b/include/linux/huge_mm.h index 1d76f8c..0022b70 100644 --- a/include/linux/huge_mm.h +++ b/include/linux/huge_mm.h @@ -119,9 +119,6 @@ extern void __split_huge_page_pmd(struct vm_area_struct *vma, } while (0) extern void split_huge_page_pmd_mm(struct mm_struct *mm, unsigned long address, pmd_t *pmd); -#if HPAGE_PMD_ORDER > MAX_ORDER -#error "hugepages can't be allocated by the buddy allocator" -#endif extern int hugepage_madvise(struct vm_area_struct *vma, unsigned long *vm_flags, int advice); extern void __vma_adjust_trans_huge(struct vm_area_struct *vma, diff --git a/mm/huge_memory.c b/mm/huge_memory.c index b5783d8..1940ee0 100644 --- a/mm/huge_memory.c +++ b/mm/huge_memory.c @@ -44,7 +44,7 @@ unsigned long transparent_hugepage_flags __read_mostly = (1< MAX_ORDER)) { transparent_hugepage_flags = 0; return -EINVAL; } + khugepaged_pages_to_scan = HPAGE_PMD_NR*8; + khugepaged_max_ptes_none = HPAGE_PMD_NR-1; + err = hugepage_init_sysfs(&hugepage_kobj); if (err) return err; -- 1.7.10 -- 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