From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.9 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,INCLUDES_CR_TRAILER,MAILING_LIST_MULTI, NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 68114C07E9B for ; Tue, 6 Jul 2021 00:16:15 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id E58F16198D for ; Tue, 6 Jul 2021 00:16:14 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E58F16198D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 8E9C36B0011; Mon, 5 Jul 2021 20:16:14 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 899C66B0036; Mon, 5 Jul 2021 20:16:14 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 73A886B005D; Mon, 5 Jul 2021 20:16:14 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0109.hostedemail.com [216.40.44.109]) by kanga.kvack.org (Postfix) with ESMTP id 4A0B66B0011 for ; Mon, 5 Jul 2021 20:16:14 -0400 (EDT) Received: from smtpin22.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id AEB798249980 for ; Tue, 6 Jul 2021 00:16:13 +0000 (UTC) X-FDA: 78330245826.22.ED5079B Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by imf09.hostedemail.com (Postfix) with ESMTP id 523C83001D37 for ; Tue, 6 Jul 2021 00:16:13 +0000 (UTC) Received: by mail.kernel.org (Postfix) with ESMTPSA id 4C8C261369; Tue, 6 Jul 2021 00:16:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1625530572; bh=fqgzG4+YdYoZurlm67YVOrIFeRf44ClBBF+6X3iuwcQ=; h=Subject:To:Cc:References:From:Date:In-Reply-To:From; b=eCJQMY5HKRT2+u6RtUoTlB8PcxLAr5pgMWFH7Ao/crZh0YbROxhfTm0UnfEkl+0qO ix9MDz60WwZxOEQnMAgupiPgeEeuj0BbrFroqE6cpIKmu7bO6x4e/NtSQIQJebixsQ z9y558GVFtIHaTA/f1QST5mopjTvr1/DE/7G4NcgEaVrYE9r4/CXmjERSXpeL8I7i1 W/SvbYuBie6NFVs7uo//DhBxVDm60QNzaQrlzDKmWo92MsqWEx3LC9d0JXkJJJImn4 hPHuU7jbz5BZFhv51PImowmsY90oo+5i10ps0+Q4jLbgxWw3EQplCBJf5uO3287COe r0YfW4QzuCrtg== Subject: Re: [f2fs-dev] [PATCH] f2fs: initialize page->private when using for our internal use To: Jaegeuk Kim Cc: Matthew Wilcox , linux-kernel@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net, linux-mm@kvack.org References: <20210705052216.831989-1-jaegeuk@kernel.org> <5ab8d01a-8fac-60b2-9c2c-a32c5a81b394@kernel.org> From: Chao Yu Message-ID: <5700f9ec-20e9-7de9-7f8e-c11ec7279c20@kernel.org> Date: Tue, 6 Jul 2021 08:16:11 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Authentication-Results: imf09.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=eCJQMY5H; dmarc=pass (policy=none) header.from=kernel.org; spf=pass (imf09.hostedemail.com: domain of chao@kernel.org designates 198.145.29.99 as permitted sender) smtp.mailfrom=chao@kernel.org X-Stat-Signature: dbk3xcren4ii43j7d4gowpy5cp5hdkpm X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: 523C83001D37 X-HE-Tag: 1625530573-150196 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000002, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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 Thanks, > >> >> Thanks, >> >>>