From patchwork Sat Mar 26 01:00:03 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yu Zhao X-Patchwork-Id: 12792172 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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id A25D4C433F5 for ; Sat, 26 Mar 2022 01:01:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:From:Subject:Mime-Version: Message-Id:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Owner; bh=MB267r/3CxGvi+POrN5aSGfhzaCchjxTvZzo7Btp4S0=; b=g3n tk0dPVUVTPhQqkpLEAtKP9yJ9KxiyaY31eND9JLH+utCPBlUErQLZ5mbrdGj/7xySQ3H+I1RpFyp8 Kzb4d02tI1X7SoTqIqZ268TNswv2KsIT5ylOssibWykZYRFk+QMnlm3sYHzkZHuzOkNsCRFLptUq9 IwMeBhWkXsAHIxSAv00QyqGjhTnu1jmD8oIdQnbIPa/GjF+TZNEqWbj5YIMxH7ft//Zv6yBC9xZoz hyMoplVwdEUBzJXBTY8Q/rOc3BQHpBj0iitQo+cMhysH6ReIjRZhGZwiGuZUnrN4qcqMG0ssPNGM5 DdWrmXIgUNXFU6iAtxQTT79aQRA9qZQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nXun2-003Vpf-GD; Sat, 26 Mar 2022 01:00:24 +0000 Received: from mail-yw1-x114a.google.com ([2607:f8b0:4864:20::114a]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nXumy-003Vng-6f for linux-arm-kernel@lists.infradead.org; Sat, 26 Mar 2022 01:00:22 +0000 Received: by mail-yw1-x114a.google.com with SMTP id 00721157ae682-2e9eb7d669fso3241937b3.14 for ; Fri, 25 Mar 2022 18:00:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=date:message-id:mime-version:subject:from:to:cc; bh=W/ClygQLeJR/GjVzXq75kHiIvruhnm90EJigIUb5rZw=; b=qvXvN7ja3CcCfay9zb0Q2CDseDpfbRINVIQt1YTD06ESglVUby/9ezmskzn7/w1Koa un04IA9WyKGhKOEc48VCnthy3cleHZGP3rbESDpwCOCC8cMPwrC04Nwg4XT8NqqZ0EIW Z61UGzTYFCU6LrZ+Sqe6Mxyoq5iZhYg8G9xKg8X1GpqgKy73kbsuOoJsFiNHsISuc/1R l6JOVgQ4OfTV2WC2GMTRta4NclDnXa7DOGbcok6OLgUqeJ6+7N9ZncSFkivTW/gIf0k4 HKF4UqSzmR88sKi0dZ9pasMRPcAEiNM4shQ9OE32PQcXH6tOS4P2bQoFVGjAf+7m8Eut TyBg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:message-id:mime-version:subject:from:to:cc; bh=W/ClygQLeJR/GjVzXq75kHiIvruhnm90EJigIUb5rZw=; b=4EylCHnIii6G86B7hyuBu9WftqKD+SEmAWBwlJmazeWqi7PkoYj5y58oC8fkrKflxc BT8JFnxnesBv4/EnqKoI2Z6iXkI3bUY5mDgraDVDR7DpTivXxB5jlpp9ynIHd3Fu0rsM 5mOtoWUlyF61lz7sDaYtN/6+KRFsYmsUXUv7ZWJjTRLyuFKMpWPt5YTM1p1QUoYsGAoL 0lRAx7jMN2QvxVsg38wMOuQC1Ai5FNnVqg8tU1Wl2hI+4+A64JUFfrXVDyTn+e1zuj71 JEZ2H/91qXVTBG6rGcF67Cyp6YEE9qvNiRkeHj8NP0KGfr4LDUdAgw2ynJ/DBpPsovd4 uJ6g== X-Gm-Message-State: AOAM531FptboKEwl4BOtjRzUR1UTX6JVMD7QOh26/FxvrScaPZ0QfvDX ZW3cKE2/vjTUEzVbrKpIYuL1EfzeyDs= X-Google-Smtp-Source: ABdhPJy2mX78Uhkpp5sqymv1JurScdsIpF4FkonUhkkFsQjtO+6MfpQJTJvSqsJUsyMITIzOvH5PK27R4IE= X-Received: from yuzhao.bld.corp.google.com ([2620:15c:183:200:cd78:b0cd:6717:696d]) (user=yuzhao job=sendgmr) by 2002:a25:1f88:0:b0:633:6acc:ebff with SMTP id f130-20020a251f88000000b006336accebffmr14039337ybf.377.1648256415541; Fri, 25 Mar 2022 18:00:15 -0700 (PDT) Date: Fri, 25 Mar 2022 19:00:03 -0600 Message-Id: <20220326010003.3155137-1-yuzhao@google.com> Mime-Version: 1.0 X-Mailer: git-send-email 2.35.1.1021.g381101b075-goog Subject: [GIT PULL] Multi-gen LRU for 5.18-rc1 From: Yu Zhao To: Linus Torvalds Cc: Andi Kleen , Andrew Morton , Aneesh Kumar , Barry Song , Brian Geffon , Catalin Marinas , Daniel Byrne , Dave Hansen , Donald Carr , Hillf Danton , " =?utf-8?q?Holger_Hoffst=C3=A4tte?= " , Jan Alexander Steffens , Jens Axboe , Jesse Barnes , Johannes Weiner , Jonathan Corbet , Konstantin Kharlamov , Matthew Wilcox , Mel Gorman , Michael Larabel , Michal Hocko , Mike Rapoport , Oleksandr Natalenko , Rik van Riel , Shuang Zhai , Sofia Trinh , Steven Barrett , Suleiman Souhlal , Vaibhav Jain , Vlastimil Babka , Will Deacon , Ying Huang , linux-arm-kernel@lists.infradead.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, page-reclaim@google.com, x86@kernel.org, Yu Zhao X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220325_180020_255064_75612ADA X-CRM114-Status: GOOD ( 14.05 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hi Linus, This is more of an option than a request for 5.18. I'm sending it to you directly because, in my judgement, it's now as ready as it'll ever be. Thanks! The following changes since commit 46f538bf2404ee9c32648deafb886f49144bfd5e: Merge tag 'backlight-next-5.18' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/backlight (2022-03-25 14:01:23 -0700) are available in the Git repository at: https://linux-mm.googlesource.com/mglru/ tags/mglru-for-5.18-rc1 for you to fetch changes up to bcf5f2a801b85f09ad691d07460fdf3fbef8404d: mm: multi-gen LRU: design doc (2022-03-25 15:30:50 -0600) ---------------------------------------------------------------- Multi-gen LRU for 5.18-rc1 This series was retested on top of 5.18-ed4643521e6a. All previous comments have been addressed. Changes since v8 [1] * Removed two user-hostile config options (suggested by Linus Torvalds). Changes since v9 [2] * Resolved the conflicts with the latest folio changes. * Switched to spin_trylock() to move onto the next page table rather than spin on the current one when trying to clear the accessed bit on many page tables. * Added introductory paragraphs to the admin guide and the design doc (suggested by Mike Rapoport). * Expanded comments in get_nr_evictable() (suggested by Barry Song and Aneesh Kumar). * Expanded comments in inc_max_seq() (suggested by Barry Song). [1] https://lkml.kernel.org/r/20220308234723.3834941-1-yuzhao@google.com [2] https://lkml.kernel.org/r/20220309021230.721028-1-yuzhao@google.com Signed-off-by: Yu Zhao ---------------------------------------------------------------- Yu Zhao (14): mm: x86, arm64: add arch_has_hw_pte_young() mm: x86: add CONFIG_ARCH_HAS_NONLEAF_PMD_YOUNG mm/vmscan.c: refactor shrink_node() Revert "include/linux/mm_inline.h: fold __update_lru_size() into its sole caller" mm: multi-gen LRU: groundwork mm: multi-gen LRU: minimal implementation mm: multi-gen LRU: exploit locality in rmap mm: multi-gen LRU: support page table walks mm: multi-gen LRU: optimize multiple memcgs mm: multi-gen LRU: kill switch mm: multi-gen LRU: thrashing prevention mm: multi-gen LRU: debugfs interface mm: multi-gen LRU: admin guide mm: multi-gen LRU: design doc Documentation/admin-guide/mm/index.rst | 1 + Documentation/admin-guide/mm/multigen_lru.rst | 152 ++ Documentation/vm/index.rst | 1 + Documentation/vm/multigen_lru.rst | 160 ++ arch/Kconfig | 9 + arch/arm64/include/asm/pgtable.h | 14 +- arch/x86/Kconfig | 1 + arch/x86/include/asm/pgtable.h | 9 +- arch/x86/mm/pgtable.c | 5 +- fs/exec.c | 2 + fs/fuse/dev.c | 3 +- include/linux/cgroup.h | 15 +- include/linux/memcontrol.h | 36 + include/linux/mm.h | 7 + include/linux/mm_inline.h | 217 +- include/linux/mm_types.h | 78 + include/linux/mmzone.h | 211 ++ include/linux/nodemask.h | 1 + include/linux/page-flags-layout.h | 11 +- include/linux/page-flags.h | 4 +- include/linux/pgtable.h | 17 +- include/linux/sched.h | 4 + include/linux/swap.h | 4 + kernel/bounds.c | 7 + kernel/cgroup/cgroup-internal.h | 1 - kernel/exit.c | 1 + kernel/fork.c | 9 + kernel/sched/core.c | 1 + mm/Kconfig | 26 + mm/huge_memory.c | 3 +- mm/internal.h | 1 + mm/memcontrol.c | 27 + mm/memory.c | 39 +- mm/mm_init.c | 6 +- mm/mmzone.c | 2 + mm/rmap.c | 7 + mm/swap.c | 55 +- mm/vmscan.c | 3102 +++++++++++++++++++++++-- mm/workingset.c | 119 +- 39 files changed, 4097 insertions(+), 271 deletions(-) create mode 100644 Documentation/admin-guide/mm/multigen_lru.rst create mode 100644 Documentation/vm/multigen_lru.rst