From patchwork Mon May 1 19:28:27 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vishal Moola X-Patchwork-Id: 13228033 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 E5F9CC87FE2 for ; Mon, 1 May 2023 19:29:32 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 2AB81280011; Mon, 1 May 2023 15:29:24 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 2354B280002; Mon, 1 May 2023 15:29:24 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 039D1280011; Mon, 1 May 2023 15:29:23 -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 E1B81280002 for ; Mon, 1 May 2023 15:29:23 -0400 (EDT) Received: from smtpin26.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id BDF26A0415 for ; Mon, 1 May 2023 19:29:23 +0000 (UTC) X-FDA: 80742675006.26.2D0F965 Received: from mail-pl1-f171.google.com (mail-pl1-f171.google.com [209.85.214.171]) by imf24.hostedemail.com (Postfix) with ESMTP id 02668180016 for ; Mon, 1 May 2023 19:29:21 +0000 (UTC) Authentication-Results: imf24.hostedemail.com; dkim=pass header.d=gmail.com header.s=20221208 header.b="YCg1YMo/"; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf24.hostedemail.com: domain of vishal.moola@gmail.com designates 209.85.214.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=1682969362; 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=CSVYEUhM0zGHlDR1yqa5KIpwwPynV1rh1Z3AvIT239o=; b=mBzSQjTmxk6N46qmflcDKFcAMo+1SGLigKmNpKm+yNDQgQn5xZRW2bqOe1q7gd8Gt2Iy0d OT3imXzkRXyMBVTboWeWd2GpAAnQ0mWgWlp/aOprdF9xHq5wiSJ37gNmkLFDP+ZeOv+6RI KAHW/UBEhnaNLFX7p/boeRDme841wSs= ARC-Authentication-Results: i=1; imf24.hostedemail.com; dkim=pass header.d=gmail.com header.s=20221208 header.b="YCg1YMo/"; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf24.hostedemail.com: domain of vishal.moola@gmail.com designates 209.85.214.171 as permitted sender) smtp.mailfrom=vishal.moola@gmail.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1682969362; a=rsa-sha256; cv=none; b=PoHGqjPvBHNMzrTmcvt75NnmsesAVJAD+vmQgH74pF112X0Sk/Im/I1wq5IseNLQr3EikB aALETGvT/Y/pjdrpLGYlZzYyjmcI/n3/6W9dyq5mMt15g+LpO8ttJ3GB0WcpYuJeUfeiIE 5vRHPTgMmHuhouK8+/I+KTBxa7VXovs= Received: by mail-pl1-f171.google.com with SMTP id d9443c01a7336-1aaf70676b6so9595045ad.3 for ; Mon, 01 May 2023 12:29:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1682969361; x=1685561361; 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=CSVYEUhM0zGHlDR1yqa5KIpwwPynV1rh1Z3AvIT239o=; b=YCg1YMo/xitXPr8EH+7i7/M0wYddD4PRgw+Xim9LG20m92WUdC9kOQT3fMeSkFJ8bz 2xW9Qv874by/73QMdHiVk+wqz4B7HUYL6Uj2zbe5cOYZkoH3JAXPoFdQlYFWToTwzHn7 dFfF9W+SZdFlY3dKNimMml0EcpIP5K8qP91gmqtjuJ3sBzpu94RZheVZlyc0ZtXP5Kh9 Ho0HyuApLfDJnfV0KIWHGVL4xeGycAgKdLMplPIR2oWrmLtc//uxDTAq/yAuqmVSMzMJ fvK8MGrkhlBYA+kuhjIoxK7FCwuGLTfgfMGFdrbgTVFBoKNwWCi+6p4VuuSzDnIOEdqU o3Sw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682969361; x=1685561361; 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=CSVYEUhM0zGHlDR1yqa5KIpwwPynV1rh1Z3AvIT239o=; b=XOaiJLqCHdXU/T2ZgIhEflj6pFnSPS95blzjq4euYg6WZR1Jsto5fvnwT3OJufLV40 1rKFOSo524VHvBNCASKwo3mfuGTNe+bDXgIOhLM5H48MljkXv//jfv1h5dBEJdz2FAk8 bKIZ8gwMgnVrf+8b3fW4B5MYquY3a/utNChRSHpMuti25zeVDIH3EEJQKTbBmutlmUm9 cK3Yprm4EcYBaLTd3/aanrit22LAvFApwN5xUVyQMmlEoCCitb/x7dJRnlw30BJ3kB9x LgBptZC85wrVdqpiJ4LEbbh+0/cHoNqUp3MV7GGSg8IS95QBLMKOxyeEqbnU4yM0vEA2 PwEg== X-Gm-Message-State: AC+VfDyuwGHTx0RN+7kpxJNQxYGH+4JvGBhaBGicYs9JZ36TVG/gc/ji WYI3pJTNPv8MUGBW0M4XBxY= X-Google-Smtp-Source: ACHHUZ6yreaxJl7mf5rX62OpE7ktDECZCzzaxE5NqOb8jR7RBUIdxZHYmi631H3wh4Z5BZGAmm3BhA== X-Received: by 2002:a17:902:c712:b0:1ab:3ba:d2c1 with SMTP id p18-20020a170902c71200b001ab03bad2c1mr1428915plp.44.1682969360924; Mon, 01 May 2023 12:29:20 -0700 (PDT) Received: from fedora.hsd1.ca.comcast.net ([2601:644:937f:7f20::9a2c]) by smtp.googlemail.com with ESMTPSA id u8-20020a170902bf4800b0019c13d032d8sm18175622pls.253.2023.05.01.12.29.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 01 May 2023 12:29:20 -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, "Vishal Moola (Oracle)" , "David S. Miller" Subject: [PATCH v2 32/34] sparc: Convert pgtable_pte_page_{ctor, dtor}() to ptdesc equivalents Date: Mon, 1 May 2023 12:28:27 -0700 Message-Id: <20230501192829.17086-33-vishal.moola@gmail.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230501192829.17086-1-vishal.moola@gmail.com> References: <20230501192829.17086-1-vishal.moola@gmail.com> MIME-Version: 1.0 X-Rspam-User: X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: 02668180016 X-Stat-Signature: ru5fz199n5jg8n6tm66nizmca8u7yrb1 X-HE-Tag: 1682969361-71813 X-HE-Meta: U2FsdGVkX1/0agYjxFp7VNfl5E8nfkmfKEiryvERon5HOTEyyO6LY6MsbJwE63c/HKGCeBd8p4U0qY96pkaURnjt6TK4oHuf4tUuUOwo9VA0dqKWf4KVBVpC9pkBYwS0aDkuWE9e7QSVU+FCsV/gwRGpU3ldcI65GHCr1Cjd2zLiYe5W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AmlGY0OJ93E0kPzwmJdK/YzLdbodOU74Z9EJZRD5bm6JrINvaDxgHQ3M6TtIClfepBLA6Hv52fdSIPs0JNTrYTqlWxqvZp4+sGJ5eA433IZ3fh7mt/v7PNAq49egLzQ6nY0gzTmzv0I9S7DxSREHQA/eDnW1/h2XCwoFgO0kXpBQZOru0bHGzi5BEw1TdOBWMtAw0Xs8kw1nWAHeq62etqYW83Q5mia1r2KtLB0YdXC++i/hcZQlQ31/mDkbAXVgHXfYc0wCma9xFiBPd6cukp0GR8tn6ReTGuQ6DsBAW4dczL/8laRcEHaJtrkKFY6Ewqs= 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: Part of the conversions to replace pgtable pte constructor/destructors with ptdesc equivalents. Signed-off-by: Vishal Moola (Oracle) --- arch/sparc/mm/srmmu.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/arch/sparc/mm/srmmu.c b/arch/sparc/mm/srmmu.c index 13f027afc875..964938aa7b88 100644 --- a/arch/sparc/mm/srmmu.c +++ b/arch/sparc/mm/srmmu.c @@ -355,7 +355,8 @@ pgtable_t pte_alloc_one(struct mm_struct *mm) return NULL; page = pfn_to_page(__nocache_pa((unsigned long)ptep) >> PAGE_SHIFT); spin_lock(&mm->page_table_lock); - if (page_ref_inc_return(page) == 2 && !pgtable_pte_page_ctor(page)) { + if (page_ref_inc_return(page) == 2 && + !ptdesc_pte_ctor(page_ptdesc(page))) { page_ref_dec(page); ptep = NULL; } @@ -371,7 +372,7 @@ void pte_free(struct mm_struct *mm, pgtable_t ptep) page = pfn_to_page(__nocache_pa((unsigned long)ptep) >> PAGE_SHIFT); spin_lock(&mm->page_table_lock); if (page_ref_dec_return(page) == 1) - pgtable_pte_page_dtor(page); + ptdesc_pte_dtor(page_ptdesc(page)); spin_unlock(&mm->page_table_lock); srmmu_free_nocache(ptep, SRMMU_PTE_TABLE_SIZE);