From patchwork Fri May 19 11:38:06 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Ellerman X-Patchwork-Id: 13248246 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id C728CC77B7A for ; Fri, 19 May 2023 11:39:10 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 27848900004; Fri, 19 May 2023 07:39:10 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 201E2900003; Fri, 19 May 2023 07:39:10 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 0A2B7900004; Fri, 19 May 2023 07:39:10 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id E8B47900003 for ; Fri, 19 May 2023 07:39:09 -0400 (EDT) Received: from smtpin18.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id BE4C91207CA for ; Fri, 19 May 2023 11:39:09 +0000 (UTC) X-FDA: 80806808418.18.EC3FA36 Received: from gandalf.ozlabs.org (gandalf.ozlabs.org [150.107.74.76]) by imf25.hostedemail.com (Postfix) with ESMTP id 815F0A000A for ; Fri, 19 May 2023 11:39:06 +0000 (UTC) Authentication-Results: imf25.hostedemail.com; dkim=pass header.d=ellerman.id.au header.s=201909 header.b=T+46Tuva; spf=pass (imf25.hostedemail.com: domain of michael@ellerman.id.au designates 150.107.74.76 as permitted sender) smtp.mailfrom=michael@ellerman.id.au; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1684496347; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:references:dkim-signature; bh=NAc7Jbrbt9R2t5oRIRdebRV7rWGxeW4bzzaHTICvqRo=; b=ukgvJcOJAKBgoOlh7aKcRBUikVowAVG+Q6n14YE/mgp24VuUVxb3M2nufQPSWcb0AhWKaH OHlzzmbcFcScKt320LdhXmPnm5IS5hwsIDn+gPHduH9wI1qqjL/SJTFyf8+jkSrVEcp5Rx bHPneVfbJPc29jf1So/+GnS9fuCqxkk= ARC-Authentication-Results: i=1; imf25.hostedemail.com; dkim=pass header.d=ellerman.id.au header.s=201909 header.b=T+46Tuva; spf=pass (imf25.hostedemail.com: domain of michael@ellerman.id.au designates 150.107.74.76 as permitted sender) smtp.mailfrom=michael@ellerman.id.au; dmarc=none ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1684496347; a=rsa-sha256; cv=none; b=tAZ2vtY2eK5+pKl5aEe83+fBiw5bRQ+N53Apagl0LL9NSYSBcSxajP7YkoTTJ98zLy25ov GxuQ0K4egI/ybYfvCGmXn5NgEyhtLmPKy2cVrU1dfMYcThV/5NJbKeA3FPV2dj2HDEUlaR dmnBXn6zqb7FvNT+mLYcZCsG62zylFI= Received: from authenticated.ozlabs.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mail.ozlabs.org (Postfix) with ESMTPSA id 4QN4cQ5kF5z4x2j; Fri, 19 May 2023 21:39:02 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ellerman.id.au; s=201909; t=1684496342; bh=NAc7Jbrbt9R2t5oRIRdebRV7rWGxeW4bzzaHTICvqRo=; h=From:To:Cc:Subject:Date:From; b=T+46TuvaC8gPkIyL1a+uFbUzvUJTbDFjUaTfV7lfc1K2daZowQL1sMickQ+C5XRUB JLL2ZKiS+lXEJ3eciijEpCYGARO/KgMregjkNawTg24UaQ6rhiBy6SExkZBWObpNUp 87Z8imxLbc9cGggEH87s3dMY4UmwmrkXSkdO8fCM9mAwhPmjRNsmO11ngC5V5G2ry0 O23aMInMrAJVijHNQFdZA1StI28zZH9bKWDUCnvI2rMvIQiROyWDqazW5yhHE7m+Ko EsbgHrO3Yv5ufaHtBcCOfM565q1ldgGG2LOPM6tyULRAbbsTG0oZaEioOizbKEqwTS QG0isTrbxlZHg== From: Michael Ellerman To: Cc: rppt@kernel.org, , Subject: [PATCH] powerpc/mm: Reinstate ARCH_FORCE_MAX_ORDER ranges Date: Fri, 19 May 2023 21:38:06 +1000 Message-Id: <20230519113806.370635-1-mpe@ellerman.id.au> X-Mailer: git-send-email 2.40.1 MIME-Version: 1.0 X-Rspamd-Queue-Id: 815F0A000A X-Rspam-User: X-Stat-Signature: kcfuh3sjmt8i53a3mji3gqyc19wbt7y1 X-Rspamd-Server: rspam01 X-HE-Tag: 1684496346-933469 X-HE-Meta: U2FsdGVkX1+decZUXRgBiNqZhr871SpSGMxWCbvJVeuyu1mIjYvo6jUHAjkB8tdDKo3Rt4ExPq1vwuIUjBWS0ZSGeOowt0JwjlfbERQWEP7+Gi7gCX6dliSegFfTxQLwZpd0W/AD/eh62juc5BpfHQ/lMzjyiHwhYO4SMbiiuj3kYnam0LH6LvOSob0sUUaAziL3wqwhVOetPM3n+ut6ZOMcGa7Jjn5PC6P1bHm2S9y6j4nnUHtzq67m8wc/0wKEWkrG6yTYyPmUqHCzvBrPiiEROiyibr1gp0qkdOIq92wAqYpERlt2r1zGSia0AQ0IJj7vAAGrLV+2gsDsyoxFgGI5lPkYPaenjinuOMZ/Pt6Rjp9fVhouAw+H8rVqO6LbPEsUVU7ar4Y/+gxSZjVO2QccEO4Lt+EgLQq13AitGm+jj2/32Jf6HtIY4+PgBcnhN+ytgwux2561m/Y8Vp1FkuU8WpL9Yztv0TPv6PViVuHOklGjySKjhWnujLf8pxE3uI2lk70xT46YS/yCHme6NbDw/GeyxdEMJAcDn9SLjWq0gJDTiTuvQ6hcahSAdXRFrWnPp7cYBQh4rop64hOBnkjBF7y7Ivy5gWOAlN/UZQ/7hFPAstJ6XxK7+c9O/W/NAKkjXvZ8gswBTUtQzy5pgALcGi36vPKMz86Er5Edv5R3+EZTwO6v1ncvPMxDJ6ZTO8zQxaOJ9SMngzO7W2LmYMaobobkhHxmhsOX5eKR2LGPlWSWrG/4EImJN2gW6h2wdUf5Ef5MgiQmPOpDWgkkXS6L5xj/e23oIGOjJhFZeENWfVb/ctI1a5Mlue2BIJ5BrxgC6PnvpYylF03gZk/ppGLwwAYLaewT8j2vx4V2BK+9pRI/F3Qgv7SYtuYqdanomgQx6eoP++arMFsMH9vx2dYJ6OgsQ3kZb2cPEK5gAryE6cMS9WSOlxkZSmGK3p4lW8+GBHwmFrVIKFQk0Gl ffgVfl9i jQfq3v2BiZq6eH+XYXKORxi1NhTPdKe5tAlNewsMd4UbUFie2Uc9nHF+URaLp9P1axfXTNK2enGBAqVlp0zptqY02OrxosOkks+1ENdwENCRCEseg2xZ4L7Rc/w/fjquUsMC8IQWF9Jt6TRCBLVwLYTR0IBiaSb/67zm8q4Tm2YeGH1H/OSjnZEIXmuPdyQuzFTkwYgCPxteaDeIbxgYMRNXwl6u/+Zc5P/Y73gn2NusquSBSQm7rCq9ZZZ5pUe/eS0I+gOW9qKAT/dn24eHoF6ICIn4btiQOU1pF1vWtP3VUpJk0db8RrcE9Nz2Fa80UO/caZUgTOBJ45zFwMDC1t6cZFNHYsFZUC/wh X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Commit 1e8fed873e74 ("powerpc: drop ranges for definition of ARCH_FORCE_MAX_ORDER") removed the limits on the possible values for ARCH_FORCE_MAX_ORDER. However removing the ranges entirely causes some common work flows to break. For example building a defconfig (which uses 64K pages), changing the page size to 4K, and rebuilding used to work, because ARCH_FORCE_MAX_ORDER would be clamped to 12 by the ranges. With the ranges removed it creates a kernel that builds but crashes at boot: kernel BUG at mm/huge_memory.c:470! Oops: Exception in kernel mode, sig: 5 [#1] ... NIP hugepage_init+0x9c/0x278 LR do_one_initcall+0x80/0x320 Call Trace: do_one_initcall+0x80/0x320 kernel_init_freeable+0x304/0x3ac kernel_init+0x30/0x1a0 ret_from_kernel_user_thread+0x14/0x1c The reasoning for removing the ranges was that some of the values were too large. So take that into account and limit the maximums to 10 which is the default max, except for the 4K case which uses 12. Fixes: 1e8fed873e74 ("powerpc: drop ranges for definition of ARCH_FORCE_MAX_ORDER") Signed-off-by: Michael Ellerman --- arch/powerpc/Kconfig | 6 ++++++ 1 file changed, 6 insertions(+) I plan to merge this via the powerpc fixes branch. diff --git a/arch/powerpc/Kconfig b/arch/powerpc/Kconfig index 539d1f03ff42..bff5820b7cda 100644 --- a/arch/powerpc/Kconfig +++ b/arch/powerpc/Kconfig @@ -906,11 +906,17 @@ config DATA_SHIFT config ARCH_FORCE_MAX_ORDER int "Order of maximal physically contiguous allocations" + range 7 8 if PPC64 && PPC_64K_PAGES default "8" if PPC64 && PPC_64K_PAGES + range 12 12 if PPC64 && !PPC_64K_PAGES default "12" if PPC64 && !PPC_64K_PAGES + range 8 10 if PPC32 && PPC_16K_PAGES default "8" if PPC32 && PPC_16K_PAGES + range 6 10 if PPC32 && PPC_64K_PAGES default "6" if PPC32 && PPC_64K_PAGES + range 4 10 if PPC32 && PPC_256K_PAGES default "4" if PPC32 && PPC_256K_PAGES + range 10 10 default "10" help The kernel page allocator limits the size of maximal physically