From patchwork Tue Jul 30 06:46:57 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: alexs@kernel.org X-Patchwork-Id: 13746741 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 83C02C3DA49 for ; Tue, 30 Jul 2024 06:43:33 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 1B22C6B0093; Tue, 30 Jul 2024 02:43:33 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 13A2B6B0095; Tue, 30 Jul 2024 02:43:33 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id EF7556B0096; Tue, 30 Jul 2024 02:43:32 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id CE1BA6B0093 for ; Tue, 30 Jul 2024 02:43:32 -0400 (EDT) Received: from smtpin01.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 83D4F120125 for ; Tue, 30 Jul 2024 06:43:32 +0000 (UTC) X-FDA: 82395477864.01.D15F151 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf03.hostedemail.com (Postfix) with ESMTP id D380920021 for ; Tue, 30 Jul 2024 06:43:29 +0000 (UTC) Authentication-Results: imf03.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=WjS+HiBA; spf=pass (imf03.hostedemail.com: domain of alexs@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=alexs@kernel.org; dmarc=pass (policy=none) header.from=kernel.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1722321783; 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=mcJIEW3+JglGIqSEGKV2uIMS0ceUzDFCDtwPQdNeWvA=; b=c0rJVcyuSsFS6cKYzaPbMLTpPvu352DYXvDAMVbY2JZoXolvKjrrd99XaoJEnSYS1KNhUf HEs6rHXmxs/eujfRYD0vG9+zgKuv5MAIyzNvdb5Ft2GdquHD0Ifg7I4QYLsRebYzmiL7dV ZyKBbuVjJ8XbE51jPWXznsUyu4qNkWM= ARC-Authentication-Results: i=1; imf03.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=WjS+HiBA; spf=pass (imf03.hostedemail.com: domain of alexs@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=alexs@kernel.org; dmarc=pass (policy=none) header.from=kernel.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1722321783; a=rsa-sha256; cv=none; b=INP//g7kLdTsTiO3rUYhbtz3Q8i8ByiONVa1KZw5go9C0h7t3UklBjh4kCmTCXVo+Y5aX0 zwxsOKBgf81IZXpczi9X3af5TTzPEzZg34TMAMAjQC3n4UDaB7CBSe1yFsglkfk+fi0Jv9 0V1ItknDeCeExL9AxTPn1Uxm0/eYxNk= Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 88F4661D65; Tue, 30 Jul 2024 06:43:28 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 50D8BC4AF10; Tue, 30 Jul 2024 06:43:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1722321808; bh=zlev6U+OoFjkfoKmEXM32LjGGbg3IzN8MVfe5YQ2ABk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=WjS+HiBAB8GnrP16+FWhPBhBioxJ8kmlN6GNWX0t7MoSEgpFt9udUClAwzyOYEIxt GLWwkGU4O6zyc/VGIYKFle6KtAV0AVQ6WLPz1ptPTAt/cK1x1zSGjLfSPVGHaFL7Aw Y4AKOOT2SpoOjc/Wbh1+/cP2W5ZkFPUFKciWkTsqP4dtf5muBEfTCKVF7OjlDaXXFP Mk1LMgQy97vcUdIahsxWds+dQ+j5TRS6Lhw6QAeYu9XrrqZGdvSMQyXycNkwaPempx E3DYobdwtOelveqsy4Y98Iq66A3nNqzOwW6shcZICnV51PmNjmCB9mjEsRRSoolbPG qB3gp0EMlnwSw== From: alexs@kernel.org To: Will Deacon , "Aneesh Kumar K . V" , Nick Piggin , Peter Zijlstra , Russell King , Catalin Marinas , Brian Cain , WANG Xuerui , Geert Uytterhoeven , Jonas Bonn , Stefan Kristiansson , Stafford Horne , Michael Ellerman , Naveen N Rao , Paul Walmsley , Albert Ou , Thomas Gleixner , Borislav Petkov , Dave Hansen , x86@kernel.org, "H . Peter Anvin" , Andy Lutomirski , Bibo Mao , Baolin Wang , linux-arch@vger.kernel.org, linux-mm@kvack.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-csky@vger.kernel.org, linux-hexagon@vger.kernel.org, loongarch@lists.linux.dev, linux-m68k@lists.linux-m68k.org, linux-openrisc@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-riscv@lists.infradead.org, Heiko Carstens , Vasily Gorbik , Christian Borntraeger , Sven Schnelle , Qi Zheng , Vishal Moola , "Aneesh Kumar K . V" , Kemeng Shi , Lance Yang , Peter Xu , Barry Song , linux-s390@vger.kernel.org Cc: Guo Ren , Christophe Leroy , Palmer Dabbelt , Mike Rapoport , Oscar Salvador , Alexandre Ghiti , Jisheng Zhang , Samuel Holland , Anup Patel , Josh Poimboeuf , Breno Leitao , Alexander Gordeev , Gerald Schaefer , Hugh Dickins , David Hildenbrand , Ryan Roberts , Matthew Wilcox , Alex Shi , nvdimm@lists.linux.dev, linux-fsdevel@vger.kernel.org, Christian Brauner , Alexander Viro , Jan Kara , Dan Williams Subject: [RFC PATCH 03/18] fs/dax: use ptdesc in dax_pmd_load_hole Date: Tue, 30 Jul 2024 14:46:57 +0800 Message-ID: <20240730064712.3714387-4-alexs@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240730064712.3714387-1-alexs@kernel.org> References: <20240730064712.3714387-1-alexs@kernel.org> MIME-Version: 1.0 X-Rspamd-Server: rspam03 X-Rspam-User: X-Rspamd-Queue-Id: D380920021 X-Stat-Signature: jnidimas9mz6trjw7zqsobf6wxxwhy4u X-HE-Tag: 1722321809-547774 X-HE-Meta: U2FsdGVkX18ZO4BSJ6tMFRxpMzJJgYc/yjv83XlINKEnsligavZybgYtvxVWGHT/5YO2xuBtYv4eDKIEufFKkS7Kjc0oIa5M83OF21hVld7L8a9rxDBb28sWu3U0F7LSurm0HDfayIc/z4Jn5TuKd8hZVjCQwzSbCk0RxSiSyIyzMVRkHfLRCXdeWxhLQ65p9C9+IxIjXkNxePhzbyMxPKrwHKbcDDNcX/7ch4lqTFeaVQGI4uNIlx6ZbQEoeiza7o/PJPiQKhTAHWJcbWA8camGlvpSWe4nY1aYCziTJGel+02h2Mrg9uIRCra3jQbs9wJDQ6deAlln6DyfdsDp7GnueF2VA1wOApBB1TqdSkJO3oPW+84V8btTX2jqgwoQYMbjCVDOLZ73xAvyZcwphjEjnLgKgO/VJo12/Sw1bYWNM4LS2XbWIGsD/Nx40htU9tQsyMBZPxjkt8SKwwzIq94V1TiGESplvuDZ8J6KBCM7AimPv6DHwOvivNziQmuaVU6TYSm+wWFSxsaDPRf6PzEklIEWN64G8OGEXUwmnPdBZ9xtreBcwwthqXJZ5hFLfJLYpkp6RW6S0B40mx/zrFLOX8kPVallKw6U6y/s28uuYMWsqy2O/1CcJlZa6ldoOuwBekUtEVHLG3XGdmlOSpyZrmy4sCIgEpuhe9yLCnzmfG82SBHvsKXH94mnuZewzMvgI51hRarjAtoAHDWzPcmzBCH9q4LJHkxsxURqEjri92z8deRWzE30Wd+1KKN1Z8bIKoZG0+vZS5GT0YRyZyZB4dST18/uF62Y/2q3LX4jgm+19YJbgu/4e1Tz4kEgAKUC3fHa14ioBOEv9KGqOPN4hWoyabYkZwFP87DwhRZhL9ma+lJ9+ic6tPyjnz7+VYDI2KJfRx5r5qfNS/n3dVur8sIJ7ZIGwofcsBRY0JMrSm6dWICxZ37G//gHuwl/Nr1fAnhLQNouEeDDUrV VSyADMqo WcpggrgjZeA/mX7dhGJlwaJbGAl/afCQIUJTvCQDmuZWEvIj2TC+8caMNrp2lIi3zSsihBY55jUL7t8NP7eQY9Gywh97k64AQ5uxf+eool24KXjFSPi42lJKTfVJh/pYCwBBDGHprXM13dl6wWHuzzxpfCoNG8/jpxaYY8PQ20T87Tb0qhD4DDVqqQfCVFElhkOMSlmrWuEoIDpf3O4nxyxA9mDAYv4BYjiifYqvT3hOQoVCx7WV67YhkXYHo6muM75bbY1J32atHFxH28oHEE9uEUnyljuVIAOZS8e5zc00mi8pCVMAC+rKhOriEXlXZ63sbVuPiXaQ0TykUOOLvwAIjs4Z3VG/GHT8GWH8j0aknbkDiV/pqkBK4yayvsHkD4TbzRod/v7dwwKH5MEBcuyuXAi7qG20bHP+0JdAPWe3Jci1uDLXotnyFjt5V5oZodDHNhMVj9sQARBDurjqmO5TG2+U297Lw/Fgyn9JhRlTy+MhyoQt/I8kJZA== 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: From: Alex Shi Since we have ptdesc struct now, better to use replace pgtable_t, aka 'struct page *'. It's a prepare for return ptdesc pointer in pte_alloc_one series function. Signed-off-by: Alex Shi Cc: linux-kernel@vger.kernel.org Cc: nvdimm@lists.linux.dev Cc: linux-fsdevel@vger.kernel.org Cc: Christian Brauner Cc: Alexander Viro Cc: Jan Kara Cc: Matthew Wilcox Cc: Dan Williams --- fs/dax.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/fs/dax.c b/fs/dax.c index becb4a6920c6..6f7cea248206 100644 --- a/fs/dax.c +++ b/fs/dax.c @@ -1206,7 +1206,7 @@ static vm_fault_t dax_pmd_load_hole(struct xa_state *xas, struct vm_fault *vmf, unsigned long pmd_addr = vmf->address & PMD_MASK; struct vm_area_struct *vma = vmf->vma; struct inode *inode = mapping->host; - pgtable_t pgtable = NULL; + struct ptdesc *ptdesc = NULL; struct folio *zero_folio; spinlock_t *ptl; pmd_t pmd_entry; @@ -1222,8 +1222,8 @@ static vm_fault_t dax_pmd_load_hole(struct xa_state *xas, struct vm_fault *vmf, DAX_PMD | DAX_ZERO_PAGE); if (arch_needs_pgtable_deposit()) { - pgtable = pte_alloc_one(vma->vm_mm); - if (!pgtable) + ptdesc = page_ptdesc(pte_alloc_one(vma->vm_mm)); + if (!ptdesc) return VM_FAULT_OOM; } @@ -1233,8 +1233,8 @@ static vm_fault_t dax_pmd_load_hole(struct xa_state *xas, struct vm_fault *vmf, goto fallback; } - if (pgtable) { - pgtable_trans_huge_deposit(vma->vm_mm, vmf->pmd, pgtable); + if (ptdesc) { + pgtable_trans_huge_deposit(vma->vm_mm, vmf->pmd, ptdesc_page(ptdesc)); mm_inc_nr_ptes(vma->vm_mm); } pmd_entry = mk_pmd(&zero_folio->page, vmf->vma->vm_page_prot); @@ -1245,8 +1245,8 @@ static vm_fault_t dax_pmd_load_hole(struct xa_state *xas, struct vm_fault *vmf, return VM_FAULT_NOPAGE; fallback: - if (pgtable) - pte_free(vma->vm_mm, pgtable); + if (ptdesc) + pte_free(vma->vm_mm, ptdesc_page(ptdesc)); trace_dax_pmd_load_hole_fallback(inode, vmf, zero_folio, *entry); return VM_FAULT_FALLBACK; }