Re: [PATCH v4 07/15] mm: pgtable: introduce pagetable_dtor()

2025-01-07 Thread Kevin Brodsky
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_f

Re: [PATCH v4 07/15] mm: pgtable: introduce pagetable_dtor()

2025-01-06 Thread Qi Zheng
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); + l

Re: [PATCH v4 07/15] mm: pgtable: introduce pagetable_dtor()

2025-01-06 Thread Alexander Gordeev
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_P

Re: [PATCH v4 07/15] mm: pgtable: introduce pagetable_dtor()

2025-01-06 Thread Qi Zheng
On 2025/1/6 18:34, Alexander Gordeev wrote: On Mon, Dec 30, 2024 at 05:07:42PM +0800, Qi Zheng wrote: The pagetable_p*_dtor() are exactly the same except for the handling of ptlock. If we make ptlock_free() handle the case where ptdesc->ptl is NULL and remove VM_BUG_ON_PAGE() from pmd_ptlock_

Re: [PATCH v4 07/15] mm: pgtable: introduce pagetable_dtor()

2025-01-06 Thread Alexander Gordeev
On Mon, Dec 30, 2024 at 05:07:42PM +0800, Qi Zheng wrote: > The pagetable_p*_dtor() are exactly the same except for the handling of > ptlock. If we make ptlock_free() handle the case where ptdesc->ptl is > NULL and remove VM_BUG_ON_PAGE() from pmd_ptlock_free(), we can unify > pagetable_p*_dtor() i

[PATCH v4 07/15] mm: pgtable: introduce pagetable_dtor()

2024-12-30 Thread Qi Zheng
The pagetable_p*_dtor() are exactly the same except for the handling of ptlock. If we make ptlock_free() handle the case where ptdesc->ptl is NULL and remove VM_BUG_ON_PAGE() from pmd_ptlock_free(), we can unify pagetable_p*_dtor() into one function. Let's introduce pagetable_dtor() to do this. La