[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <5a125dc8-4443-4da4-b40f-15c8c80449cb@bytedance.com>
Date: Fri, 20 Dec 2024 19:28:20 +0800
From: Qi Zheng <zhengqi.arch@...edance.com>
To: Alexander Gordeev <agordeev@...ux.ibm.com>
Cc: peterz@...radead.org, 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,
linux-mm@...ck.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2 11/15] mm: pgtable: introduce generic
__tlb_remove_table()
On 2024/12/20 19:18, Alexander Gordeev wrote:
> On Wed, Dec 18, 2024 at 09:04:47PM +0800, Qi Zheng wrote:
>> Several architectures (arm, arm64, riscv, s390 and x86) define exactly the
>> same __tlb_remove_table(), just introduce generic __tlb_remove_table() to
>> eliminate these duplications.
>
> s390 is nearly the same, but not exactly (see below).
>
>> arch/s390/include/asm/tlb.h | 1 -
>> arch/s390/mm/pgalloc.c | 7 -------
> ...
>> --- a/arch/s390/mm/pgalloc.c
>> +++ b/arch/s390/mm/pgalloc.c
>> @@ -193,13 +193,6 @@ void page_table_free(struct mm_struct *mm, unsigned long *table)
>> pagetable_dtor_free(ptdesc);
>> }
>>
>> -void __tlb_remove_table(void *table)
>> -{
>> - struct ptdesc *ptdesc = virt_to_ptdesc(table);
>> -
>> - pagetable_dtor_free(ptdesc);
>
> With this change you introduce these duplication in __tlb_remove_table()
> and in pagetable_dtor_free():
>
> pagetable_dtor(ptdesc);
> pagetable_free(ptdesc);
>
> But I still would prefer to avoid __HAVE_ARCH_TLB_REMOVE_TABLE.
> Could it be possible to move pagetable_dtor_free() to asm-generic and
> make s390 __tlb_remove_table() version generic?
Yes, see my reply to Peter below:
https://lore.kernel.org/lkml/3f9a5475-930d-4f45-8fc8-8d2e8a6a08cc@bytedance.com/
I will do it in v3. And I have make pagetable_dtor_free() generic in
[PATCH v2 15/15].
>
>> -}
>> -
>> #ifdef CONFIG_TRANSPARENT_HUGEPAGE
>> static void pte_free_now(struct rcu_head *head)
>> {
>
> Thanks!
Powered by blists - more mailing lists