From patchwork Tue Apr 30 16:30:47 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve Capper X-Patchwork-Id: 2505681 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 639283FD85 for ; Tue, 30 Apr 2013 16:35:02 +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 1UXDUS-0007Jl-Nv; Tue, 30 Apr 2013 16:33:19 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1UXDTp-0005xZ-17; Tue, 30 Apr 2013 16:32:37 +0000 Received: from mail-wg0-x22f.google.com ([2a00:1450:400c:c00::22f]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1UXDSu-0005lj-GM for linux-arm-kernel@lists.infradead.org; Tue, 30 Apr 2013 16:31:44 +0000 Received: by mail-wg0-f47.google.com with SMTP id j13so638730wgh.26 for ; Tue, 30 Apr 2013 09:31:18 -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=NmdXBTGo9LLbdpgjQna815HtXEbfeP1JNFra5FbyfV8=; b=Y+bjcqaqsy6lh9TkdE7fBPcZg35YWfNQo9jqDfmNcf1IvC/qt2w8vEghvLgJQmjJoB NDL19GtSBoSzguJpJanefhwkywcclLPdSh1pu+15ZrVEdvWfv89WGc2utdvuuDpUIXC6 K6cfSGsIFFqcm5uHHugw/qa2oMY2+vsgT3DZ0qOVMkfP5NxcgZAFUm9jcca+9VqYsaEu hY4qumqSzwnb2vzqUzclFW2fn/B8vFgFxKV+ZUALkjwaFe/1i4J19FzPGi5i5mfpv4dG AGYI3YNlsRudx+2EKNp95U+xQ/42upWNWnfmKJYw8EMcYI+/vxZwf59MVo6h2QsTrJ0I dP6g== X-Received: by 10.194.82.34 with SMTP id f2mr46678754wjy.25.1367339478720; Tue, 30 Apr 2013 09:31:18 -0700 (PDT) Received: from localhost.localdomain (marmot.wormnet.eu. [188.246.204.87]) by mx.google.com with ESMTPSA id k5sm30044708wiy.5.2013.04.30.09.31.17 for (version=TLSv1 cipher=RC4-SHA bits=128/128); Tue, 30 Apr 2013 09:31:18 -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 8/9] ARM64: mm: Introduce MAX_ZONE_ORDER for 64K and THP. Date: Tue, 30 Apr 2013 17:30:47 +0100 Message-Id: <1367339448-21727-9-git-send-email-steve.capper@linaro.org> X-Mailer: git-send-email 1.7.2.5 In-Reply-To: <1367339448-21727-1-git-send-email-steve.capper@linaro.org> References: <1367339448-21727-1-git-send-email-steve.capper@linaro.org> X-Gm-Message-State: ALoCoQlIoL76wl3Oa1gcTjY0+2lzndV2/qa2CH6tOh3DJZsIw7B5hnTUfK2eCEXIJAGthevf9uYA X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20130430_123140_688267_3EE981CE X-CRM114-Status: GOOD ( 14.53 ) 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 , 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 The buddy allocator has a default order of 11, which is too low to allocate enough memory for 512MB Transparent HugePages if our base page size is 64K. For any order less than 13, the combination of THP with 64K pages will cause a compile error. This patch introduces the MAX_ZONE_ORDER config option that allows one to explicitly override the order of the buddy allocator. If 64K pages and THP are enabled the minimum value is set to 13. Signed-off-by: Steve Capper --- arch/arm64/Kconfig | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig index 16aa780..908fd95 100644 --- a/arch/arm64/Kconfig +++ b/arch/arm64/Kconfig @@ -196,6 +196,23 @@ config ARCH_WANT_HUGE_PMD_SHARE source "mm/Kconfig" +config FORCE_MAX_ZONEORDER + int "Maximum zone order" + range 11 64 if !(ARM64_64K_PAGES && TRANSPARENT_HUGEPAGE) + range 13 64 if ARM64_64K_PAGES && TRANSPARENT_HUGEPAGE + default "11" if !(ARM64_64K_PAGES && TRANSPARENT_HUGEPAGE) + default "13" if (ARM64_64K_PAGES && TRANSPARENT_HUGEPAGE) + help + The kernel memory allocator divides physically contiguous memory + blocks into "zones", where each zone is a power of two number of + pages. This option selects the largest power of two that the kernel + keeps in the memory allocator. If you need to allocate very large + blocks of physically contiguous memory, then you may need to + increase this value. + + This config option is actually maximum order plus one. For example, + a value of 11 means that the largest free memory block is 2^10 pages. + endmenu menu "Boot options"