On Fri, Sep 08, 2023 at 01:52:15PM -0600, Jane Chu wrote:

You need to put a From: line at the top of this so that if someone
applies this it shows me as author rather than you.

> The one caller of DAX lock/unlock page already calls compound_head(),
> so use page_folio() instead, then use a folio throughout the DAX code
> to remove uses of page->mapping and page->index.
> 
> Signed-off-by: Matthew Wilcox (Oracle) <[email protected]>
> Signed-off-by: Jane Chu <[email protected]>
> ---

You should say what changed from v1 here.  Also Naoya Horiguchi offered
an Acked-by tag that would be appropriate to include.

>  fs/dax.c            | 24 ++++++++++++------------
>  include/linux/dax.h | 10 +++++-----
>  mm/memory-failure.c | 29 ++++++++++++++++-------------
>  3 files changed, 33 insertions(+), 30 deletions(-)

> +++ b/mm/memory-failure.c
> @@ -1710,20 +1710,23 @@ static void unmap_and_kill(struct list_head *to_kill, 
> unsigned long pfn,
>       kill_procs(to_kill, flags & MF_MUST_KILL, false, pfn, flags);
>  }
>  
> +/*
> + * Only dev_pagemap pages get here, such as fsdax when the filesystem
> + * either do not claim or fails to claim a hwpoison event, or devdax.
> + * The fsdax pages are initialized per base page, and the devdax pages
> + * could be initialized either as base pages, or as compound pages with
> + * vmemmap optimization enabled. Devdax is simplistic in its dealing with
> + * hwpoison, such that, if a subpage of a compound page is poisoned,
> + * simply mark the compound head page is by far sufficient.
> + */
>  static int mf_generic_kill_procs(unsigned long long pfn, int flags,
>               struct dev_pagemap *pgmap)
>  {
> -     struct page *page = pfn_to_page(pfn);
> +     struct folio *folio = page_folio(pfn_to_page(pfn));

We have a pfn_folio() (which does the same thing, but may not always)


Reply via email to