Re: [PATCH v2 06/10] module: introduce MODULE_STATE_GONE

2025-01-23 Thread Petr Pavlu
On 1/21/25 10:57, Mike Rapoport wrote: > In order to use execmem's API for temporal remapping of the memory > allocated from ROX cache as writable, there is a need to distinguish > between the state when the module is being formed and the state when it is > deconstructed and freed so that when modu

[PATCH 5/5] mm: pgtable: remove tlb_remove_page_ptdesc()

2025-01-23 Thread Qi Zheng
The tlb_remove_ptdesc()/tlb_remove_table() is specially designed for page table pages, and now all architectures have been converted to use it to remove page table pages. So let's remove tlb_remove_page_ptdesc(), it currently has no users and should not be used for page table pages. Signed-off-by:

[PATCH 4/5] x86: pgtable: unconditionally use tlb_remove_table()

2025-01-23 Thread Qi Zheng
If the CONFIG_MMU_GATHER_TABLE_FREE is disabled, the tlb_remove_table() will fall back to pagetable_dtor() + tlb_remove_page(). So let's use tlb_remove_table() unconditionally to free page table pages. Signed-off-by: Qi Zheng Suggested-by: Peter Zijlstra (Intel) --- arch/x86/kernel/paravirt.c |

[PATCH 0/5] remove tlb_remove_page_ptdesc()

2025-01-23 Thread Qi Zheng
Hi all, As suggested by Peter Zijlstra below [1], this series aims to remove tlb_remove_page_ptdesc(). : Fundamentally tlb_remove_page() is about removing *pages* as from a PTE, : there should not be a page-table anywhere near here *ever*. : : Yes, some architectures use tlb_remove_page() for pag

[PATCH 1/5] mm: pgtable: make generic tlb_remove_table() use struct ptdesc

2025-01-23 Thread Qi Zheng
Now only arm will call tlb_remove_ptdesc()/tlb_remove_table() when CONFIG_MMU_GATHER_TABLE_FREE is disabled. In this case, the type of the table parameter is actually struct ptdesc * instead of struct page *. Since struct ptdesc still overlaps with struct page and has not been separated from it, f

[PATCH 3/5] riscv: pgtable: unconditionally use tlb_remove_ptdesc()

2025-01-23 Thread Qi Zheng
To support fast gup, the commit 69be3fb111e7 ("riscv: enable MMU_GATHER_RCU_TABLE_FREE for SMP && MMU") did the following: 1) use tlb_remove_page_ptdesc() for those platforms which use IPI to perform TLB shootdown 2) use tlb_remove_ptdesc() for those platforms which use SBI to perform TLB s

[PATCH 2/5] mm: pgtable: convert some architectures to use tlb_remove_ptdesc()

2025-01-23 Thread Qi Zheng
Now, the nine architectures of csky, hexagon, loongarch, m68k, mips, nios2, openrisc, sh and um do not select CONFIG_MMU_GATHER_RCU_TABLE_FREE, and just call pagetable_dtor() + tlb_remove_page_ptdesc() (the wrapper of tlb_remove_page()). This is the same as the implementation of tlb_remove_{ptdesc|