[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <83df51a5-5eb9-4470-92a1-e69fd12b98b4@arm.com>
Date: Tue, 7 Jan 2025 10:23:52 +0100
From: Kevin Brodsky <kevin.brodsky@....com>
To: Qi Zheng <zhengqi.arch@...edance.com>,
Alexander Gordeev <agordeev@...ux.ibm.com>
Cc: peterz@...radead.org, palmer@...belt.com, tglx@...utronix.de,
david@...hat.com, jannh@...gle.com, hughd@...gle.com, yuzhao@...gle.com,
willy@...radead.org, muchun.song@...ux.dev, vbabka@...nel.org,
lorenzo.stoakes@...cle.com, akpm@...ux-foundation.org, rientjes@...gle.com,
vishal.moola@...il.com, arnd@...db.de, will@...nel.org,
aneesh.kumar@...nel.org, npiggin@...il.com, dave.hansen@...ux.intel.com,
rppt@...nel.org, ryan.roberts@....com, linux-mm@...ck.org,
linux-arm-kernel@...ts.infradead.org, linuxppc-dev@...ts.ozlabs.org,
linux-riscv@...ts.infradead.org, linux-s390@...r.kernel.org,
sparclinux@...r.kernel.org, linux-kernel@...r.kernel.org, x86@...nel.org,
linux-arch@...r.kernel.org, linux-csky@...r.kernel.org,
linux-hexagon@...r.kernel.org, loongarch@...ts.linux.dev,
linux-m68k@...ts.linux-m68k.org, linux-mips@...r.kernel.org,
linux-openrisc@...r.kernel.org, linux-sh@...r.kernel.org,
linux-um@...ts.infradead.org
Subject: Re: [PATCH v4 07/15] mm: pgtable: introduce pagetable_dtor()
On 06/01/2025 14:23, Qi Zheng wrote:
> On 2025/1/6 20:36, Alexander Gordeev wrote:
>> On Mon, Jan 06, 2025 at 06:55:58PM +0800, Qi Zheng wrote:
>>>>> +static inline void pagetable_dtor(struct ptdesc *ptdesc)
>>>>> +{
>>>>> + struct folio *folio = ptdesc_folio(ptdesc);
>>>>> +
>>>>> + ptlock_free(ptdesc);
>>>>> + __folio_clear_pgtable(folio);
>>>>> + lruvec_stat_sub_folio(folio, NR_PAGETABLE);
>>>>> +}
>>>>> +
>>>>
>>>> If I am not mistaken, it is just pagetable_pte_dtor() rename.
>>>> What is the point in moving the code around?
>>>
>>> No, this is to unify pagetable_p*_dtor() into pagetable_dtor(), so
>>> that we can move pagetable_dtor() to __tlb_remove_table(), and then
>>> ptlock and PTE page can be freed together through RCU, which is
>>> also the main purpose of this patch series.
>>
>> I am only talking about this patch. pagetable_dtor() code above is
>> the same pagetable_pte_dtor() below - it is only the function name
>> that changed. So why to move the function body? Anyway, that is
>
> Ah, I just don't want to put pagetable_dtor() in between
> pagetable_pte_ctor() and ___pte_offset_map(), so I moved it above
> pagetable_pte_ctor(). No other special reason. 😉
I think inserting pagetable_dtor() there makes sense. I wouldn't say
that pagetable_pte_dtor() is being renamed to pagetable_dtor(), because
in fact this patch replaces all of pagetable_{pte,pmd,pud}_dtor() with
pagetable_dtor(), and it is arguably clearer to insert the latter higher
up in mm.h.
FWIW my follow-up series introduces a common __pagetable_dtor(),
inserted below pagetable_ctor() [1].
- Kevin
[1]
https://lore.kernel.org/linux-mm/20250103184415.2744423-2-kevin.brodsky@arm.com/
Powered by blists - more mailing lists