From: Matthew Wilcox <willy@infradead.org>
To: Andrea Righi <andrea.righi@canonical.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
Yang Shi <yang.shi@linux.alibaba.com>,
Minchan Kim <minchan@kernel.org>,
linux-kernel@vger.kernel.org, linux-mm@kvack.org
Subject: Re: [PATCH] mm: fix sleeping copy_huge_page called from atomic context
Date: Fri, 22 Oct 2021 12:15:16 +0100 [thread overview]
Message-ID: <YXKdRDKp+l6lis/R@casper.infradead.org> (raw)
In-Reply-To: <20211022074619.57355-1-andrea.righi@canonical.com>
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.
next prev parent reply other threads:[~2021-10-22 11:16 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-10-22 7:46 [PATCH] mm: fix sleeping copy_huge_page called from atomic context Andrea Righi
2021-10-22 11:15 ` Matthew Wilcox [this message]
2021-10-22 17:38 ` Yang Shi
2021-10-22 18:13 ` Yang Shi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=YXKdRDKp+l6lis/R@casper.infradead.org \
--to=willy@infradead.org \
--cc=akpm@linux-foundation.org \
--cc=andrea.righi@canonical.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=minchan@kernel.org \
--cc=yang.shi@linux.alibaba.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).