From patchwork Tue Jul 5 15:47:04 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Rapoport X-Patchwork-Id: 12906801 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 577A3C43334 for ; Tue, 5 Jul 2022 15:48:34 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id D7C046B007D; Tue, 5 Jul 2022 11:48:33 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id D2B636B0080; Tue, 5 Jul 2022 11:48:33 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id BF34A6B0081; Tue, 5 Jul 2022 11:48:33 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id B0E5C6B007D for ; Tue, 5 Jul 2022 11:48:33 -0400 (EDT) Received: from smtpin01.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay11.hostedemail.com (Postfix) with ESMTP id 8AC7180B18 for ; Tue, 5 Jul 2022 15:48:33 +0000 (UTC) X-FDA: 79653478506.01.62A4B4E Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf05.hostedemail.com (Postfix) with ESMTP id 0E234100005 for ; Tue, 5 Jul 2022 15:48:32 +0000 (UTC) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 2521B61B53; Tue, 5 Jul 2022 15:48:32 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 67223C341CA; Tue, 5 Jul 2022 15:48:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1657036111; bh=XUFB6Va8O4VOUoTqeJ/SzqmIGXceAjPUgZz79vTlh1E=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=G94szT3+bFQ+wpJnBwp0DBOJnWEkyAC9OpsGfwqaaGXZ52mMM1e0fQTTrRr23p6XO WLqUsWA12m7vCBEqvq1B9sfE/8cirwRjD2dMNaWZLserQN76JvFOx4vxkXpBu7UKXX uiONMQD/rbRfNPoolaXP1Etwh0rj356yp+hlBaes6mIZwiv2i7TemISbRgKFzAmN+H blCQUYLDtRYUfHM+mZx/NL4F8zp+3NXgNnhqtaerlx+MFrKRHn5Bftnh+3NHU9waAK ABvPXtRin8neCNzfKG/9p6oxUmjb5QVTLbsl+ToTfxvdYrMaUIk6l6kVlUbFAyNGZs EZG52hwrmYQiw== From: Mike Rapoport To: Andrew Morton Cc: Arnd Bergmann , Dinh Nguyen , Guo Ren , Helge Deller , Huacai Chen , "James E.J. Bottomley" , Matthew Wilcox , Max Filippov , Mike Rapoport , Mike Rapoport , "Russell King (Oracle)" , Thomas Bogendoerfer , WANG Xuerui , linux-arch@vger.kernel.org, linux-csky@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mips@vger.kernel.org, linux-mm@kvack.org, linux-parisc@vger.kernel.org, linux-xtensa@linux-xtensa.org, loongarch@lists.linux.dev Subject: [PATCH v2 11/15] loongarch: drop definition of PUD_ORDER Date: Tue, 5 Jul 2022 18:47:04 +0300 Message-Id: <20220705154708.181258-12-rppt@kernel.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220705154708.181258-1-rppt@kernel.org> References: <20220705154708.181258-1-rppt@kernel.org> MIME-Version: 1.0 ARC-Authentication-Results: i=1; imf05.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=G94szT3+; dmarc=pass (policy=none) header.from=kernel.org; spf=pass (imf05.hostedemail.com: domain of rppt@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=rppt@kernel.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1657036113; a=rsa-sha256; cv=none; b=ATMFKNltjdbnQQC6P+MI7Si4qKUacH2HDbAWVNqETKxeXbS2yUWAeCqh+0TX4Jo99B6dHI CUJ68+BZ0+MBhD2nMz+UWYL2ooZjSQerwvnN4Mk/STaGD1HJMEA64gQRlF+3iqJYWEKN5i gwGUuVGYx8HImdC1gS5mOAZCJbZtwmA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1657036113; 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:in-reply-to:references:references:dkim-signature; bh=xXgWexHmgC+vNE2axCjWJRulUAe5PSfo2lAG6suLtG8=; b=JNXmG2NH3HoHO0KjxzKwl6LOhXCyXsoc+d/Akyzq2jsa7sh2IG2UwjECyeeeFIGXLgvx8D irXYtVCn3wbWzVMF9k8LNHDGEYGjvj8GwOD/bA2USVt16NKOdaCd1nMS1M6In/kQG3m/hJ e7qCZ7aLQDtp0WEFqk44oc2UXuR4kvQ= Authentication-Results: imf05.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=G94szT3+; dmarc=pass (policy=none) header.from=kernel.org; spf=pass (imf05.hostedemail.com: domain of rppt@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=rppt@kernel.org X-Rspamd-Server: rspam09 X-Rspam-User: X-Stat-Signature: zgmzztqjoeg7h6gsub3ut3kpg8d7r9gx X-Rspamd-Queue-Id: 0E234100005 X-HE-Tag: 1657036112-726590 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: From: Mike Rapoport This is the order of the page table allocation, not the order of a PUD. Since its always hardwired to 0, simply drop it. Signed-off-by: Mike Rapoport Acked-by: Huacai Chen --- arch/loongarch/include/asm/pgalloc.h | 2 +- arch/loongarch/include/asm/pgtable.h | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/arch/loongarch/include/asm/pgalloc.h b/arch/loongarch/include/asm/pgalloc.h index 93e785f46639..4bfeb3c9c9ac 100644 --- a/arch/loongarch/include/asm/pgalloc.h +++ b/arch/loongarch/include/asm/pgalloc.h @@ -90,7 +90,7 @@ static inline pud_t *pud_alloc_one(struct mm_struct *mm, unsigned long address) { pud_t *pud; - pud = (pud_t *) __get_free_pages(GFP_KERNEL, PUD_ORDER); + pud = (pud_t *) __get_free_page(GFP_KERNEL); if (pud) pud_init((unsigned long)pud, (unsigned long)invalid_pmd_table); return pud; diff --git a/arch/loongarch/include/asm/pgtable.h b/arch/loongarch/include/asm/pgtable.h index f926537d2233..a97996fefaed 100644 --- a/arch/loongarch/include/asm/pgtable.h +++ b/arch/loongarch/include/asm/pgtable.h @@ -22,7 +22,6 @@ #endif #define PGD_ORDER 0 -#define PUD_ORDER 0 #if CONFIG_PGTABLE_LEVELS == 2 #define PGDIR_SHIFT (PAGE_SHIFT + (PAGE_SHIFT - 3)) @@ -38,7 +37,7 @@ #define PUD_SHIFT (PMD_SHIFT + (PAGE_SHIFT - 3)) #define PUD_SIZE (1UL << PUD_SHIFT) #define PUD_MASK (~(PUD_SIZE-1)) -#define PGDIR_SHIFT (PUD_SHIFT + (PAGE_SHIFT + PUD_ORDER - 3)) +#define PGDIR_SHIFT (PUD_SHIFT + (PAGE_SHIFT - 3)) #endif #define PGDIR_SIZE (1UL << PGDIR_SHIFT) @@ -48,7 +47,7 @@ #define PTRS_PER_PGD ((PAGE_SIZE << PGD_ORDER) >> 3) #if CONFIG_PGTABLE_LEVELS > 3 -#define PTRS_PER_PUD ((PAGE_SIZE << PUD_ORDER) >> 3) +#define PTRS_PER_PUD (PAGE_SIZE >> 3) #endif #if CONFIG_PGTABLE_LEVELS > 2 #define PTRS_PER_PMD (PAGE_SIZE >> 3)