From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id DD346C433F5 for ; Sat, 16 Oct 2021 03:29:29 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 52ED5611BD for ; Sat, 16 Oct 2021 03:29:29 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 52ED5611BD Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id C54306B0071; Fri, 15 Oct 2021 23:29:28 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id C2C236B0072; Fri, 15 Oct 2021 23:29:28 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B19D06B0073; Fri, 15 Oct 2021 23:29:28 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0171.hostedemail.com [216.40.44.171]) by kanga.kvack.org (Postfix) with ESMTP id A1F306B0071 for ; Fri, 15 Oct 2021 23:29:28 -0400 (EDT) Received: from smtpin28.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 57F618249980 for ; Sat, 16 Oct 2021 03:29:28 +0000 (UTC) X-FDA: 78700870416.28.013F116 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf23.hostedemail.com (Postfix) with ESMTP id 9875690000A5 for ; Sat, 16 Oct 2021 03:29:25 +0000 (UTC) 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: X-Rspamd-Queue-Id: 9875690000A5 X-Stat-Signature: n5f8161o3hbfngugnk3wizoaefis6hwm Authentication-Results: imf23.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=cuU4t3Z5; dmarc=none; spf=none (imf23.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org X-Rspamd-Server: rspam02 X-HE-Tag: 1634354965-681330 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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.