Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp4213571pxv; Mon, 5 Jul 2021 17:17:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzwvkgI+VtgWeP74S2q+Gy7RSQO6GUcR5AJ2N4b8zKaw8QK5vhA/Vu6q++URnYLpbREH15d X-Received: by 2002:aa7:cd85:: with SMTP id x5mr19162481edv.115.1625530645803; Mon, 05 Jul 2021 17:17:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625530645; cv=none; d=google.com; s=arc-20160816; b=VyuQ6NzclIwBivscapgVtiaXQQjLg1s3XDiaQrhBXng5I8fhIK7YMpScfLV8jdj2AM IEmPmpEY3ODKIk9h8lfMmYLk4pj/ey3POthiksTSv69GFvaQNKXgXJmUhDjBUArAB70g auMHmjZbpiv0F96As9eDd7T+XGmkUHmiSM8+l+khrIgudGmBUSl1P+XeHRJLT9KxB2uj 3FV9hMazQ2ABPus5nd6DwyBdBPxlyywZZzvs6qKPrnXW3R1k08gJ9SxNIysVuH3iSurr /nqYTZAdRR6nBzWgpq5+0o6sTlewHJPJoEV73EMFzQyI1Kdxz0sWU4CNOZ5jKkU5pqbI xXyQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=/smN0w1INxk9pv/0As8keZJ+96h8KhmxqWKljh+DixM=; b=tm/UgomXqNdO1s3ygMUx8cP5FYM4pbhDH7gCvps7cnJK3f0nTpcs/MQzc0F5zAmQNn 6ymTsfSiGzCfYVQyttmq1fGUuT+szsTMle8Vv3XsAp/pZcm2c2ys0drnJj9BytfxHMlx E/zp29OGA1GjOB/qJeDYvC6+m1JSvYsve+ZBMx6Q2J7Mu1Sk8DsHM0tWVWCX6Mr848j8 Q8bpVnQ27BXJoMLpIdNZJ5ZBusBRv+Mjqkv7zSsXcoElIuC9yMXHia4wMQwsfM36NFTA IjXsVYXTLZ7xQ4XAlgvwkHod9DpI46615obKfI5t1usuK0vowheKIwAEhdxQQztWYsib rEkg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=eCJQMY5H; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id gt41si3469842ejc.192.2021.07.05.17.17.02; Mon, 05 Jul 2021 17:17:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=eCJQMY5H; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229740AbhGFASu (ORCPT + 99 others); Mon, 5 Jul 2021 20:18:50 -0400 Received: from mail.kernel.org ([198.145.29.99]:38538 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229729AbhGFASu (ORCPT ); Mon, 5 Jul 2021 20:18:50 -0400 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 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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, >> >>>