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: 16784 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-gg0-f200.google.com (mail-gg0-f200.google.com [209.85.161.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id B2DC2238FB for ; Wed, 8 May 2013 09:53:37 +0000 (UTC) Received: by mail-gg0-f200.google.com with SMTP id h13sf1723200ggd.11 for ; Wed, 08 May 2013 02:53:17 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:mime-version:x-beenthere:x-received:received-spf :x-received:x-forwarded-to:x-forwarded-for:delivered-to:x-received :received-spf:x-received: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=xIt+I1shNSkKCZXzbWmyADO/7WKjX1AfzQw+yxxKpQY=; b=TYCRLxCpKxqqwINkinqJiNysSbqIRL43AIuJRBIBkjpvnbRGu/84VQiXitgC6u8GTZ eNbeReohq4S4zEAgAl3uuOQOOZWN7N34ozKIev8g9gdGjZ6YTM68wCr2nNb/hyuVSkUk xwdtqXO8N6hP1b7967WO5r4OQm62UjIS0i09ByYqPLuL1A+Mq+4zjI+w/fblUb88g70k Cb49OyuucZEPkoLClZKmmZlW2BDPp9M/Qhz3pRPMqHsFpC0Y5DsUNhcnfzdmZu0Y3zQ9 1vKGXuZRVzjr29h1FsJMjna3ualmBR258V0wTKLNbb6QGucOkKC9e98fCF1+NCJjbU0h lm4A== X-Received: by 10.224.165.130 with SMTP id i2mr7138147qay.2.1368006796916; Wed, 08 May 2013 02:53:16 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.49.47.104 with SMTP id c8ls133938qen.8.gmail; Wed, 08 May 2013 02:53:16 -0700 (PDT) X-Received: by 10.220.253.8 with SMTP id my8mr3982698vcb.23.1368006796739; Wed, 08 May 2013 02:53:16 -0700 (PDT) Received: from mail-vc0-f181.google.com (mail-vc0-f181.google.com [209.85.220.181]) by mx.google.com with ESMTPS id ir6si14695360vdb.104.2013.05.08.02.53.16 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 08 May 2013 02:53:16 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.220.181 is neither permitted nor denied by best guess record for domain of patch+caf_=patchwork-forward=linaro.org@linaro.org) client-ip=209.85.220.181; Received: by mail-vc0-f181.google.com with SMTP id hr11so1487398vcb.12 for ; Wed, 08 May 2013 02:53:16 -0700 (PDT) X-Received: by 10.52.175.200 with SMTP id cc8mr3338728vdc.94.1368006796663; Wed, 08 May 2013 02:53:16 -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.58.127.98 with SMTP id nf2csp146839veb; Wed, 8 May 2013 02:53:16 -0700 (PDT) X-Received: by 10.194.2.1 with SMTP id 1mr9286595wjq.34.1368006795660; Wed, 08 May 2013 02:53:15 -0700 (PDT) Received: from mail-wg0-x229.google.com (mail-wg0-x229.google.com [2a00:1450:400c:c00::229]) by mx.google.com with ESMTPS id p17si9180131wjr.215.2013.05.08.02.53.15 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 08 May 2013 02:53:15 -0700 (PDT) Received-SPF: neutral (google.com: 2a00:1450:400c:c00::229 is neither permitted nor denied by best guess record for domain of steve.capper@linaro.org) client-ip=2a00:1450:400c:c00::229; Received: by mail-wg0-f41.google.com with SMTP id y10so4913327wgg.2 for ; Wed, 08 May 2013 02:53:15 -0700 (PDT) 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 Cc: Michal Hocko , Ken Chen , Mel Gorman , Catalin Marinas , Will Deacon , patches@linaro.org, Steve Capper 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: ALoCoQmvHoI9WAi6BvMuzCZmenLnq6Al+WOah6wadQuEidu4YUrcA/VEHI9qzjfV1/6jRG8m/jmB X-Original-Sender: steve.capper@linaro.org X-Original-Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.220.181 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 --- 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,