lkml.org 
[lkml]   [2021]   [Oct]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] mm: fix sleeping copy_huge_page called from atomic context
On Fri, Oct 22, 2021 at 09:46:19AM +0200, Andrea Righi wrote:
> copy_huge_page() can be called with mapping->private_lock held from
> __buffer_migrate_page() -> migrate_page_copy(), so it is not safe to
> do a cond_resched() in this context.
>
> Introduce migrate_page_copy_nowait() and copy_huge_page_nowait()
> variants that can be used from an atomic context.

I think this is a consequence of THPs being created when they should not
be. This is the wrong way to fix this problem; and I suspect it may
already be fixed at least in -mm. We should have taken this path:

if (!page_has_buffers(page))
return migrate_page(mapping, newpage, page, mode);

but since we didn't, we can infer that there's a THP which has buffers
(this should never occur). It's the same root cause as the invalidatepage
problem, just with a very different signature.

\
 
 \ /
  Last update: 2021-10-22 13:17    [W:0.990 / U:0.208 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site