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: 2608401 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 09D7A40077 for ; Thu, 23 May 2013 17:10:41 +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 1UfZ1J-0004HN-J4; Thu, 23 May 2013 17:09:42 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1UfZ10-00035T-JW; Thu, 23 May 2013 17:09:22 +0000 Received: from mail-wi0-x235.google.com ([2a00:1450:400c:c05::235]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1UfZ0J-0002tX-Fg for linux-arm-kernel@lists.infradead.org; Thu, 23 May 2013 17:08:44 +0000 Received: by mail-wi0-f181.google.com with SMTP id hi5so2224505wib.2 for ; Thu, 23 May 2013 10:08:17 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references :x-gm-message-state; bh=YM78b68O1njVH0fGJBPK6zZkMO/sl925IM6pOfaYPes=; b=aO7D1uwrhDDTIRKZjI1G8aMf6wCkDNf5LxsPk4QsD3FDwbCv/p9HeDTlWNhFeWzFF8 foNcNwEXzPrfLrqhFEdAxTMOYWINkK+O0/JVvSpN51t7qIfE5F4XcN4TLzUaodChUdJE /MJNrhcsIqhHPrdj8pmRpxQIuIe6ri8lqaKBetrHieuILrUcy/Q+U8+WNrt263wm10wA I42x7ztyTsh9KzygpjAo89rVzdPmL7liBvcwpdvdwOLkxwxDKTZdocMGDUIxwd+E4rQ1 dZx4pfU47lrLNiIckmtaNGrOT4a0si96ZsIyXnkJBJC+xmwGyJif/dT33A1mjc80TO+J WScQ== 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 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: ALoCoQnhcD8F9m4jQ9xOzC5J6x87QSJKpSKGWGi5/g9MiNoRPtW7IMWmuYjInkH8EhJt/+K2jTRj X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130523_130839_664801_52BE43CB X-CRM114-Status: GOOD ( 12.70 ) 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 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,