From patchwork Tue May 30 19:43:59 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hugh Dickins X-Patchwork-Id: 768780 Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from lists.ozlabs.org (lists.ozlabs.org [103.22.144.68]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3wckbz34bVz9s72 for ; Wed, 31 May 2017 05:45:35 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=google.com header.i=@google.com header.b="gpmlWrMr"; dkim-atps=neutral Received: from lists.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 3wckbz1yb1zDqFS for ; Wed, 31 May 2017 05:45:35 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=google.com header.i=@google.com header.b="gpmlWrMr"; dkim-atps=neutral X-Original-To: linuxppc-dev@lists.ozlabs.org Delivered-To: linuxppc-dev@lists.ozlabs.org Received: from mail-pf0-x233.google.com (mail-pf0-x233.google.com [IPv6:2607:f8b0:400e:c00::233]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 3wckZM6GrvzDq5x for ; Wed, 31 May 2017 05:44:11 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=google.com header.i=@google.com header.b="gpmlWrMr"; dkim-atps=neutral Received: by mail-pf0-x233.google.com with SMTP id 9so81201564pfj.1 for ; Tue, 30 May 2017 12:44:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:from:to:cc:subject:message-id:user-agent:mime-version; bh=l+VlExhk1UmU5ZQaQ2qSuTe8ZkqZL8+RkaeRe2dzyrM=; b=gpmlWrMrmg2oVlhFn1bl7xOJtOrb0hC3tWtaoDTKnplWNpFkFwQp2bZTcvJosq+N67 O6Rl72EmQVeN0G3HY0EBdbiZVzJfSDAbC54bQZjPuZ+p9wD2Y6BQNMoDrbcSJDnYY/bn fYkbqSnGY28X5w5DyBAn7xDg+YlF4Yh2Nm8iKg3iBRAx7GDlsREmKDMkLUEqRbhzKtw4 fUFwlSsmqt6+yGCnzQoKIrdB4yM1TSVoaqh+5FYJ5rfNN9APDuBr6SNMm2RSa26TEIjh THFPoMDHPX2S4FWEK8jYdYIqhpr3jSm0ZBqF9J3iYyra8flh3VGC8SoZlN1hWrALkl1Q pGzQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:user-agent :mime-version; bh=l+VlExhk1UmU5ZQaQ2qSuTe8ZkqZL8+RkaeRe2dzyrM=; b=TOgq4QQoDLqNm/A2LYxALLS3yV0t3s5MQNq5U5Ag/E4YIy25Pp6BeON4LSsoXoyQgg IIMBpiRapOMv85qtKOncB5tiqgIR+BU6SIDKIcX9xUQnEz80UjoNWo7Bay7c43Wd4gwj Z3gQiYLDhtZk60MkzYYgWmwGMlUFntbeqKTxWBLtWvucxJijG46FhiAwVsuKUCGi9+nt El3GDpZn6QR3ntCP/95CwoLUgadtkhMw3+Oj/CpQaQ0HhZlG/gwzS5dvcJ1d3/xly9R5 QbtbP5RtrUvYgwiAbnlrZPflmPi4W+VLoEaaW/e0X7fF5kuqcTNpOG4SHtTYAnEEYJcT 1+WQ== X-Gm-Message-State: AODbwcDFM6Ds/dzWsbSI5mSQPpz+gsFnosIoCZrsWwbwbs35YTS8pi23 Br3nyLqZvQzpt4T4 X-Received: by 10.84.171.193 with SMTP id l59mr82884988plb.139.1496173448917; Tue, 30 May 2017 12:44:08 -0700 (PDT) Received: from [100.112.91.11] ([104.133.8.107]) by smtp.gmail.com with ESMTPSA id g75sm22873743pfd.83.2017.05.30.12.44.07 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 30 May 2017 12:44:07 -0700 (PDT) Date: Tue, 30 May 2017 12:43:59 -0700 (PDT) From: Hugh Dickins X-X-Sender: hugh@eggly.anvils To: "Aneesh Kumar K.V" Subject: 4.12-rc ppc64 4k-page needs costly allocations Message-ID: User-Agent: Alpine 2.11 (LSU 23 2013-08-11) MIME-Version: 1.0 X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Christoph Lameter , linuxppc-dev@lists.ozlabs.org, linux-mm@kvack.org Errors-To: linuxppc-dev-bounces+patchwork-incoming=ozlabs.org@lists.ozlabs.org Sender: "Linuxppc-dev" Since f6eedbba7a26 ("powerpc/mm/hash: Increase VA range to 128TB") I find that swapping loads on ppc64 on G5 with 4k pages are failing: SLUB: Unable to allocate memory on node -1, gfp=0x14000c0(GFP_KERNEL) cache: pgtable-2^12, object size: 32768, buffer size: 65536, default order: 4, min order: 4 pgtable-2^12 debugging increased min order, use slub_debug=O to disable. node 0: slabs: 209, objs: 209, free: 8 gcc: page allocation failure: order:4, mode:0x16040c0(GFP_KERNEL|__GFP_COMP|__GFP_NOTRACK), nodemask=(null) CPU: 1 PID: 6225 Comm: gcc Not tainted 4.12.0-rc2 #1 Call Trace: [c00000000090b5c0] [c0000000004f8478] .dump_stack+0xa0/0xcc (unreliable) [c00000000090b650] [c0000000000eb194] .warn_alloc+0xf0/0x178 [c00000000090b710] [c0000000000ebc9c] .__alloc_pages_nodemask+0xa04/0xb00 [c00000000090b8b0] [c00000000013921c] .new_slab+0x234/0x608 [c00000000090b980] [c00000000013b59c] .___slab_alloc.constprop.64+0x3dc/0x564 [c00000000090bad0] [c0000000004f5a84] .__slab_alloc.isra.61.constprop.63+0x54/0x70 [c00000000090bb70] [c00000000013b864] .kmem_cache_alloc+0x140/0x288 [c00000000090bc30] [c00000000004d934] .mm_init.isra.65+0x128/0x1c0 [c00000000090bcc0] [c000000000157810] .do_execveat_common.isra.39+0x294/0x690 [c00000000090bdb0] [c000000000157e70] .SyS_execve+0x28/0x38 [c00000000090be30] [c00000000000a118] system_call+0x38/0xfc I did try booting with slub_debug=O as the message suggested, but that made no difference: it still hoped for but failed on order:4 allocations. I wanted to try removing CONFIG_SLUB_DEBUG, but didn't succeed in that: it seemed to be a hard requirement for something, but I didn't find what. I did try CONFIG_SLAB=y instead of SLUB: that lowers these allocations to the expected order:3, which then results in OOM-killing rather than direct allocation failure, because of the PAGE_ALLOC_COSTLY_ORDER 3 cutoff. But makes no real difference to the outcome: swapping loads still abort early. Relying on order:3 or order:4 allocations is just too optimistic: ppc64 with 4k pages would do better not to expect to support a 128TB userspace. I tried the obvious partial revert below, but it's not good enough: the system did not boot beyond Starting init: /sbin/init exists but couldn't execute it (error -7) Starting init: /bin/sh exists but couldn't execute it (error -7) Kernel panic - not syncing: No working init found. ... --- 4.12-rc2/arch/powerpc/include/asm/book3s/64/hash-4k.h +++ linux/arch/powerpc/include/asm/book3s/64/hash-4k.h @@ -8,7 +8,7 @@ #define H_PTE_INDEX_SIZE 9 #define H_PMD_INDEX_SIZE 7 #define H_PUD_INDEX_SIZE 9 -#define H_PGD_INDEX_SIZE 12 +#define H_PGD_INDEX_SIZE 9 #ifndef __ASSEMBLY__ #define H_PTE_TABLE_SIZE (sizeof(pte_t) << H_PTE_INDEX_SIZE) --- 4.12-rc2/arch/powerpc/include/asm/processor.h +++ linux/arch/powerpc/include/asm/processor.h @@ -110,7 +110,7 @@ void release_thread(struct task_struct * #define TASK_SIZE_128TB (0x0000800000000000UL) #define TASK_SIZE_512TB (0x0002000000000000UL) -#ifdef CONFIG_PPC_BOOK3S_64 +#if defined(CONFIG_PPC_BOOK3S_64) && defined(CONFIG_PPC_64K_PAGES) /* * Max value currently used: */