Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp4007299pxv; Mon, 5 Jul 2021 11:07:51 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzCgVKAsgLjZgAqoB8O35FK57k6iJh6Eze1M+w3wmbuDjGSbtpJOlonoV67YZsJ3rUEsHt5 X-Received: by 2002:a17:907:3e8a:: with SMTP id hs10mr14515455ejc.359.1625508471092; Mon, 05 Jul 2021 11:07:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625508471; cv=none; d=google.com; s=arc-20160816; b=eYoG5yoxCJLm1I1kO8NEqU2SslClF/A7bIzGfoTL6QCLGoibyyGcRQwlsZGJxuNA0u cglxI0TQStYHmekgW2wcLg18vARjDhwMm7rJro8/Sn2I14e/jBsdA8AdTGWtFUGFPBl8 xcx4ARA9nGMZoFKgDKFjfiPOVTzUX6XLAURm9HyCWUvLSVL5KU7NqNSeYoT0x2mz2aY2 VXZX1k1/k2BATvtQw/9bbqCOd2Ub/xgNEOR9lS+X8pdL64CyrHEilvcy8w7IvfbAT3qu 0lKxFre8kh35aQ5NIl4aYoDME7aD15Opsj1IGSCFW+Y8ahI+dcTbnGsr/ENCsVZLefw4 gfJQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=qyFOSK3UeeFTdbaTOk9xpwuk0JXriGxPW/+6hhvWQTY=; b=WIzhlrnaMMEQrf9uj3l/2gmoOhP8qV+jviU6/CINV4lLTnCo8YPUpwvU96N+wl1Man hs/FkT+ysYyNt3u2ukICNZ/dusmLPLmVWcAleQ3ywm59BA7stgFpB9a+n1Kll4mlOLeJ J9/jHevqOMFC1NYOk2Ov1Kzi0mdU62/zzVrJgYWQt4epXwL4KwaznIguQkFCfuV1LEiU d3Ik94pC4dNsyxwmR1+HSoPP6ugJjWAcx9Kn7XVTtZetWwZLHJrEeIt0+4dEB0rPnbX1 f+PT2641Bu0zHTVdKzU+AsELzv+BhIBbUFUYa7mktNyxSfu9YRdIFyN2pke7wOVr2a9R uiGA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ovqck0GU; 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 gt43si7512725ejc.91.2021.07.05.11.07.27; Mon, 05 Jul 2021 11:07:51 -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=ovqck0GU; 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 S229743AbhGESJM (ORCPT + 99 others); Mon, 5 Jul 2021 14:09:12 -0400 Received: from mail.kernel.org ([198.145.29.99]:44434 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229725AbhGESJL (ORCPT ); Mon, 5 Jul 2021 14:09:11 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 53BEC61960; Mon, 5 Jul 2021 18:06:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1625508394; bh=Xy6ubhejwEcN3GLCCD+sUqLDtIYEEis2KKMbHhLmyHA=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=ovqck0GUI7kaHVA3NtrmtZq5CWV8zozOpFvTU9JFlmuOX/dfRPmcX1M0CDgg5Z+RC 4f7ezNI1khjahp7kAobT7VkG0vANfLf4cv1rjM05f+sEvrup8/cZmYkrM/LnSFvtCd 6Mbs4za5rspQEE3YKc68gNKuZKRGWsI097MuPsQ2PVGhU5VNy6beqYOmz09+uEJ+zS 6R720ei75uXWBTOZomxorAldcIwevOd2KlakHB+LArrWrv0lkTSMHsjSdA2TwBGeyf iIBXMciczvBOC6ndXA2v1UTt8dYAQm9qNVqC5LdJWaNb6rQI3W16KhgsFwIWcbvamQ KKInZt6FF9szg== Date: Mon, 5 Jul 2021 11:06:32 -0700 From: Jaegeuk Kim To: Chao Yu Cc: Matthew Wilcox , 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 Message-ID: References: <20210705052216.831989-1-jaegeuk@kernel.org> <5ab8d01a-8fac-60b2-9c2c-a32c5a81b394@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5ab8d01a-8fac-60b2-9c2c-a32c5a81b394@kernel.org> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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? > > Thanks, > > >