From: Chao Yu <chao@kernel.org>
To: Jaegeuk Kim <jaegeuk@kernel.org>
Cc: Matthew Wilcox <willy@infradead.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: Tue, 6 Jul 2021 08:16:11 +0800 [thread overview]
Message-ID: <5700f9ec-20e9-7de9-7f8e-c11ec7279c20@kernel.org> (raw)
In-Reply-To: <YONKKOBwPUdORO59@google.com>
On 2021/7/6 2:06, Jaegeuk Kim wrote:
> On 07/06, Chao Yu wrote:
>> On 2021/7/5 19:47, Matthew Wilcox wrote:
>>> On Mon, Jul 05, 2021 at 07:33:35PM +0800, Chao Yu wrote:
>>>> On 2021/7/5 16:56, Jaegeuk Kim wrote:
>>>>> On 07/05, Chao Yu wrote:
>>>>>> On 2021/7/5 13:22, Jaegeuk Kim wrote:
>>>>>>> We need to guarantee it's initially zero. Otherwise, it'll hurt entire flag
>>>>>>> operations.
>>>>>>
>>>>>> Oops, I didn't get the point, shouldn't .private be zero after page was
>>>>>> just allocated by filesystem? What's the case we will encounter stall
>>>>>> private data left in page?
>>>>>
>>>>> I'm seeing f2fs_migrate_page() has the newpage with some value without Private
>>>>> flag. That causes a kernel panic later due to wrong private flag used in f2fs.
>>>>
>>>> I'm not familiar with that part of codes, so Cc mm mailing list for help.
>>>>
>>>> My question is newpage in .migrate_page() may contain non-zero value in .private
>>>> field but w/o setting PagePrivate flag, is it a normal case?
>>>
>>> I think freshly allocated pages have a page->private of 0. ie this
>>> code in mm/page_alloc.c:
>>>
>>> page = rmqueue(ac->preferred_zoneref->zone, zone, order,
>>> gfp_mask, alloc_flags, ac->migratetype);
>>> if (page) {
>>> prep_new_page(page, order, gfp_mask, alloc_flags);
>>>
>>> where prep_new_page() calls post_alloc_hook() which contains:
>>> set_page_private(page, 0);
>>>
>>> Now, I do see in __buffer_migrate_page() (mm/migrate.c):
>>>
>>> attach_page_private(newpage, detach_page_private(page));
>>>
>>> but as far as I can tell, f2fs doesn't call any of the
>>> buffer_migrate_page() paths. So I'm not sure why you're seeing
>>> a non-zero page->private.
>>
>> Well, that's strange.
>>
>> Jaegeuk, let's add a BUGON in f2fs to track the call path where newpage
>> has non-zero private value? if this issue is reproducible.
>
> We can debug anything tho, this issue is blocking the production, and I'd
> like to get this in this merge windows. Could you please check the patch
> has any holes?
The code looks good to me,
Reviewed-by: Chao Yu <chao@kernel.org>
Thanks,
>
>>
>> Thanks,
>>
>>>
next prev parent reply other threads:[~2021-07-06 0:16 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 ` 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 [this message]
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
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=5700f9ec-20e9-7de9-7f8e-c11ec7279c20@kernel.org \
--to=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