From patchwork Mon Jul 31 17:03:29 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vishal Moola X-Patchwork-Id: 13335129 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 91532C04FE1 for ; Mon, 31 Jul 2023 17:04:53 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id D83516B0187; Mon, 31 Jul 2023 13:04:38 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id D31B328007A; Mon, 31 Jul 2023 13:04:38 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id AC0A36B0189; Mon, 31 Jul 2023 13:04:38 -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 9A4816B0187 for ; Mon, 31 Jul 2023 13:04:38 -0400 (EDT) Received: from smtpin03.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 778D712022D for ; Mon, 31 Jul 2023 17:04:38 +0000 (UTC) X-FDA: 81072531036.03.07ADCFB Received: from mail-yb1-f171.google.com (mail-yb1-f171.google.com [209.85.219.171]) by imf07.hostedemail.com (Postfix) with ESMTP id 5828F40013 for ; Mon, 31 Jul 2023 17:04:35 +0000 (UTC) Authentication-Results: imf07.hostedemail.com; dkim=pass header.d=gmail.com header.s=20221208 header.b=NsFqLoWt; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf07.hostedemail.com: domain of vishal.moola@gmail.com designates 209.85.219.171 as permitted sender) smtp.mailfrom=vishal.moola@gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1690823076; 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=K9EaWELDe99nUon5K3Z+iJo2yPeaFSzyCnD+eyoagSI=; b=AN9WMjETQQ13/2ItlNPoLrqEeWH8udLBjzFHslNCsZdllgFP00A8fOUYivRqRIj2GoyIYj fCK/WgmfCJUxKGWzYMD/r8m8RZnQKs6k47BAT59ftEjOLnv4PJSYE0cj12WpbT8RTVSMkH klCUWRHGbAUMt3tdvsETpB8t9staWz8= ARC-Authentication-Results: i=1; imf07.hostedemail.com; dkim=pass header.d=gmail.com header.s=20221208 header.b=NsFqLoWt; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf07.hostedemail.com: domain of vishal.moola@gmail.com designates 209.85.219.171 as permitted sender) smtp.mailfrom=vishal.moola@gmail.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1690823076; a=rsa-sha256; cv=none; b=Vi691v2+Sth5Q+RYsSf7xWJoBwmpgJu9WCbd/+3vdK2Gmjgdjy4eCkInuoKyDF2Z+oLkG1 G56HTYz4EmZxbbKP7gEoP33uU4+xHmdAulbO8dPX6GFM5PH0tFOatAsBit8/U0nPMBgf/S bS1uuzEh6zMUaefmI4+rJu3BwgVOHFo= Received: by mail-yb1-f171.google.com with SMTP id 3f1490d57ef6-d167393b95aso8382769276.0 for ; Mon, 31 Jul 2023 10:04:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1690823075; x=1691427875; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=K9EaWELDe99nUon5K3Z+iJo2yPeaFSzyCnD+eyoagSI=; b=NsFqLoWt3v/Ei4hrw5AsnvwdpZbLVDKyj7Tbvrs08XADPJ7gaOSxsw7sciWyK4ium/ IicTt5pAnx/uEvhHlkhBbrdEgtE6/Y30DbetyPtuylWlm9M94rgMfdNkMfsGqtqBt9r5 2L6Wjhryz46RjM7Eb4DDBBbwHfcSN7h5N/Jso4kYni+cF2Cm7JoIdTfshA0rAirRtgJq t1r00+5UN5MvK3JKDaigYuLE4bDBuDPbT6+YGl+hj7DsF2cKQbydBN3rr041uGf1vOTw rMTuYysQGj/R6E2nTgdgPgBnp/CeSE0cUWUK6rVcO8oVilzfT/uwMzlyU+7MnJSFTrKk qPDw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1690823075; x=1691427875; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=K9EaWELDe99nUon5K3Z+iJo2yPeaFSzyCnD+eyoagSI=; b=BcHLg1GFoQ+25mTOpwY9maf/7A/En/3BtpkZGqU62XiHEKCHxHiq5WFZYQpjB8ASA8 zkzWiBCdEaPIsXE7Yap8MS+hq1XpVpxWSeiRXQws/T0fzftJJwn0NdL2EQv3A5OcM4GA a06ztGto0nuAtfiuAcESIyIM2mYCHXfKPkIA1MhiSeUgeh5XtJr/gaeLCD1g3e9jDESF FD2ZcYQ7X3FAVKCdr24oq/jBIOHutlL5GmJZLh0D4HVZH3XNVwkwU4Wo4qcj7b0ek+6s fhpLprLUEN/Y+KqMjvacOwYLXB4T3QTIeAdRa25LA4rtPR8eeXHpTotSESPKMQ9Vk0sD yhEg== X-Gm-Message-State: ABy/qLabCXi4oEyJxtvP8yMbpl6zeQEh6xox+DwwND/lwv8E4k/DTjOy l1rwjId3oyxTvbLSp/U0PNU= X-Google-Smtp-Source: APBJJlGLJI7wOi/cAC+4887p5NxC1O6Jx9Z8tS0dkQscAqT6FlNcjE8alBIW2Z/pk8K3FJGLN+6VNQ== X-Received: by 2002:a25:ac99:0:b0:d35:ee7e:349 with SMTP id x25-20020a25ac99000000b00d35ee7e0349mr1328711ybi.1.1690823074854; Mon, 31 Jul 2023 10:04:34 -0700 (PDT) Received: from unknowna0e70b2ca394.attlocal.net ([2600:1700:2f7d:1800::16]) by smtp.googlemail.com with ESMTPSA id x31-20020a25ac9f000000b00c832ad2e2eesm2511833ybi.60.2023.07.31.10.04.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 31 Jul 2023 10:04:34 -0700 (PDT) From: "Vishal Moola (Oracle)" To: Andrew Morton , Matthew Wilcox Cc: linux-mm@kvack.org, linux-arch@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-csky@vger.kernel.org, linux-hexagon@vger.kernel.org, loongarch@lists.linux.dev, linux-m68k@lists.linux-m68k.org, linux-mips@vger.kernel.org, linux-openrisc@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-riscv@lists.infradead.org, linux-s390@vger.kernel.org, linux-sh@vger.kernel.org, sparclinux@vger.kernel.org, linux-um@lists.infradead.org, xen-devel@lists.xenproject.org, kvm@vger.kernel.org, Hugh Dickins , "Vishal Moola (Oracle)" , Mike Rapoport Subject: [PATCH mm-unstable v8 28/31] sparc64: Convert various functions to use ptdescs Date: Mon, 31 Jul 2023 10:03:29 -0700 Message-Id: <20230731170332.69404-29-vishal.moola@gmail.com> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20230731170332.69404-1-vishal.moola@gmail.com> References: <20230731170332.69404-1-vishal.moola@gmail.com> MIME-Version: 1.0 X-Rspamd-Queue-Id: 5828F40013 X-Rspam-User: X-Rspamd-Server: rspam04 X-Stat-Signature: nu1girfcxb7cbr3m18hwgy718zw6jwbm X-HE-Tag: 1690823075-428330 X-HE-Meta: U2FsdGVkX19ceEg+dxXSozsmgcd5VY0mIYohBiUlKEjGNYvyc06rd6xZVw2iSpy/YQKMKU+SuLNQMrktNIPk+lwHxskVBdSEaO+aHnVdk13AgaOegwiQX4KIOsLSDGmJsQPNGM03hyfUPhGIwZIb1aBE0UUEjEU+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vcUYLR4RFw4paaX7ZpNI/CwDpBSijzXFRBWw7kU9b+OK8XHe9cFKBjECAzi3bKlrDTHFbbrH1psbXyjmBsKN1Ytev/ZH4jxj1RZOpoJJGtuWv2z+thKAWbcm5OVRiKSKDclIz5BwN0XCna/jwM9VHX1pHEb9b3DzsXkXF+NqJdbKuHvo+SPynXFuF6CE8cfiiOK+yCvj3oGtfZAcfKacDiYrDMGhpj/E4klk8kuAZ78uTO/pN5avOnkos2F1JRa/oVggtUAn0Q2ZuJMi2XdMQ2eCDd5R8GlWQoJChE49Upm5dwj5IA4LWH+P7ByprDhcIGOkLCChQbXyHYS8+Q== 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: As part of the conversions to replace pgtable constructor/destructors with ptdesc equivalents, convert various page table functions to use ptdescs. Signed-off-by: Vishal Moola (Oracle) Acked-by: Mike Rapoport (IBM) --- arch/sparc/mm/init_64.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/arch/sparc/mm/init_64.c b/arch/sparc/mm/init_64.c index 0d7fd793924c..9a63a3e08e40 100644 --- a/arch/sparc/mm/init_64.c +++ b/arch/sparc/mm/init_64.c @@ -2893,14 +2893,15 @@ pte_t *pte_alloc_one_kernel(struct mm_struct *mm) pgtable_t pte_alloc_one(struct mm_struct *mm) { - struct page *page = alloc_page(GFP_KERNEL | __GFP_ZERO); - if (!page) + struct ptdesc *ptdesc = pagetable_alloc(GFP_KERNEL | __GFP_ZERO, 0); + + if (!ptdesc) return NULL; - if (!pgtable_pte_page_ctor(page)) { - __free_page(page); + if (!pagetable_pte_ctor(ptdesc)) { + pagetable_free(ptdesc); return NULL; } - return (pte_t *) page_address(page); + return ptdesc_address(ptdesc); } void pte_free_kernel(struct mm_struct *mm, pte_t *pte) @@ -2910,10 +2911,10 @@ void pte_free_kernel(struct mm_struct *mm, pte_t *pte) static void __pte_free(pgtable_t pte) { - struct page *page = virt_to_page(pte); + struct ptdesc *ptdesc = virt_to_ptdesc(pte); - pgtable_pte_page_dtor(page); - __free_page(page); + pagetable_pte_dtor(ptdesc); + pagetable_free(ptdesc); } void pte_free(struct mm_struct *mm, pgtable_t pte)