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: 12792171 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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 62780C433F5 for ; Sat, 26 Mar 2022 01:00:18 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 6E2036B0072; Fri, 25 Mar 2022 21:00:17 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 6690A6B0073; Fri, 25 Mar 2022 21:00:17 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 4E2F06B0074; Fri, 25 Mar 2022 21:00:17 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0036.hostedemail.com [216.40.44.36]) by kanga.kvack.org (Postfix) with ESMTP id 3BDBA6B0072 for ; Fri, 25 Mar 2022 21:00:17 -0400 (EDT) Received: from smtpin25.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id DB33B8249980 for ; Sat, 26 Mar 2022 01:00:16 +0000 (UTC) X-FDA: 79284731232.25.3471A62 Received: from mail-yw1-f202.google.com (mail-yw1-f202.google.com [209.85.128.202]) by imf05.hostedemail.com (Postfix) with ESMTP id 9E7D5100036 for ; Sat, 26 Mar 2022 01:00:16 +0000 (UTC) Received: by mail-yw1-f202.google.com with SMTP id 00721157ae682-2e9ae7bd8deso22161537b3.9 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=HyzJEboYF3r7CQYFaJT53ldoZZEkC6CwbKF2Bg3aRmA+i78U3zEIOpQaHsN/6XBmik tY4F4mYYgxoU/QUknYRGbfaH1wuw7ElD7NgqxAxrbb6r42RW3o0ehXEhC4Ry6m2Yn08F zZZcnut4MDojMDwiSjCnA1C3nRZD4w4dJqq/hKdFj5p6QD2Vv4mPe7ujXbZNpIXqIUf/ zJbUyUrTXsYPugFIffHdZWgwlyLXsr9YutyUgM1icNTruGsWAu6BgHgUuhN/Iuw7BvZl Aj5n/2zgJYFS4KjcfY/pN33i6KPiAc5YVwbLzwlLjcY1URhqF0tFCvPhM0U06tq55ZFl STUA== X-Gm-Message-State: AOAM530oUaK+qMH7WHVlsfZDylXOA+p2I+XG3EktKVVYRK/ZQfst/BXi DreF5KDOLmaGJH7p2a7QLKIkEGd7h6Y= 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-Stat-Signature: pcx3g9yh3cnb38dmt7mrgmtg8z9xj9wj Authentication-Results: imf05.hostedemail.com; dkim=pass header.d=google.com header.s=20210112 header.b=qvXvN7ja; dmarc=pass (policy=reject) header.from=google.com; spf=pass (imf05.hostedemail.com: domain of 3n2U-YgYKCHw3z4mftlttlqj.htrqnsz2-rrp0fhp.twl@flex--yuzhao.bounces.google.com designates 209.85.128.202 as permitted sender) smtp.mailfrom=3n2U-YgYKCHw3z4mftlttlqj.htrqnsz2-rrp0fhp.twl@flex--yuzhao.bounces.google.com X-Rspam-User: X-Rspamd-Server: rspam11 X-Rspamd-Queue-Id: 9E7D5100036 X-HE-Tag: 1648256416-37676 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: 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