[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240730064712.3714387-9-alexs@kernel.org>
Date: Tue, 30 Jul 2024 14:47:02 +0800
From: alexs@...nel.org
To: Will Deacon <will@...nel.org>,
"Aneesh Kumar K . V" <aneesh.kumar@...nel.org>,
Nick Piggin <npiggin@...il.com>,
Peter Zijlstra <peterz@...radead.org>,
Russell King <linux@...linux.org.uk>,
Catalin Marinas <catalin.marinas@....com>,
Brian Cain <bcain@...cinc.com>,
WANG Xuerui <kernel@...0n.name>,
Geert Uytterhoeven <geert@...ux-m68k.org>,
Jonas Bonn <jonas@...thpole.se>,
Stefan Kristiansson <stefan.kristiansson@...nalahti.fi>,
Stafford Horne <shorne@...il.com>,
Michael Ellerman <mpe@...erman.id.au>,
Naveen N Rao <naveen@...nel.org>,
Paul Walmsley <paul.walmsley@...ive.com>,
Albert Ou <aou@...s.berkeley.edu>,
Thomas Gleixner <tglx@...utronix.de>,
Borislav Petkov <bp@...en8.de>,
Dave Hansen <dave.hansen@...ux.intel.com>,
x86@...nel.org,
"H . Peter Anvin" <hpa@...or.com>,
Andy Lutomirski <luto@...nel.org>,
Bibo Mao <maobibo@...ngson.cn>,
Baolin Wang <baolin.wang@...ux.alibaba.com>,
linux-arch@...r.kernel.org,
linux-mm@...ck.org,
linux-arm-kernel@...ts.infradead.org,
linux-kernel@...r.kernel.org,
linux-csky@...r.kernel.org,
linux-hexagon@...r.kernel.org,
loongarch@...ts.linux.dev,
linux-m68k@...ts.linux-m68k.org,
linux-openrisc@...r.kernel.org,
linuxppc-dev@...ts.ozlabs.org,
linux-riscv@...ts.infradead.org,
Heiko Carstens <hca@...ux.ibm.com>,
Vasily Gorbik <gor@...ux.ibm.com>,
Christian Borntraeger <borntraeger@...ux.ibm.com>,
Sven Schnelle <svens@...ux.ibm.com>,
Qi Zheng <zhengqi.arch@...edance.com>,
Vishal Moola <vishal.moola@...il.com>,
"Aneesh Kumar K . V" <aneesh.kumar@...ux.ibm.com>,
Kemeng Shi <shikemeng@...weicloud.com>,
Lance Yang <ioworker0@...il.com>,
Peter Xu <peterx@...hat.com>,
Barry Song <baohua@...nel.org>,
linux-s390@...r.kernel.org
Cc: Guo Ren <guoren@...nel.org>,
Christophe Leroy <christophe.leroy@...roup.eu>,
Palmer Dabbelt <palmer@...belt.com>,
Mike Rapoport <rppt@...nel.org>,
Oscar Salvador <osalvador@...e.de>,
Alexandre Ghiti <alexghiti@...osinc.com>,
Jisheng Zhang <jszhang@...nel.org>,
Samuel Holland <samuel.holland@...ive.com>,
Anup Patel <anup@...infault.org>,
Josh Poimboeuf <jpoimboe@...nel.org>,
Breno Leitao <leitao@...ian.org>,
Alexander Gordeev <agordeev@...ux.ibm.com>,
Gerald Schaefer <gerald.schaefer@...ux.ibm.com>,
Hugh Dickins <hughd@...gle.com>,
David Hildenbrand <david@...hat.com>,
Ryan Roberts <ryan.roberts@....com>,
Matthew Wilcox <willy@...radead.org>,
Alex Shi <alexs@...nel.org>,
Andrew Morton <akpm@...ux-foundation.org>
Subject: [RFC PATCH 08/18] mm/memory: use ptdesc in __pte_alloc
From: Alex Shi <alexs@...nel.org>
Replace pgtable_t by ptdesc in function __pte_alloc.
We will remove pgtable_t from all place.
Signed-off-by: Alex Shi <alexs@...nel.org>
Cc: linux-kernel@...r.kernel.org
Cc: linux-mm@...ck.org
Cc: Andrew Morton <akpm@...ux-foundation.org>
---
mm/memory.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/mm/memory.c b/mm/memory.c
index b9f5cc0db3eb..5b01d94a0b5f 100644
--- a/mm/memory.c
+++ b/mm/memory.c
@@ -445,13 +445,13 @@ void pmd_install(struct mm_struct *mm, pmd_t *pmd, pgtable_t *pte)
int __pte_alloc(struct mm_struct *mm, pmd_t *pmd)
{
- pgtable_t new = pte_alloc_one(mm);
- if (!new)
+ struct ptdesc *ptdesc = page_ptdesc(pte_alloc_one(mm));
+ if (!ptdesc)
return -ENOMEM;
- pmd_install(mm, pmd, &new);
- if (new)
- pte_free(mm, new);
+ pmd_install(mm, pmd, (pgtable_t *)&ptdesc);
+ if (ptdesc)
+ pte_free(mm, ptdesc_page(ptdesc));
return 0;
}
--
2.43.0
Powered by blists - more mailing lists