From patchwork Wed Jun 30 04:00:16 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthew Wilcox X-Patchwork-Id: 12351175 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, MENTIONS_GIT_HOSTING,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id BA782C11F65 for ; Wed, 30 Jun 2021 04:02:04 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 44DB361D2C for ; Wed, 30 Jun 2021 04:02:04 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 44DB361D2C Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 433F08D0166; Wed, 30 Jun 2021 00:02:03 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 40B068D0160; Wed, 30 Jun 2021 00:02:03 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 2D3DA8D0166; Wed, 30 Jun 2021 00:02:03 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0194.hostedemail.com [216.40.44.194]) by kanga.kvack.org (Postfix) with ESMTP id 095AD8D0160 for ; Wed, 30 Jun 2021 00:02:03 -0400 (EDT) Received: from smtpin35.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id CA5D98249980 for ; Wed, 30 Jun 2021 04:02:02 +0000 (UTC) X-FDA: 78309042084.35.D8FA678 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf06.hostedemail.com (Postfix) with ESMTP id B7AA3801AF01 for ; Wed, 30 Jun 2021 04:02:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Transfer-Encoding:MIME-Version: Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type:Content-ID: Content-Description:In-Reply-To:References; bh=H55xh5V+oHUYRXdg7je8cyh7ajXB8JcmTsj7ZvoBfcc=; b=VkugjUnYwnT8jLypOv8A1Ln+V/ J//Nq0lYkLXx52J2+WEN6cSvPIY1sY/q1Qjq7Y+y/eQ9RWv0FovaBQmOjaE1kwNGJyc+E6BpfGext 55e9UWOYQctGBZTK7kPeUl1NUnrWs5vtsCt/LjVxIJhZTyt8kSN5iAFAenePRULX8nY7eAIsFXVn/ VUASdirBJ8n0NHCXucK6x+g6QMF8/A2AfJ4bNCF5qzrwLVfKzATQ+d2pljaxZfRYNeF4ulNef8vxL GLLkYB0smy0U8EIrZWDXAiGnwpwHExeDEpBkonDL1X72PHNIe3pKJEQKeu4LTaEFvDOn05YkqtGlT oJ7sXmAw==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1lyROy-004qiJ-92; Wed, 30 Jun 2021 04:00:55 +0000 From: "Matthew Wilcox (Oracle)" To: linux-mm@kvack.org, cgroups@vger.kernel.org Cc: "Matthew Wilcox (Oracle)" , Johannes Weiner , Michal Hocko , Vladimir Davydov Subject: [PATCH v3 00/18] Folio conversion of memcg Date: Wed, 30 Jun 2021 05:00:16 +0100 Message-Id: <20210630040034.1155892-1-willy@infradead.org> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: B7AA3801AF01 X-Stat-Signature: hkg6r19mjd6cbx9rufpoyoepam7ngeja Authentication-Results: imf06.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=VkugjUnY; dmarc=none; spf=none (imf06.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org X-HE-Tag: 1625025721-718070 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: After Michel's comments on "Folio-enabling the page cache", I thought it best to split out the memcg patches from the rest of the page cache folio patches and redo them to focus on correctness (ie always passing a folio). This is fundamentally for review rather than application. I've rebased on Linus' current tree, which includes the recent patchbomb from akpm. That upstream version won't boot on any system I have available, and I'm not comfortable asking for patches to be applied unless I can actually try them. That said, these patches were fine on top of 5.13. There are still a few functions which take pages, but they rely on other conversions happening first, which in turn rely on this set of patches, so I think this is a good place to stop, with the understanding that there will be more patches later. Some of the commit logs may be garbled ... I haven't fully taken into account all of Muchun's recent rework. All of this work is visible in context in a git tree here: https://git.infradead.org/users/willy/pagecache.git/shortlog/refs/heads/folio Matthew Wilcox (Oracle) (18): mm: Add folio_nid() mm/memcg: Remove 'page' parameter to mem_cgroup_charge_statistics() mm/memcg: Use the node id in mem_cgroup_update_tree() mm/memcg: Remove soft_limit_tree_node() mm/memcg: Convert memcg_check_events to take a node ID 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 mem_cgroup_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 include/linux/memcontrol.h | 249 +++++++++++++++---------- include/linux/mm.h | 5 + include/linux/swap.h | 2 +- include/trace/events/writeback.h | 8 +- kernel/events/uprobes.c | 3 +- mm/compaction.c | 2 +- mm/filemap.c | 8 +- mm/huge_memory.c | 2 +- mm/khugepaged.c | 8 +- mm/ksm.c | 3 +- mm/memcontrol.c | 311 +++++++++++++++---------------- mm/memory-failure.c | 2 +- mm/memory.c | 9 +- mm/memremap.c | 2 +- mm/migrate.c | 6 +- mm/page_alloc.c | 2 +- mm/shmem.c | 7 +- mm/swap.c | 4 +- mm/userfaultfd.c | 2 +- mm/vmscan.c | 2 +- mm/workingset.c | 10 +- 21 files changed, 355 insertions(+), 292 deletions(-)