Re: [PATCH v9 19/20] fs/dax: Properly refcount fs dax pages

2025-03-26 Thread Dan Williams
David Hildenbrand wrote: > > > -static inline unsigned long dax_folio_share_put(struct folio *folio) > > +static inline unsigned long dax_folio_put(struct folio *folio) > > { > > - return --folio->page.share; > > + unsigned long ref; > > + int order, i; > > + > > + if (!dax_folio_is_shar

Re: [PATCH v9 19/20] fs/dax: Properly refcount fs dax pages

2025-03-03 Thread David Hildenbrand
-static inline unsigned long dax_folio_share_put(struct folio *folio) +static inline unsigned long dax_folio_put(struct folio *folio) { - return --folio->page.share; + unsigned long ref; + int order, i; + + if (!dax_folio_is_shared(folio)) + ref = 0; +

[PATCH v9 19/20] fs/dax: Properly refcount fs dax pages

2025-02-27 Thread Alistair Popple
Currently fs dax pages are considered free when the refcount drops to one and their refcounts are not increased when mapped via PTEs or decreased when unmapped. This requires special logic in mm paths to detect that these pages should not be properly refcounted, and to detect when the refcount drop