Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp4032389pxv; Mon, 5 Jul 2021 11:49:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy1Rf5xVLYcgH7dgJTvi8jQiwW3FE1r/ciQhUYTD7/THdlHivr/l3aPwIxvkrZyQGNbEty5 X-Received: by 2002:a17:906:a18b:: with SMTP id s11mr14852804ejy.8.1625510983843; Mon, 05 Jul 2021 11:49:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1625510983; cv=none; d=google.com; s=arc-20160816; b=bFRAT5bvZ3vvINXUsaqxDmnScs7cxmEPfJcoFP6iO4ZzvgYkJauM59BrUr9l5Z8pa3 vWe1p/1Ln5fH+BhJoAiC/bI+yFboXS8Hw4j7SN8vcjZQcGBESfO7gjFnLmquH8cW8LCZ quU991tokhsmrISo158YgFBzH+OQM+oo9XVNDYvE4yMnOwQKlesZSBf8x88+9/0GeRJe qAx30p+OTGI1Fn3XWiJ14dtJRK7CUyjw2pHEjGdun0JiwQ6ftxJlfOujCTO98o9CzC8j HCOKFcTc6RLrzeZVhTjJdzLFEpvh+au6dpT6GeIeAi1qFJljEzBDtu6BwkC20HhKKJ2G msyA== 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=aNDwCscw1p86DkXqINJ193YMMwMojg7IqAtfTHOFrf0=; b=LZtmbdk7y4gmuiGHKZ1IABL3y+MNcvz/Qjz0a9N2HzHTpRMvx7orhMcKGTO6RiQTS8 yV7miDVHAX/4gBF1XIFwtXpUPyMpjvKv0NbzT/GrCLZS4dKkjHjZkQkDskWy7HL8Xl1Y D558m8k6sedfvvf1Xll+9kF2cwfPfXmcESViF83tivQVOvuCDVApRlqXt9cDpbu+rQyE 8Beo6XksSlELlZWjNelVXH+rX4fQW9A+DPWJ0+6d762MUnh9+2+/HK5lDqw3I40WM8/G jG5BKkLJq8a+fLPTqB9YmtYgiA7zXH4q1WaP+egNG4/C4bM2UcDKZy5mNYw8RHo9vW1M zMoQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=tli0JQf6; 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 m7si11798286edq.604.2021.07.05.11.49.13; Mon, 05 Jul 2021 11:49:43 -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=tli0JQf6; 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 S229874AbhGESsT (ORCPT + 99 others); Mon, 5 Jul 2021 14:48:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53230 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229725AbhGESsS (ORCPT ); Mon, 5 Jul 2021 14:48:18 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 13506C061574 for ; Mon, 5 Jul 2021 11:45:41 -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=aNDwCscw1p86DkXqINJ193YMMwMojg7IqAtfTHOFrf0=; b=tli0JQf63aKNQuU6V30vDNoLKW xs1PRFkoJOOygR1Pe/ZKjRhuqlwLDKBN6y1ULUtJb/dYAbDQRHxf9AgySXqDNdzbFgtk8EDNx+JqV iO7ICp+tFdRpf1XWxhgO2SAOSEG8V0KORR1aUAAh6ROogwS3XXW0GzzsqGrRYRkjIA/dwN5XJRFgO DM6jIV+NFd2QqIpBA+rjPQS2f2455MclI6qONorqe5aHu8DjB3D4PlHvSMDCAVgzUNz+kAKyzX92g b13se+6qajfCbSwFF1hA9kH/PbvTj34O0SD3hPjiWrz/IL2Quv0N+M8pd9z2xTXqmep1hBEKHyPM8 sX/mjbTA==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1m0Taw-00AW2c-IU; Mon, 05 Jul 2021 18:45:30 +0000 Date: Mon, 5 Jul 2021 19:45:26 +0100 From: Matthew Wilcox To: Jaegeuk Kim Cc: Chao Yu , linux-kernel@vger.kernel.org, linux-f2fs-devel@lists.sourceforge.net, linux-mm@kvack.org, Mel Gorman 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 11:04:21AM -0700, Jaegeuk Kim wrote: > On 07/05, Matthew Wilcox wrote: > > 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); > > Hmm, I can see it in 4.14 and 5.10 kernel. > > The trace is on: > > 30875 [ 1065.118750] c3 87 f2fs_migrate_page+0x354/0x45c > 30876 [ 1065.123872] c3 87 move_to_new_page+0x70/0x30c > 30877 [ 1065.128813] c3 87 migrate_pages+0x3a0/0x964 > 30878 [ 1065.133583] c3 87 compact_zone+0x608/0xb04 > 30879 [ 1065.138257] c3 87 kcompactd+0x378/0x4ec > 30880 [ 1065.142664] c3 87 kthread+0x11c/0x12c > 30881 [ 1065.146897] c3 87 ret_from_fork+0x10/0x18 > > It seems compaction_alloc() gets a free page which doesn't reset the fields? I'm not really familiar with the compaction code. Mel, I see a call to post_alloc_hook() in split_map_pages(). Are there other ways of getting the compaction code to allocate a page which don't go through split_map_pages()?