From: Mel Gorman <mgorman@techsingularity.net>
To: Chao Yu <chao@kernel.org>
Cc: Matthew Wilcox <willy@infradead.org>,
Jaegeuk Kim <jaegeuk@kernel.org>,
linux-kernel@vger.kernel.org,
linux-f2fs-devel@lists.sourceforge.net, linux-mm@kvack.org
Subject: Re: [f2fs-dev] [PATCH] f2fs: initialize page->private when using for our internal use
Date: Wed, 7 Jul 2021 10:57:06 +0100 [thread overview]
Message-ID: <20210707095706.GT3840@techsingularity.net> (raw)
In-Reply-To: <85bb893b-0dc4-5f57-23ec-3f84814b7072@kernel.org>
On Wed, Jul 07, 2021 at 08:48:28AM +0800, Chao Yu wrote:
> On 2021/7/6 17:12, Mel Gorman wrote:
> diff --git a/mm/page_alloc.c b/mm/page_alloc.c
> index d6e94cc8066c..be87c4be481f 100644
> --- a/mm/page_alloc.c
> +++ b/mm/page_alloc.c
> @@ -3515,8 +3515,13 @@ void split_page(struct page *page, unsigned int order)
> VM_BUG_ON_PAGE(PageCompound(page), page);
> VM_BUG_ON_PAGE(!page_count(page), page);
>
> - for (i = 1; i < (1 << order); i++)
> - set_page_refcounted(page + i);
> + for (i = 1; i < (1 << order); i++) {
> + struct page *tail_page = page + i;
> +
> + set_page_refcounted(tail_page);
> + if (WARN_ON_ONCE(tail_page->private))
> + pr_info("order:%x, tailpage.private:%x", order, tail_page->private);
> + }
> split_page_owner(page, 1 << order);
> split_page_memcg(page, 1 << order);
> }
> --
> 2.22.1
>
> With above diff, I got this:
>
> ------------[ cut here ]------------
> WARNING: CPU: 3 PID: 57 at mm/page_alloc.c:3363 split_page.cold+0x8/0x3b
> CPU: 3 PID: 57 Comm: kcompactd0 Tainted: G O 5.13.0-rc1+ #67
> <SNIP>
> order:7, tailpage.private:d0000
> order:7, tailpage.private:d0000
> order:7, tailpage.private:d0000
> order:7, tailpage.private:200000
> order:7, tailpage.private:d0000
> order:7, tailpage.private:d0000
> order:7, tailpage.private:d0000
>
> So how about adding set_page_private(page, 0) in split_page() to clear
> stall data left in tailpages' private field?
>
I think it would work but it would be preferable to find out why the
tail page has an order set in the first place. I've looked over
mm/page_alloc.c and mm/compaction.c a few times and did not spot where
set_private_page(page, 0) is missed when it should be covered by
clear_page_guard or del_page_from_free_list :(
--
Mel Gorman
SUSE Labs
next prev parent reply other threads:[~2021-07-07 9:57 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20210705052216.831989-1-jaegeuk@kernel.org>
[not found] ` <c32642d6-6de2-eb2d-5771-c7cefa62fab5@kernel.org>
[not found] ` <YOLJW0IgCagMk2tF@google.com>
2021-07-05 11:33 ` [f2fs-dev] [PATCH] f2fs: initialize page->private when using for our internal use Chao Yu
2021-07-05 11:47 ` Matthew Wilcox
2021-07-05 16:09 ` Chao Yu
2021-07-05 18:06 ` Jaegeuk Kim
2021-07-06 0:16 ` Chao Yu
2021-07-05 18:04 ` Jaegeuk Kim
2021-07-05 18:45 ` Matthew Wilcox
2021-07-06 9:12 ` Mel Gorman
2021-07-07 0:48 ` Chao Yu
2021-07-07 9:57 ` Mel Gorman [this message]
2021-07-10 8:11 ` Chao Yu
2021-07-12 6:53 ` Michal Hocko
2021-07-13 0:46 ` Chao Yu
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=20210707095706.GT3840@techsingularity.net \
--to=mgorman@techsingularity.net \
--cc=chao@kernel.org \
--cc=jaegeuk@kernel.org \
--cc=linux-f2fs-devel@lists.sourceforge.net \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=willy@infradead.org \
/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).