From patchwork Thu Dec 19 16:44:19 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kevin Brodsky X-Patchwork-Id: 13915291 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 282DDE77184 for ; Thu, 19 Dec 2024 16:46:31 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id B40836B0095; Thu, 19 Dec 2024 11:46:30 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id AC8C46B0096; Thu, 19 Dec 2024 11:46:30 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 942886B0098; Thu, 19 Dec 2024 11:46:30 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id 74DB66B0095 for ; Thu, 19 Dec 2024 11:46:30 -0500 (EST) Received: from smtpin13.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id 33764A1802 for ; Thu, 19 Dec 2024 16:46:30 +0000 (UTC) X-FDA: 82912285638.13.2150C42 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by imf23.hostedemail.com (Postfix) with ESMTP id 77583140006 for ; Thu, 19 Dec 2024 16:46:06 +0000 (UTC) Authentication-Results: imf23.hostedemail.com; dkim=none; dmarc=pass (policy=none) header.from=arm.com; spf=pass (imf23.hostedemail.com: domain of kevin.brodsky@arm.com designates 217.140.110.172 as permitted sender) smtp.mailfrom=kevin.brodsky@arm.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1734626773; 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; bh=3WEDzI0flGVpS0CVH2Q86E+EzbPPJ+nig/lm6WiqDI4=; b=ejbvsrOpufykBdhdg+8NW/TTxmGGH5mnuv21eX8DddvqrLR3Lqaz3E2fAIdFQMuyRNTZUz njXHIlZ8VQoXQ+ITbnyyAidlrA0qhVeLAjsDvh4uo8IhoMCgdl+DGeb3XIuUO+S0z1jZTv Nti5ztMi+jX9XVipMZAOakgmVW/TrQE= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1734626773; a=rsa-sha256; cv=none; b=pY1n1HkX05fvXphin1nlfWA1xv+h2/3RxkDT95ojmpgjaAMtRLiy0PWwC7VWJAh73/SMVJ FLrc936SbghrrVo4JxgbrTTIgesLdO7sXIAr9jjzBcxGa97KNa3uMKFMxH69l53D31XDt5 lxhasze1zVJsWcaz+UtDB3MqYrGUADE= ARC-Authentication-Results: i=1; imf23.hostedemail.com; dkim=none; dmarc=pass (policy=none) header.from=arm.com; spf=pass (imf23.hostedemail.com: domain of kevin.brodsky@arm.com designates 217.140.110.172 as permitted sender) smtp.mailfrom=kevin.brodsky@arm.com Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id EE9F01480; Thu, 19 Dec 2024 08:46:55 -0800 (PST) Received: from e123572-lin.arm.com (e123572-lin.cambridge.arm.com [10.1.194.54]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id F018D3F58B; Thu, 19 Dec 2024 08:46:23 -0800 (PST) From: Kevin Brodsky To: linux-mm@kvack.org Cc: Kevin Brodsky , Andrew Morton , Catalin Marinas , Dave Hansen , Linus Walleij , Andy Lutomirski , Peter Zijlstra , "Mike Rapoport (IBM)" , Ryan Roberts , Thomas Gleixner , Will Deacon , Matthew Wilcox , linux-alpha@vger.kernel.org, linux-arch@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-csky@vger.kernel.org, linux-hexagon@vger.kernel.org, linux-kernel@vger.kernel.org, linux-m68k@lists.linux-m68k.org, linux-mips@vger.kernel.org, linux-openrisc@vger.kernel.org, linux-parisc@vger.kernel.org, linux-riscv@lists.infradead.org, linux-s390@vger.kernel.org, linux-snps-arc@lists.infradead.org, linux-um@lists.infradead.org, loongarch@lists.linux.dev, x86@kernel.org Subject: [PATCH 04/10] s390/mm: Add calls to pagetable_pud_[cd]tor Date: Thu, 19 Dec 2024 16:44:19 +0000 Message-ID: <20241219164425.2277022-5-kevin.brodsky@arm.com> X-Mailer: git-send-email 2.47.0 In-Reply-To: <20241219164425.2277022-1-kevin.brodsky@arm.com> References: <20241219164425.2277022-1-kevin.brodsky@arm.com> MIME-Version: 1.0 X-Stat-Signature: d1jcwyw6mhxfaumqi1pq8ysnif6qpbzj X-Rspamd-Queue-Id: 77583140006 X-Rspam-User: X-Rspamd-Server: rspam01 X-HE-Tag: 1734626766-393545 X-HE-Meta: U2FsdGVkX1/Kg5DG+nYyKhk0M7pawsr7Zi+T836lAa1NsHQABRUm3q6pPPsFPWUzQcAH0VkDknaFFXfdVOD8TEsg87RDzOU1P2DHviWdknfWRHWwYak/BKjiiahuSXw8iGZy1WOxaEME51BjRLwSM3A3qyXtwU0x34ZQkBBK4gHL2C0Os1T8FAu2nJOBcW3EF8VQBnqyfJlDTkP0X81WmBeEyGPBT8qSli/jEi13fe3J4+w3vtLD+I6H1igcSnxPlRqR+/NPTKsMyPLJA5bJliVE65jWKy42Eun64XaHSHoEMkFUy+xnulQEBE7Z9VrD5scwnEDldxH10T1VPKPD+dGzmabJNNsUa/6JQYGkCPImRO+6e1vtog+U4ZQVfceQtK//hry7Hapa6XwyVd8F8KMawf1Ktooa1Paj8NGkwtxdAhktQcRuH1p9hrTIXlI22xHQupPboJS068aW8CM8kRKiZXzmPvKkwA15Y3HMlbrdFysqWFhtgwaPlOlH9q7MCNMt+a3K3n6fiVzJWPIqrQqHADoW1RweWBpMXBtYF32PaF6Zh4ldWe61jv75PkjsMUlJcEWBdVOMjmRHekvfxSh1jTkAuLPH+bg9D2LK4nHvlH+4wt+V+lfAIlzAwplf2dyxXYV/aAuuVt+rDTpIh0TLohlfx671qTge+zY1eyuYVQbB4gBIMjbXRajN0aia9F5u/pgefF2LVix8ONA3KQrqIckzA1DDAFmQG4Vg9AYB61TipPjTgTJmej2um8EbbgRCq9dfd64jCoHdYA5/LwYb6aKkappggZb5DhOVyAwF0/IGgHrF2Eiagz4dILh4YFzouSZmVaLm/VOC5UFlI+KlhpdeNNld2W61BISkHVYEaZtpTvlGN6WgoeQ1nqQhamc8DE+ynDEazxP72YrXjLUaKKCGNteR0mRCSP7sqZ+rccQjJVMKmgbNG1eFYrH6a/UAQhH959u02D+eQtU j/gEEsxM So9P9m8CslbVY4fMzUEaHqy+76TF9gCGqxLA9AEmRTpDmlUHZivJO9G+86hx5/whY5FLrCWbndf38DFQVlwFSUCzeGY5XoQ3sREJgwxL+TQ42QpcP3CdA7MK5+2pfKcupTrt7+OaZF0YoIzAKL+KHvJHo1Sy/ApgxvJP53NIQoadO0KvnvK4uTh0Ads70xk0Tkf5Lae5YnYL2DJcRzapEOSdsqkn/sDxVjiZ6Y4fifAQCRc76+P3BM/Qn9L9Nlcsj1rPZNnCw0CArRF61kUL/6krx5rFHvTjOiFVTgUqQmPNhvPGotzs+6BRlLbifvKpat8i0 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: List-Subscribe: List-Unsubscribe: Commit 55d2a0bd5ead ("mm: add statistics for PUD level pagetable") introduced PUD-level ctor/dtor helpers to improve the accounting of page table pages. s390 doesn't use the generic pgalloc implementation and it seems that it got missed in the process. Add the missing calls to the ctor/dtor helpers in pud_alloc_one/pud_free to match the other architectures. Signed-off-by: Kevin Brodsky --- arch/s390/include/asm/pgalloc.h | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/arch/s390/include/asm/pgalloc.h b/arch/s390/include/asm/pgalloc.h index 7b84ef6dc4b6..97db66ae06b9 100644 --- a/arch/s390/include/asm/pgalloc.h +++ b/arch/s390/include/asm/pgalloc.h @@ -67,15 +67,20 @@ static inline void p4d_free(struct mm_struct *mm, p4d_t *p4d) static inline pud_t *pud_alloc_one(struct mm_struct *mm, unsigned long address) { unsigned long *table = crst_table_alloc(mm); - if (table) - crst_table_init(table, _REGION3_ENTRY_EMPTY); + + if (!table) + return NULL; + crst_table_init(table, _REGION3_ENTRY_EMPTY); + pagetable_pud_ctor(virt_to_ptdesc(table)); return (pud_t *) table; } static inline void pud_free(struct mm_struct *mm, pud_t *pud) { - if (!mm_pud_folded(mm)) - crst_table_free(mm, (unsigned long *) pud); + if (mm_pud_folded(mm)) + return; + pagetable_pud_dtor(virt_to_ptdesc(pud)); + crst_table_free(mm, (unsigned long *) pud); } static inline pmd_t *pmd_alloc_one(struct mm_struct *mm, unsigned long vmaddr)