From patchwork Sun Jul 3 14:12:00 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Rapoport X-Patchwork-Id: 12904373 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 3768AC433EF for ; Sun, 3 Jul 2022 14:13:27 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id D3DD4900003; Sun, 3 Jul 2022 10:13:26 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id CED306B0080; Sun, 3 Jul 2022 10:13:26 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id BDD08900003; Sun, 3 Jul 2022 10:13:26 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id AFDE56B007E for ; Sun, 3 Jul 2022 10:13:26 -0400 (EDT) Received: from smtpin11.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay12.hostedemail.com (Postfix) with ESMTP id 920711206EE for ; Sun, 3 Jul 2022 14:13:26 +0000 (UTC) X-FDA: 79645981212.11.B872D24 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf05.hostedemail.com (Postfix) with ESMTP id 3F671100061 for ; Sun, 3 Jul 2022 14:13:26 +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 B8D9260EAE; Sun, 3 Jul 2022 14:13:25 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id CD358C341CA; Sun, 3 Jul 2022 14:13:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1656857605; bh=2HLdhGohvtU2vrk5zor8RsOnp9/oF/6GSuTN52JoA1s=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=uiJEPNefQ1Xwgm1PCjI1uzqAfLOCjVuzKjLNFQ/4h8ca55UN/5ogUX2EsaJt0Ewhd tpWMJ5kQmPDezI3ykQebfoZkWyRYsGVVU6rbOL0jzC3KbPchJQ7b9Oj44Muu+0YJWs HyWURIoPgsirPb4gNJ+sa04pTj8YcYSiiit/Ar0nwIGE3Q4xn5EJw9d5qbmqnn+F/D CpkpqjzGVHfXSduECjvmjHJKd/FIbiLu6fbGxADk9f8I3+W0Vm2yFv4zOrYuBY3EX7 h5F1L0WwnnEZvSU45s+rUdz0tSDRdKYdsn40qGClG1q48k/BUGv+cPhbVizr+529+f f5YkfcNNgUfQQ== 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 , 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 11/14] loongarch: drop definition of PUD_ORDER Date: Sun, 3 Jul 2022 17:12:00 +0300 Message-Id: <20220703141203.147893-12-rppt@kernel.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220703141203.147893-1-rppt@kernel.org> References: <20220703141203.147893-1-rppt@kernel.org> MIME-Version: 1.0 ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1656857606; a=rsa-sha256; cv=none; b=ofzecOI68K7J8HP2+/cfs+Txqoea0ITl5NCa9XhDrJTuUGXKlSEwfGW7fyxILEQWqcZeXe j47dnGcSHtjj5Zz5+/Qku1tBh45VJ5guLHwpC9AsfI7AslzXcmdBkCHiJsnNIOeqSTDrd5 oNdkRbqNoENEl690KUIsZMyICbu3GRk= ARC-Authentication-Results: i=1; imf05.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=uiJEPNef; 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-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1656857606; 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=p144wRFV6eCCwSqQM5a+KotTXWRrNtfM8hfMUf4YOKk=; b=GvDuscq2FKvFMByRDiUiSkHAYW19dnBaia0Ibj4LeYLHOw/pfB8ahZshvADuv4ICKba3OP 4oEPsgsGBAGST+J1z4uc2jQ+S2oR0zNb1044Q5h0MMLuLnF1tNXU/0prFiUHQ8ZjrbHEfC Q+iRIPMqPmYpca9hQAWpayyF/zFd1nk= X-Rspamd-Queue-Id: 3F671100061 X-Rspam-User: Authentication-Results: imf05.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=uiJEPNef; 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: rspam02 X-Stat-Signature: qbnswtxf3wyd7o7oz6nonzjtbx6ru58j X-HE-Tag: 1656857606-274211 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 --- 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)