Re: [PATCH 10/12] fs/dax: Properly refcount fs dax pages

2024-10-29 Thread Alistair Popple
Dan Williams writes: > Alistair Popple wrote: > [..] > >> >> > It follows that that the DMA-idle condition still needs to look for the >> >> > case where the refcount is > 1 rather than 0 since refcount == 1 is the >> >> > page-mapped-but-DMA-idle condition. >> >> Because if the DAX page-cache

Re: [PATCH 10/12] fs/dax: Properly refcount fs dax pages

2024-10-28 Thread Dan Williams
Alistair Popple wrote: [..] > >> > It follows that that the DMA-idle condition still needs to look for the > >> > case where the refcount is > 1 rather than 0 since refcount == 1 is the > >> > page-mapped-but-DMA-idle condition. > > Because if the DAX page-cache holds a reference the refcount won

Re: [PATCH 10/12] fs/dax: Properly refcount fs dax pages

2024-10-27 Thread Alistair Popple
Dan Williams writes: > Alistair Popple wrote: > [..] >>> I'm not really following this scenario, or at least how it relates to >> >> the comment above. If the page is pinned for DMA it will have taken a >> >> refcount on it and so the page won't be considered free/idle per >> >> dax_wait_page_i

Re: [PATCH 10/12] fs/dax: Properly refcount fs dax pages

2024-10-25 Thread Dan Williams
Alistair Popple wrote: [..] > > > > Was there a discussion I missed about why the conversion to typical > > folios allows the page->share accounting to be dropped. > > The problem with keeping it is we now treat DAX pages as "normal" > pages according to vm_normal_page(). As such we use the normal

Re: [PATCH 10/12] fs/dax: Properly refcount fs dax pages

2024-10-24 Thread Dan Williams
Alistair Popple wrote: [..] >> I'm not really following this scenario, or at least how it relates to > >> the comment above. If the page is pinned for DMA it will have taken a > >> refcount on it and so the page won't be considered free/idle per > >> dax_wait_page_idle() or any of the other mm code

Re: [PATCH 10/12] fs/dax: Properly refcount fs dax pages

2024-10-24 Thread Alistair Popple
Dan Williams writes: > Alistair Popple wrote: > [..] >> > >> > Was there a discussion I missed about why the conversion to typical >> > folios allows the page->share accounting to be dropped. >> >> The problem with keeping it is we now treat DAX pages as "normal" >> pages according to vm_norma

Re: [PATCH 10/12] fs/dax: Properly refcount fs dax pages

2024-10-24 Thread Alistair Popple
Dan Williams writes: > Alistair Popple wrote: [...] >> @@ -318,85 +323,58 @@ static unsigned long dax_end_pfn(void *entry) >> */ >> #define for_each_mapped_pfn(entry, pfn) \ >> for (pfn = dax_to_pfn(entry); \ >> -pfn < dax_end_pfn(entry); pfn++) >> +pfn

Re: [PATCH 10/12] fs/dax: Properly refcount fs dax pages

2024-09-27 Thread Dan Williams
Alistair Popple wrote: > 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 t

[PATCH 10/12] fs/dax: Properly refcount fs dax pages

2024-09-09 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