Message ID | 20210714193542.21857-2-joao.m.martins@oracle.com (mailing list archive) |
---|---|
State | New |
Headers | show |
Series | mm, sparse-vmemmap: Introduce compound pagemaps | expand |
On Wed, Jul 14, 2021 at 12:36 PM Joao Martins <joao.m.martins@oracle.com> wrote: > > memory_failure_dev_pagemap() at the moment assumes base pages (e.g. > dax_lock_page()). For pagemap with compound pages fetch the > compound_head in case a tail page memory failure is being handled. > > Currently this is a nop, but in the advent of compound pages in > dev_pagemap it allows memory_failure_dev_pagemap() to keep working. > > Reported-by: Jane Chu <jane.chu@oracle.com> > Signed-off-by: Joao Martins <joao.m.martins@oracle.com> > Reviewed-by: Naoya Horiguchi <naoya.horiguchi@nec.com> Reviewed-by: Dan Williams <dan.j.williams@intel.com>
On Thu, Jul 15, 2021 at 3:36 AM Joao Martins <joao.m.martins@oracle.com> wrote: > > memory_failure_dev_pagemap() at the moment assumes base pages (e.g. > dax_lock_page()). For pagemap with compound pages fetch the > compound_head in case a tail page memory failure is being handled. > > Currently this is a nop, but in the advent of compound pages in > dev_pagemap it allows memory_failure_dev_pagemap() to keep working. > > Reported-by: Jane Chu <jane.chu@oracle.com> > Signed-off-by: Joao Martins <joao.m.martins@oracle.com> > Reviewed-by: Naoya Horiguchi <naoya.horiguchi@nec.com> Reviewed-by: Muchun Song <songmuchun@bytedance.com>
Can you please fix up your mailer to not mess with the subject? That makes the thread completely unreadable.
On Thu, Jul 15, 2021 at 2:42 PM Christoph Hellwig <hch@infradead.org> wrote: > > Can you please fix up your mailer to not mess with the subject? > That makes the thread completely unreadable. Sorry. I didn't realize it before. Thanks for your reminder.
On 7/15/21 3:51 AM, Muchun Song wrote: > On Thu, Jul 15, 2021 at 3:36 AM Joao Martins <joao.m.martins@oracle.com> wrote: >> >> memory_failure_dev_pagemap() at the moment assumes base pages (e.g. >> dax_lock_page()). For pagemap with compound pages fetch the >> compound_head in case a tail page memory failure is being handled. >> >> Currently this is a nop, but in the advent of compound pages in >> dev_pagemap it allows memory_failure_dev_pagemap() to keep working. >> >> Reported-by: Jane Chu <jane.chu@oracle.com> >> Signed-off-by: Joao Martins <joao.m.martins@oracle.com> >> Reviewed-by: Naoya Horiguchi <naoya.horiguchi@nec.com> > > Reviewed-by: Muchun Song <songmuchun@bytedance.com> > Thanks!
diff --git a/mm/memory-failure.c b/mm/memory-failure.c index eefd823deb67..c40ea28a4677 100644 --- a/mm/memory-failure.c +++ b/mm/memory-failure.c @@ -1532,6 +1532,12 @@ static int memory_failure_dev_pagemap(unsigned long pfn, int flags, goto out; } + /* + * Pages instantiated by device-dax (not filesystem-dax) + * may be compound pages. + */ + page = compound_head(page); + /* * Prevent the inode from being freed while we are interrogating * the address_space, typically this would be handled by