From patchwork Wed May 8 09:52:37 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve Capper X-Patchwork-Id: 2538141 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) by patchwork1.kernel.org (Postfix) with ESMTP id 477483FE1F for ; Wed, 8 May 2013 09:56:32 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Ua15S-00021V-Ee; Wed, 08 May 2013 09:55:03 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1Ua14s-0005DW-8L; Wed, 08 May 2013 09:54:26 +0000 Received: from mail-we0-x236.google.com ([2a00:1450:400c:c03::236]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Ua145-000523-LX for linux-arm-kernel@lists.infradead.org; Wed, 08 May 2013 09:53:46 +0000 Received: by mail-we0-f182.google.com with SMTP id t60so1615346wes.13 for ; Wed, 08 May 2013 02:53:15 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references:x-gm-message-state; bh=xIt+I1shNSkKCZXzbWmyADO/7WKjX1AfzQw+yxxKpQY=; b=HujLCmJg6E7Z2OldjL4kJ+8Tcf/NHa62TQK1RvD18wXtR/zFlq8fFjR8e/89H0TBnc aSN0dDi5931kER8TTbeB2LEYq1AuuJWwHIgnPJ7PJ6hbW62uXdgOCUctrtAtmfBMtUCV J94169w18v9UVndS4rcN3Org6tto7/wtV1X2SMG+UlM1LyGOoQUPunZJikgPg9+sr+65 qFh5G0HIuveNl5zjF4fMOyNW+8SViZZNfPDIp0WObTh3HoINKrPB+3WlwlJbKtqE1ZNO 7JQqmCa+5nQFd6exKmu4uihIGmVJu1NwSJ7/GaE/yzQ4oqsXHs+cmG8kdaWrIwYRUHRR RbkA== X-Received: by 10.180.37.133 with SMTP id y5mr8401486wij.20.1368006795273; Wed, 08 May 2013 02:53:15 -0700 (PDT) Received: from localhost.localdomain (marmot.wormnet.eu. [188.246.204.87]) by mx.google.com with ESMTPSA id m14sm8068040wij.9.2013.05.08.02.53.14 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Wed, 08 May 2013 02:53:14 -0700 (PDT) From: Steve Capper To: linux-mm@kvack.org, x86@kernel.org, linux-arch@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [RFC PATCH v2 05/11] mm: thp: Correct the HPAGE_PMD_ORDER check. Date: Wed, 8 May 2013 10:52:37 +0100 Message-Id: <1368006763-30774-6-git-send-email-steve.capper@linaro.org> X-Mailer: git-send-email 1.7.2.5 In-Reply-To: <1368006763-30774-1-git-send-email-steve.capper@linaro.org> References: <1368006763-30774-1-git-send-email-steve.capper@linaro.org> X-Gm-Message-State: ALoCoQkQFFYJUhO0PvNV2w1h25lZSRYoqlXYDAXFptGbidpoYuJjH7/0YI9/hXwriu5pOFy0uyHn X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130508_055337_833364_E87F5496 X-CRM114-Status: GOOD ( 12.74 ) X-Spam-Score: -1.9 (-) X-Spam-Report: SpamAssassin version 3.3.2 on merlin.infradead.org summary: Content analysis details: (-1.9 points) pts rule name description ---- ---------------------- -------------------------------------------------- -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Cc: Steve Capper , patches@linaro.org, Catalin Marinas , Will Deacon , Michal Hocko , Ken Chen , Mel Gorman X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org 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 --- 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 ee1c244..3d71e5c 100644 --- a/include/linux/huge_mm.h +++ b/include/linux/huge_mm.h @@ -119,7 +119,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,