Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp2610977pxb; Sun, 17 Oct 2021 20:26:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy+xKQM++umGcJ0PiMqrRK1pEUKF1/Y1QNf0lXOEZqFSGt+tuQzIwIW36PBpAN2VrEvt5rD X-Received: by 2002:a65:6854:: with SMTP id q20mr21307228pgt.228.1634527605105; Sun, 17 Oct 2021 20:26:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634527605; cv=none; d=google.com; s=arc-20160816; b=cCznTSRmyMycq1m4vSc/s+hvEwoVMm7vkTu+4P77lOgjFGdFTiIFznSUeXxO7Oib8i 2rSvPgltC7l+T5KY6gcDXh7/+sZa5AOq/P6GoVGm3sfDrCphoG76Lr/KvuOYxMg7fr8K Ok5aYdHjisegOVOCoB3HxelA77jNCOUB71A1CHDTkjskofk3H9yLvFhw9/4yvUNimob2 9NUiWB2mnGlf2N88PU5l3zw4UyZ6HvMPSV4WNMCq6fv23H238BHpxpCQDfS5wG74eOfI SJvWoohX0SFX2XkPXosCn4SXro9aVCLIOssT0Wabay09WBniR3BGeMgNqhhPW8LrIoIx yDqA== 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=p9VpDiEUrsFV9wAfqCcRkrtUgE7eJEP8LO7f/FcU5gQ=; b=sZDMj/Lc1EsmNIRfQoDYf0AjMfH1G+TMhT29Hm0kXkSoOLsM0P496Gq9ZDCtRff1+d cgrdlsWsZswdfwpAhgbQCh/FXjMsxiY5yEdyGp5XTBkKKG7HcxcwIx59WJMen9zz9nlG WJ3wCvRofH5D+mV3GTLEm2edntQjppxJVbSyBQQVHL2zIg8c46uV84FYuJoXkHoAdm8r YL0COwM3t1a60qhLsFRWKJaczLEs4Dr3hWJPRogSjUoJ14Nq+sYExBmfK9RExZVbeQEJ gddIkvtvi7BXxNHO56s5jo7Zyrz4wt2iPOelb9AWPOnIRGNuY1kbO3/KFHfXbXRfqV6U 40sw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=cuU4t3Z5; 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 l3si24244715plg.171.2021.10.17.20.26.33; Sun, 17 Oct 2021 20:26:45 -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=cuU4t3Z5; 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 S243640AbhJPDbt (ORCPT + 98 others); Fri, 15 Oct 2021 23:31:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34116 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243566AbhJPDbf (ORCPT ); Fri, 15 Oct 2021 23:31:35 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 53FEDC061570; Fri, 15 Oct 2021 20:29:28 -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=p9VpDiEUrsFV9wAfqCcRkrtUgE7eJEP8LO7f/FcU5gQ=; b=cuU4t3Z5hNPZpQuvb6l3XjExqV xf2Q2qb+xTFnAnQBCAKu0/My3ySZhqZTEm6iDKqcKG+GlCujIQgcig5itXgclG4J0ffN4nmwBdf1P MgIcpG1+bpfeP/xkr9e/CJaICX6Q7crIelLnsS05H/V3Bc8oe8E6JcWRtXFRYbahM4J+cmVEjhQO+ nFokyJ4aRTprwaWxN7REqT1zsGCKoxVHBh8DRHJ5ncUBI8V73W9moM0pmWdI3YEcqVPIwOcGkhARt Knbv57UoZyGsGaHPIAT5EW/Z7ft1pOl7Isg7SuMKBK8FBDFELP7YioCws2F/PrlBOn++yiPkEI3iz EVXEEadg==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1mbaMx-009SD8-SF; Sat, 16 Oct 2021 03:28:30 +0000 Date: Sat, 16 Oct 2021 04:28:23 +0100 From: Matthew Wilcox To: Johannes Weiner Cc: Kent Overstreet , Linus Torvalds , linux-mm@kvack.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, Andrew Morton , "Darrick J. Wong" , Christoph Hellwig , David Howells Subject: Re: Folios for 5.15 request - Was: re: Folio discussion recap - Message-ID: References: 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 Wed, Sep 22, 2021 at 11:08:58AM -0400, Johannes Weiner wrote: > mm/memcg: Add folio_memcg() and related functions > mm/memcg: Convert commit_charge() to take a folio > mm/memcg: Convert mem_cgroup_charge() to take a folio > mm/memcg: Convert uncharge_page() to uncharge_folio() > mm/memcg: Convert mem_cgroup_uncharge() to take a folio > mm/memcg: Convert mem_cgroup_migrate() to take folios > mm/memcg: Convert mem_cgroup_track_foreign_dirty_slowpath() to folio > mm/memcg: Add folio_memcg_lock() and folio_memcg_unlock() > mm/memcg: Convert mem_cgroup_move_account() to use a folio > mm/memcg: Add folio_lruvec() > mm/memcg: Add folio_lruvec_lock() and similar functions > mm/memcg: Add folio_lruvec_relock_irq() and folio_lruvec_relock_irqsave() > mm/workingset: Convert workingset_activation to take a folio > > This is all anon+file stuff, not needed for filesystem > folios. No, that's not true. A number of these functions are called from filesystem code. mem_cgroup_track_foreign_dirty() is only called from filesystem code. We at the very least need wrappers like folio_cgroup_charge(), and folio_memcg_lock(). > As per the other email, no conceptual entry point for > tail pages into either subsystem, so no ambiguity > around the necessity of any compound_head() calls, > directly or indirectly. It's easy to rule out > wholesale, so there is no justification for > incrementally annotating every single use of the page. The justification is that we can remove all those hidden calls to compound_head(). Hundreds of bytes of text spread throughout this file. > mm: Add folio_young and folio_idle > mm/swap: Add folio_activate() > mm/swap: Add folio_mark_accessed() > > This is anon+file aging stuff, not needed. Again, very much needed. Take a look at pagecache_get_page(). In Linus' tree today, it calls if (page_is_idle(page)) clear_page_idle(page); So either we need wrappers (which are needlessly complicated thanks to how page_is_idle() is defined) or we just convert it. > mm/rmap: Add folio_mkclean() > > mm/migrate: Add folio_migrate_mapping() > mm/migrate: Add folio_migrate_flags() > mm/migrate: Add folio_migrate_copy() > > More anon+file conversion, not needed. As far as I can tell, anon never calls any of these three functions. anon calls migrate_page(), which calls migrate_page_move_mapping(), but several filesystems do call these individual functions. > mm/lru: Add folio_add_lru() > > LRU code, not needed. Again, we need folio_add_lru() for filemap. This one's more tractable as a wrapper function.