Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp3744759pxv; Mon, 5 Jul 2021 04:50:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwPVrMEN3syxrc2llzYD1c39PkboFeDRKLEWf9NJJ97w/cmAvMIsgK0avWzwZe7CY53KstD X-Received: by 2002:a05:6402:448:: with SMTP id p8mr15450826edw.60.1625485816678; Mon, 05 Jul 2021 04:50:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625485816; cv=none; d=google.com; s=arc-20160816; b=F7rYXllOIdJRDYQga3h2qR+odA4btNC2vIo1cx+Zl0KqC0CueKGcs4lpGi5pmv8uDJ bmpTfAlOxmIr9UFN0trksbD3wMQyoliYXeCSa52fm7tiiZwjR2XSQgucGo72Pmwkl24C 9EKJHpywh/+GoIPLx+7gDCutIZeTJj0CdSKoqJyVu3nmReFo0ynBRkYhYh3WhB4y3SFZ fFgpyEuvf2GIymlCkBta7pl0gnsOE8JF+yvh5apqnpuO/4CmS6wtKZ/otjHaprwDC+EK P1fGJKH+SvWgVOfLhW85Yh6GawZppvMR0ph7hAHJjCRb6BPX5oJ+hbxXH2PzbTBulc0g 0gyA== 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=EwWN7+UAKQIxLsDpSIp+JET9XMdfQgDUShXvpWDBlhk=; b=OSEZIMuKDfZiTiT5ifvb9UzmVecT3LrC/f7T/cf/R5B9SjdWrIUnSGay7OMHszPNBt 4KXjynJ+6wLi7edRX+eoEBAXF774SqNrZTdd/iTIKEbatIhzxWJTfZIHAXVX9ldX30+n 6N3DTo1C4tZRh2udUENhozM/XigxSTFKXYNE+4kS8i/PiYZSMehPqTWOJIrfj3SX6gk/ 0BMBHdvOhDQ4Yzts298Gj2OtcTXiHN7/D37Ew1SvP7U/XVTGbG6jfxLuO60tcG2raR3Z Jb/Kw99SLSuELPFzgG6wK6A2lF1zCcOGlt5SpdTHdEyhnaiLkuiCCcmIZkIGRUhQZ+ux jsrA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=eAwDlJOB; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id dz9si11893248edb.354.2021.07.05.04.49.53; Mon, 05 Jul 2021 04:50:16 -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=@infradead.org header.s=casper.20170209 header.b=eAwDlJOB; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231356AbhGELun (ORCPT + 99 others); Mon, 5 Jul 2021 07:50:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45128 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230367AbhGELun (ORCPT ); Mon, 5 Jul 2021 07:50:43 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6E834C061574 for ; Mon, 5 Jul 2021 04:48:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=EwWN7+UAKQIxLsDpSIp+JET9XMdfQgDUShXvpWDBlhk=; b=eAwDlJOBU+Tx+dEU6uv0PcpZ5Z RasJ+GroFUsGWxd2fKjoXsLzNuziTWVLUWfQutkeScELYfij7yZ7HJykLLat5dLYOcHcAvrHwDQwU W1CdwKpLbG4hh5TtyOOLcasY8ml+FqSPjWqH8XaH8/hkTt4v96+Ef5IeS+AurC8CDoczbLR9f7ubh mGx5mtZ7RbC++4TlVSaPOwifGtDvKqJWcQiiQ3oAFxNyUYBX1J/INz+UfIMpO79Tcc67eKXlrKkG5 cphdgL9rx/FDAFW4Z26AGNEqDbHAU/OgDLaArnEVfPfpK10O4WOojU0P9+IYI6yTwpEfBFK+ogBhX +itC8tLQ==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1m0N4m-00AD6s-JQ; Mon, 05 Jul 2021 11:47:50 +0000 Date: Mon, 5 Jul 2021 12:47:48 +0100 From: Matthew Wilcox To: Chao Yu Cc: Jaegeuk Kim , 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> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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.