From patchwork Thu May 23 17:07:52 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve Capper X-Patchwork-Id: 17164 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-ve0-f198.google.com (mail-ve0-f198.google.com [209.85.128.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id F0B5B2395B for ; Thu, 23 May 2013 17:09:46 +0000 (UTC) Received: by mail-ve0-f198.google.com with SMTP id 15sf777563vea.1 for ; Thu, 23 May 2013 10:08:51 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=mime-version:x-beenthere:x-forwarded-to:x-forwarded-for :delivered-to:from:to:cc:subject:date:message-id:x-mailer :in-reply-to:references:x-gm-message-state:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :x-google-group-id:list-post:list-help:list-archive:list-unsubscribe; bh=YM78b68O1njVH0fGJBPK6zZkMO/sl925IM6pOfaYPes=; b=He//oCXTTreZ+t4kOqem9HLVLBEUFkP3BjHaRC4MtBvsSSCBtPSEKebp5ApA/5JA8Z oI/KERMwYOzsWZ9GSQfzREm7iXOWWXzz6lOnts2fqIYIOnwjaEPLVXAvC6vq3HoK2tWy jWcG4MmxhSX3ofoQIewnmj1/t7f6B4Hju61/lJgUhXutRDLUaRU7nseNp4vivIH3syJs ZN3lBamw1T2ieLRnrj+NNKoBmaTpiAomchJlnvH02w+YGT9HfWtMxqewLyzyFtGL++ZA nX+oXOBkc+zBppjUmsjNYeBfWfGXEy497PxgiCg3t0sUN9SEhNXj6iICtJna3AGLllBZ DaWw== X-Received: by 10.236.148.14 with SMTP id u14mr6686641yhj.47.1369328931484; Thu, 23 May 2013 10:08:51 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.0.78 with SMTP id 14ls1618058qec.10.gmail; Thu, 23 May 2013 10:08:51 -0700 (PDT) X-Received: by 10.220.96.17 with SMTP id f17mr5925415vcn.58.1369328931271; Thu, 23 May 2013 10:08:51 -0700 (PDT) Received: from mail-vb0-x22d.google.com (mail-vb0-x22d.google.com [2607:f8b0:400c:c02::22d]) by mx.google.com with ESMTPS id r12si6898523vcv.12.2013.05.23.10.08.51 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 23 May 2013 10:08:51 -0700 (PDT) Received-SPF: neutral (google.com: 2607:f8b0:400c:c02::22d is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=2607:f8b0:400c:c02::22d; Received: by mail-vb0-f45.google.com with SMTP id 12so2391268vbf.32 for ; Thu, 23 May 2013 10:08:51 -0700 (PDT) X-Received: by 10.58.225.228 with SMTP id rn4mr5948952vec.35.1369328931048; Thu, 23 May 2013 10:08:51 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.220.126.138 with SMTP id c10csp61558vcs; Thu, 23 May 2013 10:08:50 -0700 (PDT) X-Received: by 10.180.79.40 with SMTP id g8mr26337578wix.3.1369328899162; Thu, 23 May 2013 10:08:19 -0700 (PDT) Received: from mail-wi0-x22a.google.com (mail-wi0-x22a.google.com [2a00:1450:400c:c05::22a]) by mx.google.com with ESMTPS id gj3si9593608wic.21.2013.05.23.10.08.17 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 23 May 2013 10:08:19 -0700 (PDT) Received-SPF: neutral (google.com: 2a00:1450:400c:c05::22a is neither permitted nor denied by best guess record for domain of steve.capper@linaro.org) client-ip=2a00:1450:400c:c05::22a; Received: by mail-wi0-f170.google.com with SMTP id hr14so5153439wib.3 for ; Thu, 23 May 2013 10:08:17 -0700 (PDT) X-Received: by 10.180.185.179 with SMTP id fd19mr26433125wic.1.1369328897091; Thu, 23 May 2013 10:08:17 -0700 (PDT) Received: from localhost.localdomain (marmot.wormnet.eu. [188.246.204.87]) by mx.google.com with ESMTPSA id ca19sm36989435wib.3.2013.05.23.10.08.15 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Thu, 23 May 2013 10:08:16 -0700 (PDT) From: Steve Capper To: linux-mm@kvack.org, x86@kernel.org, linux-arch@vger.kernel.org, linux-arm-kernel@lists.infradead.org Cc: Michal Hocko , Ken Chen , Mel Gorman , Catalin Marinas , Will Deacon , patches@linaro.org, Steve Capper Subject: [PATCH 05/11] mm: thp: Correct the HPAGE_PMD_ORDER check. Date: Thu, 23 May 2013 18:07:52 +0100 Message-Id: <1369328878-11706-6-git-send-email-steve.capper@linaro.org> X-Mailer: git-send-email 1.7.2.5 In-Reply-To: <1369328878-11706-1-git-send-email-steve.capper@linaro.org> References: <1369328878-11706-1-git-send-email-steve.capper@linaro.org> X-Gm-Message-State: ALoCoQlVGjCSO0rN1aGJ7nO6F6DLo31v2u6Gu7gjCdNmBd3U0X69Jzwpt1ZtTZ1RJSrD8CzbciiD X-Original-Sender: steve.capper@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 2607:f8b0:400c:c02::22d is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , All Transparent Huge Pages are allocated by the buddy allocator. A compile time check is in place that fails when the order of a transparent huge page is too large to be allocated by the buddy allocator. Unfortunately that compile time check passes when: HPAGE_PMD_ORDER == MAX_ORDER ( which is incorrect as the buddy allocator can only allocate memory of order strictly less than MAX_ORDER. ) This patch updates the compile time check to fail in the above case. Signed-off-by: Steve Capper Acked-by: Catalin Marinas --- include/linux/huge_mm.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/huge_mm.h b/include/linux/huge_mm.h index 528454c..26ee56c 100644 --- a/include/linux/huge_mm.h +++ b/include/linux/huge_mm.h @@ -123,7 +123,7 @@ 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 +#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,