1. 21 Aug, 2023 40 commits
    • Aleksa Sarai's avatar
      memfd: improve userspace warnings for missing exec-related flags · 434ed335
      Aleksa Sarai authored
      In order to incentivise userspace to switch to passing MFD_EXEC and
      MFD_NOEXEC_SEAL, we need to provide a warning on each attempt to call
      memfd_create() without the new flags.  pr_warn_once() is not useful
      because on most systems the one warning is burned up during the boot
      process (on my system, systemd does this within the first second of boot)
      and thus userspace will in practice never see the warnings to push them to
      switch to the new flags.
      
      The original patchset[1] used pr_warn_ratelimited(), however there were
      concerns about the degree of spam in the kernel log[2,3].  The resulting
      inability to detect every case was flagged as an issue at the time[4].
      
      While we could come up with an alternative rate-limiting scheme such as
      only outputting the message if vm.memfd_noexec has been modified, or only
      outputting the message once for a given task, these alternatives have
      downsides that don't make sense given how low-stakes a single kernel
      warning message is.  Switching to pr_info_ratelimited() instead should be
      fine -- it's possible some monitoring tool will be unhappy with a stream
      of warning-level messages but there's already plenty of info-level message
      spam in dmesg.
      
      [1]: https://lore.kernel.org/20221215001205.51969-4-jeffxu@google.com/
      [2]: https://lore.kernel.org/202212161233.85C9783FB@keescook/
      [3]: https://lore.kernel.org/Y5yS8wCnuYGLHMj4@x1n/
      [4]: https://lore.kernel.org/f185bb42-b29c-977e-312e-3349eea15383@linuxfoundation.org/
      
      Link: https://lkml.kernel.org/r/20230814-memfd-vm-noexec-uapi-fixes-v2-3-7ff9e3e10ba6@cyphar.com
      Fixes: 105ff533 ("mm/memfd: add MFD_NOEXEC_SEAL and MFD_EXEC")
      Signed-off-by: default avatarAleksa Sarai <cyphar@cyphar.com>
      Cc: Christian Brauner <brauner@kernel.org>
      Cc: Daniel Verkamp <dverkamp@chromium.org>
      Cc: Dominique Martinet <asmadeus@codewreck.org>
      Cc: Kees Cook <keescook@chromium.org>
      Cc: Shuah Khan <shuah@kernel.org>
      Cc: <stable@vger.kernel.org>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      434ed335
    • Aleksa Sarai's avatar
      memfd: do not -EACCES old memfd_create() users with vm.memfd_noexec=2 · 202e1422
      Aleksa Sarai authored
      Given the difficulty of auditing all of userspace to figure out whether
      every memfd_create() user has switched to passing MFD_EXEC and
      MFD_NOEXEC_SEAL flags, it seems far less distruptive to make it possible
      for older programs that don't make use of executable memfds to run under
      vm.memfd_noexec=2.  Otherwise, a small dependency change can result in
      spurious errors.  For programs that don't use executable memfds, passing
      MFD_NOEXEC_SEAL is functionally a no-op and thus having the same
      
      In addition, every failure under vm.memfd_noexec=2 needs to print to the
      kernel log so that userspace can figure out where the error came from. 
      The concerns about pr_warn_ratelimited() spam that caused the switch to
      pr_warn_once()[1,2] do not apply to the vm.memfd_noexec=2 case.
      
      This is a user-visible API change, but as it allows programs to do
      something that would be blocked before, and the sysctl itself was broken
      and recently released, it seems unlikely this will cause any issues.
      
      [1]: https://lore.kernel.org/Y5yS8wCnuYGLHMj4@x1n/
      [2]: https://lore.kernel.org/202212161233.85C9783FB@keescook/
      
      Link: https://lkml.kernel.org/r/20230814-memfd-vm-noexec-uapi-fixes-v2-2-7ff9e3e10ba6@cyphar.com
      Fixes: 105ff533 ("mm/memfd: add MFD_NOEXEC_SEAL and MFD_EXEC")
      Signed-off-by: default avatarAleksa Sarai <cyphar@cyphar.com>
      Cc: Dominique Martinet <asmadeus@codewreck.org>
      Cc: Christian Brauner <brauner@kernel.org>
      Cc: Daniel Verkamp <dverkamp@chromium.org>
      Cc: Jeff Xu <jeffxu@google.com>
      Cc: Kees Cook <keescook@chromium.org>
      Cc: Shuah Khan <shuah@kernel.org>
      Cc: <stable@vger.kernel.org>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      202e1422
    • Aleksa Sarai's avatar
      selftests: memfd: error out test process when child test fails · 99f34659
      Aleksa Sarai authored
      Patch series "memfd: cleanups for vm.memfd_noexec", v2.
      
      The most critical issue with vm.memfd_noexec=2 (the fact that passing
      MFD_EXEC would bypass it entirely[1]) has been fixed in Andrew's
      tree[2], but there are still some outstanding issues that need to be
      addressed:
      
       * vm.memfd_noexec=2 shouldn't reject old-style memfd_create(2) syscalls
         because it will make it far to difficult to ever migrate. Instead it
         should imply MFD_EXEC.
      
       * The dmesg warnings are pr_warn_once(), which on most systems means
         that they will be used up by systemd or some other boot process and
         userspace developers will never see it.
      
         - For the !(flags & (MFD_EXEC | MFD_NOEXEC_SEAL)) case, outputting a
           rate-limited message to the kernel log is necessary to tell
           userspace that they should add the new flags.
      
           Arguably the most ideal way to deal with the spam concern[3,4]
           while still prompting userspace to switch to the new flags would be
           to only log the warning once per task or something similar.
           However, adding something to task_struct for tracking this would be
           needless bloat for a single pr_warn_ratelimited().
      
           So just switch to pr_info_ratelimited() to avoid spamming the log
           with something that isn't a real warning. There's lots of
           info-level stuff in dmesg, it seems really unlikely that this
           should be an actual problem. Most programs are already switching to
           the new flags anyway.
      
         - For the vm.memfd_noexec=2 case, we need to log a warning for every
           failure because otherwise userspace will have no idea why their
           previously working program started returning -EACCES (previously
           -EINVAL) from memfd_create(2). pr_warn_once() is simply wrong here.
      
       * The racheting mechanism for vm.memfd_noexec makes it incredibly
         unappealing for most users to enable the sysctl because enabling it
         on &init_pid_ns means you need a system reboot to unset it. Given the
         actual security threat being protected against, CAP_SYS_ADMIN users
         being restricted in this way makes little sense.
      
         The argument for this ratcheting by the original author was that it
         allows you to have a hierarchical setting that cannot be unset by
         child pidnses, but this is not accurate -- changing the parent
         pidns's vm.memfd_noexec setting to be more restrictive didn't affect
         children.
      
         Instead, switch the vm.memfd_noexec sysctl to be properly
         hierarchical and allow CAP_SYS_ADMIN users (in the pidns's owning
         userns) to lower the setting as long as it is not lower than the
         parent's effective setting. This change also makes it so that
         changing a parent pidns's vm.memfd_noexec will affect all
         descendants, providing a properly hierarchical setting. The
         performance impact of this is incredibly minimal since the maximum
         depth of pidns is 32 and it is only checked during memfd_create(2)
         and unshare(CLONE_NEWPID).
      
       * The memfd selftests would not exit with a non-zero error code when
         certain tests that ran in a forked process (specifically the ones
         related to MFD_EXEC and MFD_NOEXEC_SEAL) failed.
      
      [1]: https://lore.kernel.org/all/ZJwcsU0vI-nzgOB_@codewreck.org/
      [2]: https://lore.kernel.org/all/20230705063315.3680666-1-jeffxu@google.com/
      [3]: https://lore.kernel.org/Y5yS8wCnuYGLHMj4@x1n/
      [4]: https://lore.kernel.org/f185bb42-b29c-977e-312e-3349eea15383@linuxfoundation.org/
      
      
      This patch (of 5):
      
      Before this change, a test runner using this self test would see a return
      code of 0 when the tests using a child process (namely the MFD_NOEXEC_SEAL
      and MFD_EXEC tests) failed, masking test failures.
      
      Link: https://lkml.kernel.org/r/20230814-memfd-vm-noexec-uapi-fixes-v2-0-7ff9e3e10ba6@cyphar.com
      Link: https://lkml.kernel.org/r/20230814-memfd-vm-noexec-uapi-fixes-v2-1-7ff9e3e10ba6@cyphar.com
      Fixes: 11f75a01 ("selftests/memfd: add tests for MFD_NOEXEC_SEAL MFD_EXEC")
      Signed-off-by: default avatarAleksa Sarai <cyphar@cyphar.com>
      Reviewed-by: default avatarJeff Xu <jeffxu@google.com>
      Cc: "Christian Brauner (Microsoft)" <brauner@kernel.org>
      Cc: Daniel Verkamp <dverkamp@chromium.org>
      Cc: Dominique Martinet <asmadeus@codewreck.org>
      Cc: Kees Cook <keescook@chromium.org>
      Cc: Shuah Khan <shuah@kernel.org>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      99f34659
    • Rong Tao's avatar
      selftests/mm: fix uffd-stress help information · 708879a1
      Rong Tao authored
      commit 686a8bb7("selftests/mm: split uffd tests into uffd-stress and
      uffd-unit-tests") split uffd tests into uffd-stress and uffd-unit-tests,
      obviously we need to modify the help information synchronously.
      
      Also modify code indentation.
      
      Link: https://lkml.kernel.org/r/tencent_64FC724AC5F05568F41BD1C68058E83CEB05@qq.comSigned-off-by: default avatarRong Tao <rongtao@cestc.cn>
      Cc: Shuah Khan <shuah@kernel.org>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      708879a1
    • Vishal Moola (Oracle)'s avatar
      mm: remove pgtable_{pmd, pte}_page_{ctor, dtor}() wrappers · 9a4bbd8d
      Vishal Moola (Oracle) authored
      These functions are no longer necessary.  Remove them and cleanup
      Documentation referencing them.
      
      Link: https://lkml.kernel.org/r/20230807230513.102486-32-vishal.moola@gmail.comSigned-off-by: default avatarVishal Moola (Oracle) <vishal.moola@gmail.com>
      Acked-by: default avatarMike Rapoport (IBM) <rppt@kernel.org>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Catalin Marinas <catalin.marinas@arm.com>
      Cc: Christophe Leroy <christophe.leroy@csgroup.eu>
      Cc: Claudio Imbrenda <imbrenda@linux.ibm.com>
      Cc: Dave Hansen <dave.hansen@linux.intel.com>
      Cc: David Hildenbrand <david@redhat.com>
      Cc: "David S. Miller" <davem@davemloft.net>
      Cc: Dinh Nguyen <dinguyen@kernel.org>
      Cc: Geert Uytterhoeven <geert@linux-m68k.org>
      Cc: Geert Uytterhoeven <geert+renesas@glider.be>
      Cc: Guo Ren <guoren@kernel.org>
      Cc: Huacai Chen <chenhuacai@kernel.org>
      Cc: Hugh Dickins <hughd@google.com>
      Cc: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
      Cc: Jonas Bonn <jonas@southpole.se>
      Cc: Matthew Wilcox <willy@infradead.org>
      Cc: Palmer Dabbelt <palmer@rivosinc.com>
      Cc: Paul Walmsley <paul.walmsley@sifive.com>
      Cc: Richard Weinberger <richard@nod.at>
      Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
      Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      9a4bbd8d
    • Vishal Moola (Oracle)'s avatar
      um: convert {pmd, pte}_free_tlb() to use ptdescs · da9aefca
      Vishal Moola (Oracle) authored
      Part of the conversions to replace pgtable constructor/destructors with
      ptdesc equivalents.  Also cleans up some spacing issues.
      
      Link: https://lkml.kernel.org/r/20230807230513.102486-31-vishal.moola@gmail.comSigned-off-by: default avatarVishal Moola (Oracle) <vishal.moola@gmail.com>
      Acked-by: default avatarMike Rapoport (IBM) <rppt@kernel.org>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Catalin Marinas <catalin.marinas@arm.com>
      Cc: Christophe Leroy <christophe.leroy@csgroup.eu>
      Cc: Claudio Imbrenda <imbrenda@linux.ibm.com>
      Cc: Dave Hansen <dave.hansen@linux.intel.com>
      Cc: David Hildenbrand <david@redhat.com>
      Cc: "David S. Miller" <davem@davemloft.net>
      Cc: Dinh Nguyen <dinguyen@kernel.org>
      Cc: Geert Uytterhoeven <geert@linux-m68k.org>
      Cc: Geert Uytterhoeven <geert+renesas@glider.be>
      Cc: Guo Ren <guoren@kernel.org>
      Cc: Huacai Chen <chenhuacai@kernel.org>
      Cc: Hugh Dickins <hughd@google.com>
      Cc: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
      Cc: Jonas Bonn <jonas@southpole.se>
      Cc: Matthew Wilcox <willy@infradead.org>
      Cc: Palmer Dabbelt <palmer@rivosinc.com>
      Cc: Paul Walmsley <paul.walmsley@sifive.com>
      Cc: Richard Weinberger <richard@nod.at>
      Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
      Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      da9aefca
    • Vishal Moola (Oracle)'s avatar
      sparc: convert pgtable_pte_page_{ctor, dtor}() to ptdesc equivalents · 222107e1
      Vishal Moola (Oracle) authored
      Part of the conversions to replace pgtable pte constructor/destructors
      with ptdesc equivalents.
      
      Link: https://lkml.kernel.org/r/20230807230513.102486-30-vishal.moola@gmail.comSigned-off-by: default avatarVishal Moola (Oracle) <vishal.moola@gmail.com>
      Acked-by: default avatarMike Rapoport (IBM) <rppt@kernel.org>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Catalin Marinas <catalin.marinas@arm.com>
      Cc: Christophe Leroy <christophe.leroy@csgroup.eu>
      Cc: Claudio Imbrenda <imbrenda@linux.ibm.com>
      Cc: Dave Hansen <dave.hansen@linux.intel.com>
      Cc: David Hildenbrand <david@redhat.com>
      Cc: "David S. Miller" <davem@davemloft.net>
      Cc: Dinh Nguyen <dinguyen@kernel.org>
      Cc: Geert Uytterhoeven <geert@linux-m68k.org>
      Cc: Geert Uytterhoeven <geert+renesas@glider.be>
      Cc: Guo Ren <guoren@kernel.org>
      Cc: Huacai Chen <chenhuacai@kernel.org>
      Cc: Hugh Dickins <hughd@google.com>
      Cc: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
      Cc: Jonas Bonn <jonas@southpole.se>
      Cc: Matthew Wilcox <willy@infradead.org>
      Cc: Palmer Dabbelt <palmer@rivosinc.com>
      Cc: Paul Walmsley <paul.walmsley@sifive.com>
      Cc: Richard Weinberger <richard@nod.at>
      Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
      Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      222107e1
    • Vishal Moola (Oracle)'s avatar
      sparc64: convert various functions to use ptdescs · b3311d70
      Vishal Moola (Oracle) authored
      As part of the conversions to replace pgtable constructor/destructors with
      ptdesc equivalents, convert various page table functions to use ptdescs.
      
      Link: https://lkml.kernel.org/r/20230807230513.102486-29-vishal.moola@gmail.comSigned-off-by: default avatarVishal Moola (Oracle) <vishal.moola@gmail.com>
      Acked-by: default avatarMike Rapoport (IBM) <rppt@kernel.org>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Catalin Marinas <catalin.marinas@arm.com>
      Cc: Christophe Leroy <christophe.leroy@csgroup.eu>
      Cc: Claudio Imbrenda <imbrenda@linux.ibm.com>
      Cc: Dave Hansen <dave.hansen@linux.intel.com>
      Cc: David Hildenbrand <david@redhat.com>
      Cc: "David S. Miller" <davem@davemloft.net>
      Cc: Dinh Nguyen <dinguyen@kernel.org>
      Cc: Geert Uytterhoeven <geert@linux-m68k.org>
      Cc: Geert Uytterhoeven <geert+renesas@glider.be>
      Cc: Guo Ren <guoren@kernel.org>
      Cc: Huacai Chen <chenhuacai@kernel.org>
      Cc: Hugh Dickins <hughd@google.com>
      Cc: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
      Cc: Jonas Bonn <jonas@southpole.se>
      Cc: Matthew Wilcox <willy@infradead.org>
      Cc: Palmer Dabbelt <palmer@rivosinc.com>
      Cc: Paul Walmsley <paul.walmsley@sifive.com>
      Cc: Richard Weinberger <richard@nod.at>
      Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
      Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      b3311d70
    • Vishal Moola (Oracle)'s avatar
      sh: convert pte_free_tlb() to use ptdescs · bb3be388
      Vishal Moola (Oracle) authored
      Part of the conversions to replace pgtable constructor/destructors with
      ptdesc equivalents.  Also cleans up some spacing issues.
      
      Link: https://lkml.kernel.org/r/20230807230513.102486-28-vishal.moola@gmail.comSigned-off-by: default avatarVishal Moola (Oracle) <vishal.moola@gmail.com>
      Reviewed-by: default avatarGeert Uytterhoeven <geert+renesas@glider.be>
      Acked-by: default avatarJohn Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
      Acked-by: default avatarMike Rapoport (IBM) <rppt@kernel.org>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Catalin Marinas <catalin.marinas@arm.com>
      Cc: Christophe Leroy <christophe.leroy@csgroup.eu>
      Cc: Claudio Imbrenda <imbrenda@linux.ibm.com>
      Cc: Dave Hansen <dave.hansen@linux.intel.com>
      Cc: David Hildenbrand <david@redhat.com>
      Cc: "David S. Miller" <davem@davemloft.net>
      Cc: Dinh Nguyen <dinguyen@kernel.org>
      Cc: Geert Uytterhoeven <geert@linux-m68k.org>
      Cc: Guo Ren <guoren@kernel.org>
      Cc: Huacai Chen <chenhuacai@kernel.org>
      Cc: Hugh Dickins <hughd@google.com>
      Cc: Jonas Bonn <jonas@southpole.se>
      Cc: Matthew Wilcox <willy@infradead.org>
      Cc: Palmer Dabbelt <palmer@rivosinc.com>
      Cc: Paul Walmsley <paul.walmsley@sifive.com>
      Cc: Richard Weinberger <richard@nod.at>
      Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
      Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      bb3be388
    • Vishal Moola (Oracle)'s avatar
      riscv: convert alloc_{pmd, pte}_late() to use ptdescs · 380f2c1a
      Vishal Moola (Oracle) authored
      As part of the conversions to replace pgtable constructor/destructors with
      ptdesc equivalents, convert various page table functions to use ptdescs.
      
      Some of the functions use the *get*page*() helper functions.  Convert
      these to use pagetable_alloc() and ptdesc_address() instead to help
      standardize page tables further.
      
      Link: https://lkml.kernel.org/r/20230807230513.102486-27-vishal.moola@gmail.comSigned-off-by: default avatarVishal Moola (Oracle) <vishal.moola@gmail.com>
      Acked-by: default avatarPalmer Dabbelt <palmer@rivosinc.com>
      Acked-by: default avatarMike Rapoport (IBM) <rppt@kernel.org>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Catalin Marinas <catalin.marinas@arm.com>
      Cc: Christophe Leroy <christophe.leroy@csgroup.eu>
      Cc: Claudio Imbrenda <imbrenda@linux.ibm.com>
      Cc: Dave Hansen <dave.hansen@linux.intel.com>
      Cc: David Hildenbrand <david@redhat.com>
      Cc: "David S. Miller" <davem@davemloft.net>
      Cc: Dinh Nguyen <dinguyen@kernel.org>
      Cc: Geert Uytterhoeven <geert@linux-m68k.org>
      Cc: Geert Uytterhoeven <geert+renesas@glider.be>
      Cc: Guo Ren <guoren@kernel.org>
      Cc: Huacai Chen <chenhuacai@kernel.org>
      Cc: Hugh Dickins <hughd@google.com>
      Cc: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
      Cc: Jonas Bonn <jonas@southpole.se>
      Cc: Matthew Wilcox <willy@infradead.org>
      Cc: Paul Walmsley <paul.walmsley@sifive.com>
      Cc: Richard Weinberger <richard@nod.at>
      Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
      Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      380f2c1a
    • Vishal Moola (Oracle)'s avatar
      openrisc: convert __pte_free_tlb() to use ptdescs · 5823b9fe
      Vishal Moola (Oracle) authored
      Part of the conversions to replace pgtable constructor/destructors with
      ptdesc equivalents.
      
      Link: https://lkml.kernel.org/r/20230807230513.102486-26-vishal.moola@gmail.comSigned-off-by: default avatarVishal Moola (Oracle) <vishal.moola@gmail.com>
      Acked-by: default avatarMike Rapoport (IBM) <rppt@kernel.org>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Catalin Marinas <catalin.marinas@arm.com>
      Cc: Christophe Leroy <christophe.leroy@csgroup.eu>
      Cc: Claudio Imbrenda <imbrenda@linux.ibm.com>
      Cc: Dave Hansen <dave.hansen@linux.intel.com>
      Cc: David Hildenbrand <david@redhat.com>
      Cc: "David S. Miller" <davem@davemloft.net>
      Cc: Dinh Nguyen <dinguyen@kernel.org>
      Cc: Geert Uytterhoeven <geert@linux-m68k.org>
      Cc: Geert Uytterhoeven <geert+renesas@glider.be>
      Cc: Guo Ren <guoren@kernel.org>
      Cc: Huacai Chen <chenhuacai@kernel.org>
      Cc: Hugh Dickins <hughd@google.com>
      Cc: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
      Cc: Jonas Bonn <jonas@southpole.se>
      Cc: Matthew Wilcox <willy@infradead.org>
      Cc: Palmer Dabbelt <palmer@rivosinc.com>
      Cc: Paul Walmsley <paul.walmsley@sifive.com>
      Cc: Richard Weinberger <richard@nod.at>
      Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
      Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      5823b9fe
    • Vishal Moola (Oracle)'s avatar
      nios2: convert __pte_free_tlb() to use ptdescs · 61139e9a
      Vishal Moola (Oracle) authored
      Part of the conversions to replace pgtable constructor/destructors with
      ptdesc equivalents.
      
      Link: https://lkml.kernel.org/r/20230807230513.102486-25-vishal.moola@gmail.comSigned-off-by: default avatarVishal Moola (Oracle) <vishal.moola@gmail.com>
      Acked-by: default avatarMike Rapoport (IBM) <rppt@kernel.org>
      Acked-by: default avatarDinh Nguyen <dinguyen@kernel.org>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Catalin Marinas <catalin.marinas@arm.com>
      Cc: Christophe Leroy <christophe.leroy@csgroup.eu>
      Cc: Claudio Imbrenda <imbrenda@linux.ibm.com>
      Cc: Dave Hansen <dave.hansen@linux.intel.com>
      Cc: David Hildenbrand <david@redhat.com>
      Cc: "David S. Miller" <davem@davemloft.net>
      Cc: Geert Uytterhoeven <geert@linux-m68k.org>
      Cc: Geert Uytterhoeven <geert+renesas@glider.be>
      Cc: Guo Ren <guoren@kernel.org>
      Cc: Huacai Chen <chenhuacai@kernel.org>
      Cc: Hugh Dickins <hughd@google.com>
      Cc: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
      Cc: Jonas Bonn <jonas@southpole.se>
      Cc: Matthew Wilcox <willy@infradead.org>
      Cc: Palmer Dabbelt <palmer@rivosinc.com>
      Cc: Paul Walmsley <paul.walmsley@sifive.com>
      Cc: Richard Weinberger <richard@nod.at>
      Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
      Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      61139e9a
    • Vishal Moola (Oracle)'s avatar
      mips: convert various functions to use ptdescs · 3e14fb19
      Vishal Moola (Oracle) authored
      As part of the conversions to replace pgtable constructor/destructors with
      ptdesc equivalents, convert various page table functions to use ptdescs.
      
      Some of the functions use the *get*page*() helper functions.  Convert
      these to use pagetable_alloc() and ptdesc_address() instead to help
      standardize page tables further.
      
      Link: https://lkml.kernel.org/r/20230807230513.102486-24-vishal.moola@gmail.comSigned-off-by: default avatarVishal Moola (Oracle) <vishal.moola@gmail.com>
      Acked-by: default avatarMike Rapoport (IBM) <rppt@kernel.org>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Catalin Marinas <catalin.marinas@arm.com>
      Cc: Christophe Leroy <christophe.leroy@csgroup.eu>
      Cc: Claudio Imbrenda <imbrenda@linux.ibm.com>
      Cc: Dave Hansen <dave.hansen@linux.intel.com>
      Cc: David Hildenbrand <david@redhat.com>
      Cc: "David S. Miller" <davem@davemloft.net>
      Cc: Dinh Nguyen <dinguyen@kernel.org>
      Cc: Geert Uytterhoeven <geert@linux-m68k.org>
      Cc: Geert Uytterhoeven <geert+renesas@glider.be>
      Cc: Guo Ren <guoren@kernel.org>
      Cc: Huacai Chen <chenhuacai@kernel.org>
      Cc: Hugh Dickins <hughd@google.com>
      Cc: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
      Cc: Jonas Bonn <jonas@southpole.se>
      Cc: Matthew Wilcox <willy@infradead.org>
      Cc: Palmer Dabbelt <palmer@rivosinc.com>
      Cc: Paul Walmsley <paul.walmsley@sifive.com>
      Cc: Richard Weinberger <richard@nod.at>
      Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
      Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      3e14fb19
    • Vishal Moola (Oracle)'s avatar
      m68k: convert various functions to use ptdescs · bff28e6b
      Vishal Moola (Oracle) authored
      As part of the conversions to replace pgtable constructor/destructors with
      ptdesc equivalents, convert various page table functions to use ptdescs.
      
      Some of the functions use the *get*page*() helper functions.  Convert
      these to use pagetable_alloc() and ptdesc_address() instead to help
      standardize page tables further.
      
      Link: https://lkml.kernel.org/r/20230807230513.102486-23-vishal.moola@gmail.comSigned-off-by: default avatarVishal Moola (Oracle) <vishal.moola@gmail.com>
      Acked-by: default avatarMike Rapoport (IBM) <rppt@kernel.org>
      Acked-by: default avatarGeert Uytterhoeven <geert@linux-m68k.org>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Catalin Marinas <catalin.marinas@arm.com>
      Cc: Christophe Leroy <christophe.leroy@csgroup.eu>
      Cc: Claudio Imbrenda <imbrenda@linux.ibm.com>
      Cc: Dave Hansen <dave.hansen@linux.intel.com>
      Cc: David Hildenbrand <david@redhat.com>
      Cc: "David S. Miller" <davem@davemloft.net>
      Cc: Dinh Nguyen <dinguyen@kernel.org>
      Cc: Geert Uytterhoeven <geert+renesas@glider.be>
      Cc: Guo Ren <guoren@kernel.org>
      Cc: Huacai Chen <chenhuacai@kernel.org>
      Cc: Hugh Dickins <hughd@google.com>
      Cc: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
      Cc: Jonas Bonn <jonas@southpole.se>
      Cc: Matthew Wilcox <willy@infradead.org>
      Cc: Palmer Dabbelt <palmer@rivosinc.com>
      Cc: Paul Walmsley <paul.walmsley@sifive.com>
      Cc: Richard Weinberger <richard@nod.at>
      Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
      Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      bff28e6b
    • Vishal Moola (Oracle)'s avatar
      loongarch: convert various functions to use ptdescs · 38273979
      Vishal Moola (Oracle) authored
      As part of the conversions to replace pgtable constructor/destructors with
      ptdesc equivalents, convert various page table functions to use ptdescs.
      
      Some of the functions use the *get*page*() helper functions.  Convert
      these to use pagetable_alloc() and ptdesc_address() instead to help
      standardize page tables further.
      
      Link: https://lkml.kernel.org/r/20230807230513.102486-22-vishal.moola@gmail.comSigned-off-by: default avatarVishal Moola (Oracle) <vishal.moola@gmail.com>
      Acked-by: default avatarMike Rapoport (IBM) <rppt@kernel.org>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Catalin Marinas <catalin.marinas@arm.com>
      Cc: Christophe Leroy <christophe.leroy@csgroup.eu>
      Cc: Claudio Imbrenda <imbrenda@linux.ibm.com>
      Cc: Dave Hansen <dave.hansen@linux.intel.com>
      Cc: David Hildenbrand <david@redhat.com>
      Cc: "David S. Miller" <davem@davemloft.net>
      Cc: Dinh Nguyen <dinguyen@kernel.org>
      Cc: Geert Uytterhoeven <geert@linux-m68k.org>
      Cc: Geert Uytterhoeven <geert+renesas@glider.be>
      Cc: Guo Ren <guoren@kernel.org>
      Cc: Huacai Chen <chenhuacai@kernel.org>
      Cc: Hugh Dickins <hughd@google.com>
      Cc: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
      Cc: Jonas Bonn <jonas@southpole.se>
      Cc: Matthew Wilcox <willy@infradead.org>
      Cc: Palmer Dabbelt <palmer@rivosinc.com>
      Cc: Paul Walmsley <paul.walmsley@sifive.com>
      Cc: Richard Weinberger <richard@nod.at>
      Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
      Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      38273979
    • Vishal Moola (Oracle)'s avatar
      hexagon: convert __pte_free_tlb() to use ptdescs · b45a12c0
      Vishal Moola (Oracle) authored
      Part of the conversions to replace pgtable constructor/destructors with
      ptdesc equivalents.
      
      Link: https://lkml.kernel.org/r/20230807230513.102486-21-vishal.moola@gmail.comSigned-off-by: default avatarVishal Moola (Oracle) <vishal.moola@gmail.com>
      Acked-by: default avatarMike Rapoport (IBM) <rppt@kernel.org>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Catalin Marinas <catalin.marinas@arm.com>
      Cc: Christophe Leroy <christophe.leroy@csgroup.eu>
      Cc: Claudio Imbrenda <imbrenda@linux.ibm.com>
      Cc: Dave Hansen <dave.hansen@linux.intel.com>
      Cc: David Hildenbrand <david@redhat.com>
      Cc: "David S. Miller" <davem@davemloft.net>
      Cc: Dinh Nguyen <dinguyen@kernel.org>
      Cc: Geert Uytterhoeven <geert@linux-m68k.org>
      Cc: Geert Uytterhoeven <geert+renesas@glider.be>
      Cc: Guo Ren <guoren@kernel.org>
      Cc: Huacai Chen <chenhuacai@kernel.org>
      Cc: Hugh Dickins <hughd@google.com>
      Cc: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
      Cc: Jonas Bonn <jonas@southpole.se>
      Cc: Matthew Wilcox <willy@infradead.org>
      Cc: Palmer Dabbelt <palmer@rivosinc.com>
      Cc: Paul Walmsley <paul.walmsley@sifive.com>
      Cc: Richard Weinberger <richard@nod.at>
      Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
      Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      b45a12c0
    • Vishal Moola (Oracle)'s avatar
      csky: convert __pte_free_tlb() to use ptdescs · e6473339
      Vishal Moola (Oracle) authored
      Part of the conversions to replace pgtable constructor/destructors with
      ptdesc equivalents.
      
      Link: https://lkml.kernel.org/r/20230807230513.102486-20-vishal.moola@gmail.comSigned-off-by: default avatarVishal Moola (Oracle) <vishal.moola@gmail.com>
      Acked-by: default avatarGuo Ren <guoren@kernel.org>
      Acked-by: default avatarMike Rapoport (IBM) <rppt@kernel.org>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Catalin Marinas <catalin.marinas@arm.com>
      Cc: Christophe Leroy <christophe.leroy@csgroup.eu>
      Cc: Claudio Imbrenda <imbrenda@linux.ibm.com>
      Cc: Dave Hansen <dave.hansen@linux.intel.com>
      Cc: David Hildenbrand <david@redhat.com>
      Cc: "David S. Miller" <davem@davemloft.net>
      Cc: Dinh Nguyen <dinguyen@kernel.org>
      Cc: Geert Uytterhoeven <geert@linux-m68k.org>
      Cc: Geert Uytterhoeven <geert+renesas@glider.be>
      Cc: Huacai Chen <chenhuacai@kernel.org>
      Cc: Hugh Dickins <hughd@google.com>
      Cc: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
      Cc: Jonas Bonn <jonas@southpole.se>
      Cc: Matthew Wilcox <willy@infradead.org>
      Cc: Palmer Dabbelt <palmer@rivosinc.com>
      Cc: Paul Walmsley <paul.walmsley@sifive.com>
      Cc: Richard Weinberger <richard@nod.at>
      Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
      Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      e6473339
    • Vishal Moola (Oracle)'s avatar
      arm64: convert various functions to use ptdescs · 11b4fa8b
      Vishal Moola (Oracle) authored
      As part of the conversions to replace pgtable constructor/destructors with
      ptdesc equivalents, convert various page table functions to use ptdescs.
      
      Link: https://lkml.kernel.org/r/20230807230513.102486-19-vishal.moola@gmail.comSigned-off-by: default avatarVishal Moola (Oracle) <vishal.moola@gmail.com>
      Acked-by: default avatarMike Rapoport (IBM) <rppt@kernel.org>
      Acked-by: default avatarCatalin Marinas <catalin.marinas@arm.com>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Christophe Leroy <christophe.leroy@csgroup.eu>
      Cc: Claudio Imbrenda <imbrenda@linux.ibm.com>
      Cc: Dave Hansen <dave.hansen@linux.intel.com>
      Cc: David Hildenbrand <david@redhat.com>
      Cc: "David S. Miller" <davem@davemloft.net>
      Cc: Dinh Nguyen <dinguyen@kernel.org>
      Cc: Geert Uytterhoeven <geert@linux-m68k.org>
      Cc: Geert Uytterhoeven <geert+renesas@glider.be>
      Cc: Guo Ren <guoren@kernel.org>
      Cc: Huacai Chen <chenhuacai@kernel.org>
      Cc: Hugh Dickins <hughd@google.com>
      Cc: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
      Cc: Jonas Bonn <jonas@southpole.se>
      Cc: Matthew Wilcox <willy@infradead.org>
      Cc: Palmer Dabbelt <palmer@rivosinc.com>
      Cc: Paul Walmsley <paul.walmsley@sifive.com>
      Cc: Richard Weinberger <richard@nod.at>
      Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
      Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      11b4fa8b
    • Vishal Moola (Oracle)'s avatar
      arm: convert various functions to use ptdescs · 358d1c39
      Vishal Moola (Oracle) authored
      As part of the conversions to replace pgtable constructor/destructors with
      ptdesc equivalents, convert various page table functions to use ptdescs.
      
      late_alloc() also uses the __get_free_pages() helper function.  Convert
      this to use pagetable_alloc() and ptdesc_address() instead to help
      standardize page tables further.
      
      Link: https://lkml.kernel.org/r/20230807230513.102486-18-vishal.moola@gmail.comSigned-off-by: default avatarVishal Moola (Oracle) <vishal.moola@gmail.com>
      Acked-by: default avatarMike Rapoport (IBM) <rppt@kernel.org>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Catalin Marinas <catalin.marinas@arm.com>
      Cc: Christophe Leroy <christophe.leroy@csgroup.eu>
      Cc: Claudio Imbrenda <imbrenda@linux.ibm.com>
      Cc: Dave Hansen <dave.hansen@linux.intel.com>
      Cc: David Hildenbrand <david@redhat.com>
      Cc: "David S. Miller" <davem@davemloft.net>
      Cc: Dinh Nguyen <dinguyen@kernel.org>
      Cc: Geert Uytterhoeven <geert@linux-m68k.org>
      Cc: Geert Uytterhoeven <geert+renesas@glider.be>
      Cc: Guo Ren <guoren@kernel.org>
      Cc: Huacai Chen <chenhuacai@kernel.org>
      Cc: Hugh Dickins <hughd@google.com>
      Cc: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
      Cc: Jonas Bonn <jonas@southpole.se>
      Cc: Matthew Wilcox <willy@infradead.org>
      Cc: Palmer Dabbelt <palmer@rivosinc.com>
      Cc: Paul Walmsley <paul.walmsley@sifive.com>
      Cc: Richard Weinberger <richard@nod.at>
      Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
      Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      358d1c39
    • Vishal Moola (Oracle)'s avatar
      pgalloc: convert various functions to use ptdescs · c787ae5b
      Vishal Moola (Oracle) authored
      As part of the conversions to replace pgtable constructor/destructors with
      ptdesc equivalents, convert various page table functions to use ptdescs.
      
      Some of the functions use the *get*page*() helper functions.  Convert
      these to use pagetable_alloc() and ptdesc_address() instead to help
      standardize page tables further.
      
      Link: https://lkml.kernel.org/r/20230807230513.102486-17-vishal.moola@gmail.comSigned-off-by: default avatarVishal Moola (Oracle) <vishal.moola@gmail.com>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Catalin Marinas <catalin.marinas@arm.com>
      Cc: Christophe Leroy <christophe.leroy@csgroup.eu>
      Cc: Claudio Imbrenda <imbrenda@linux.ibm.com>
      Cc: Dave Hansen <dave.hansen@linux.intel.com>
      Cc: David Hildenbrand <david@redhat.com>
      Cc: "David S. Miller" <davem@davemloft.net>
      Cc: Dinh Nguyen <dinguyen@kernel.org>
      Cc: Geert Uytterhoeven <geert@linux-m68k.org>
      Cc: Geert Uytterhoeven <geert+renesas@glider.be>
      Cc: Guo Ren <guoren@kernel.org>
      Cc: Huacai Chen <chenhuacai@kernel.org>
      Cc: Hugh Dickins <hughd@google.com>
      Cc: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
      Cc: Jonas Bonn <jonas@southpole.se>
      Cc: Matthew Wilcox <willy@infradead.org>
      Cc: Mike Rapoport (IBM) <rppt@kernel.org>
      Cc: Palmer Dabbelt <palmer@rivosinc.com>
      Cc: Paul Walmsley <paul.walmsley@sifive.com>
      Cc: Richard Weinberger <richard@nod.at>
      Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
      Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      c787ae5b
    • Vishal Moola (Oracle)'s avatar
      mm: remove page table members from struct page · 4f054c28
      Vishal Moola (Oracle) authored
      The page table members are now split out into their own ptdesc struct. 
      Remove them from struct page.
      
      Link: https://lkml.kernel.org/r/20230807230513.102486-16-vishal.moola@gmail.comSigned-off-by: default avatarVishal Moola (Oracle) <vishal.moola@gmail.com>
      Acked-by: default avatarMike Rapoport (IBM) <rppt@kernel.org>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Catalin Marinas <catalin.marinas@arm.com>
      Cc: Christophe Leroy <christophe.leroy@csgroup.eu>
      Cc: Claudio Imbrenda <imbrenda@linux.ibm.com>
      Cc: Dave Hansen <dave.hansen@linux.intel.com>
      Cc: David Hildenbrand <david@redhat.com>
      Cc: "David S. Miller" <davem@davemloft.net>
      Cc: Dinh Nguyen <dinguyen@kernel.org>
      Cc: Geert Uytterhoeven <geert@linux-m68k.org>
      Cc: Geert Uytterhoeven <geert+renesas@glider.be>
      Cc: Guo Ren <guoren@kernel.org>
      Cc: Huacai Chen <chenhuacai@kernel.org>
      Cc: Hugh Dickins <hughd@google.com>
      Cc: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
      Cc: Jonas Bonn <jonas@southpole.se>
      Cc: Matthew Wilcox <willy@infradead.org>
      Cc: Palmer Dabbelt <palmer@rivosinc.com>
      Cc: Paul Walmsley <paul.walmsley@sifive.com>
      Cc: Richard Weinberger <richard@nod.at>
      Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
      Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      4f054c28
    • Vishal Moola (Oracle)'s avatar
      s390: convert various pgalloc functions to use ptdescs · 6326c26c
      Vishal Moola (Oracle) authored
      As part of the conversions to replace pgtable constructor/destructors with
      ptdesc equivalents, convert various page table functions to use ptdescs.
      
      Some of the functions use the *get*page*() helper functions.  Convert
      these to use pagetable_alloc() and ptdesc_address() instead to help
      standardize page tables further.
      
      Link: https://lkml.kernel.org/r/20230807230513.102486-15-vishal.moola@gmail.comSigned-off-by: default avatarVishal Moola (Oracle) <vishal.moola@gmail.com>
      Acked-by: default avatarMike Rapoport (IBM) <rppt@kernel.org>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Catalin Marinas <catalin.marinas@arm.com>
      Cc: Christophe Leroy <christophe.leroy@csgroup.eu>
      Cc: Claudio Imbrenda <imbrenda@linux.ibm.com>
      Cc: Dave Hansen <dave.hansen@linux.intel.com>
      Cc: David Hildenbrand <david@redhat.com>
      Cc: "David S. Miller" <davem@davemloft.net>
      Cc: Dinh Nguyen <dinguyen@kernel.org>
      Cc: Geert Uytterhoeven <geert@linux-m68k.org>
      Cc: Geert Uytterhoeven <geert+renesas@glider.be>
      Cc: Guo Ren <guoren@kernel.org>
      Cc: Huacai Chen <chenhuacai@kernel.org>
      Cc: Hugh Dickins <hughd@google.com>
      Cc: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
      Cc: Jonas Bonn <jonas@southpole.se>
      Cc: Matthew Wilcox <willy@infradead.org>
      Cc: Palmer Dabbelt <palmer@rivosinc.com>
      Cc: Paul Walmsley <paul.walmsley@sifive.com>
      Cc: Richard Weinberger <richard@nod.at>
      Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
      Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      6326c26c
    • Vishal Moola (Oracle)'s avatar
      x86: convert various functions to use ptdescs · f92c494f
      Vishal Moola (Oracle) authored
      In order to split struct ptdesc from struct page, convert various
      functions to use ptdescs.
      
      Some of the functions use the *get*page*() helper functions.  Convert
      these to use pagetable_alloc() and ptdesc_address() instead to help
      standardize page tables further.
      
      Link: https://lkml.kernel.org/r/20230807230513.102486-14-vishal.moola@gmail.comSigned-off-by: default avatarVishal Moola (Oracle) <vishal.moola@gmail.com>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Catalin Marinas <catalin.marinas@arm.com>
      Cc: Christophe Leroy <christophe.leroy@csgroup.eu>
      Cc: Claudio Imbrenda <imbrenda@linux.ibm.com>
      Cc: Dave Hansen <dave.hansen@linux.intel.com>
      Cc: David Hildenbrand <david@redhat.com>
      Cc: "David S. Miller" <davem@davemloft.net>
      Cc: Dinh Nguyen <dinguyen@kernel.org>
      Cc: Geert Uytterhoeven <geert@linux-m68k.org>
      Cc: Geert Uytterhoeven <geert+renesas@glider.be>
      Cc: Guo Ren <guoren@kernel.org>
      Cc: Huacai Chen <chenhuacai@kernel.org>
      Cc: Hugh Dickins <hughd@google.com>
      Cc: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
      Cc: Jonas Bonn <jonas@southpole.se>
      Cc: Matthew Wilcox <willy@infradead.org>
      Cc: Mike Rapoport (IBM) <rppt@kernel.org>
      Cc: Palmer Dabbelt <palmer@rivosinc.com>
      Cc: Paul Walmsley <paul.walmsley@sifive.com>
      Cc: Richard Weinberger <richard@nod.at>
      Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
      Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      f92c494f
    • Vishal Moola (Oracle)'s avatar
      powerpc: convert various functions to use ptdescs · 4eaca961
      Vishal Moola (Oracle) authored
      In order to split struct ptdesc from struct page, convert various
      functions to use ptdescs.
      
      Link: https://lkml.kernel.org/r/20230807230513.102486-13-vishal.moola@gmail.comSigned-off-by: default avatarVishal Moola (Oracle) <vishal.moola@gmail.com>
      Acked-by: default avatarMike Rapoport (IBM) <rppt@kernel.org>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Catalin Marinas <catalin.marinas@arm.com>
      Cc: Christophe Leroy <christophe.leroy@csgroup.eu>
      Cc: Claudio Imbrenda <imbrenda@linux.ibm.com>
      Cc: Dave Hansen <dave.hansen@linux.intel.com>
      Cc: David Hildenbrand <david@redhat.com>
      Cc: "David S. Miller" <davem@davemloft.net>
      Cc: Dinh Nguyen <dinguyen@kernel.org>
      Cc: Geert Uytterhoeven <geert@linux-m68k.org>
      Cc: Geert Uytterhoeven <geert+renesas@glider.be>
      Cc: Guo Ren <guoren@kernel.org>
      Cc: Huacai Chen <chenhuacai@kernel.org>
      Cc: Hugh Dickins <hughd@google.com>
      Cc: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
      Cc: Jonas Bonn <jonas@southpole.se>
      Cc: Matthew Wilcox <willy@infradead.org>
      Cc: Palmer Dabbelt <palmer@rivosinc.com>
      Cc: Paul Walmsley <paul.walmsley@sifive.com>
      Cc: Richard Weinberger <richard@nod.at>
      Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
      Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      4eaca961
    • Vishal Moola (Oracle)'s avatar
      mm: create ptdesc equivalents for pgtable_{pte,pmd}_page_{ctor,dtor} · 7e11dca1
      Vishal Moola (Oracle) authored
      Create pagetable_pte_ctor(), pagetable_pmd_ctor(), pagetable_pte_dtor(),
      and pagetable_pmd_dtor() and make the original pgtable
      constructor/destructors wrappers.
      
      Link: https://lkml.kernel.org/r/20230807230513.102486-12-vishal.moola@gmail.comSigned-off-by: default avatarVishal Moola (Oracle) <vishal.moola@gmail.com>
      Acked-by: default avatarMike Rapoport (IBM) <rppt@kernel.org>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Catalin Marinas <catalin.marinas@arm.com>
      Cc: Christophe Leroy <christophe.leroy@csgroup.eu>
      Cc: Claudio Imbrenda <imbrenda@linux.ibm.com>
      Cc: Dave Hansen <dave.hansen@linux.intel.com>
      Cc: David Hildenbrand <david@redhat.com>
      Cc: "David S. Miller" <davem@davemloft.net>
      Cc: Dinh Nguyen <dinguyen@kernel.org>
      Cc: Geert Uytterhoeven <geert@linux-m68k.org>
      Cc: Geert Uytterhoeven <geert+renesas@glider.be>
      Cc: Guo Ren <guoren@kernel.org>
      Cc: Huacai Chen <chenhuacai@kernel.org>
      Cc: Hugh Dickins <hughd@google.com>
      Cc: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
      Cc: Jonas Bonn <jonas@southpole.se>
      Cc: Matthew Wilcox <willy@infradead.org>
      Cc: Palmer Dabbelt <palmer@rivosinc.com>
      Cc: Paul Walmsley <paul.walmsley@sifive.com>
      Cc: Richard Weinberger <richard@nod.at>
      Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
      Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      7e11dca1
    • Vishal Moola (Oracle)'s avatar
      mm: convert ptlock_free() to use ptdescs · 6ed1b8a0
      Vishal Moola (Oracle) authored
      This removes some direct accesses to struct page, working towards
      splitting out struct ptdesc from struct page.
      
      Link: https://lkml.kernel.org/r/20230807230513.102486-11-vishal.moola@gmail.comSigned-off-by: default avatarVishal Moola (Oracle) <vishal.moola@gmail.com>
      Acked-by: default avatarMike Rapoport (IBM) <rppt@kernel.org>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Catalin Marinas <catalin.marinas@arm.com>
      Cc: Christophe Leroy <christophe.leroy@csgroup.eu>
      Cc: Claudio Imbrenda <imbrenda@linux.ibm.com>
      Cc: Dave Hansen <dave.hansen@linux.intel.com>
      Cc: David Hildenbrand <david@redhat.com>
      Cc: "David S. Miller" <davem@davemloft.net>
      Cc: Dinh Nguyen <dinguyen@kernel.org>
      Cc: Geert Uytterhoeven <geert@linux-m68k.org>
      Cc: Geert Uytterhoeven <geert+renesas@glider.be>
      Cc: Guo Ren <guoren@kernel.org>
      Cc: Huacai Chen <chenhuacai@kernel.org>
      Cc: Hugh Dickins <hughd@google.com>
      Cc: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
      Cc: Jonas Bonn <jonas@southpole.se>
      Cc: Matthew Wilcox <willy@infradead.org>
      Cc: Palmer Dabbelt <palmer@rivosinc.com>
      Cc: Paul Walmsley <paul.walmsley@sifive.com>
      Cc: Richard Weinberger <richard@nod.at>
      Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
      Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      6ed1b8a0
    • Vishal Moola (Oracle)'s avatar
      mm: convert pmd_ptlock_free() to use ptdescs · 7e5f42ae
      Vishal Moola (Oracle) authored
      This removes some direct accesses to struct page, working towards
      splitting out struct ptdesc from struct page.
      
      Link: https://lkml.kernel.org/r/20230807230513.102486-10-vishal.moola@gmail.comSigned-off-by: default avatarVishal Moola (Oracle) <vishal.moola@gmail.com>
      Acked-by: default avatarMike Rapoport (IBM) <rppt@kernel.org>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Catalin Marinas <catalin.marinas@arm.com>
      Cc: Christophe Leroy <christophe.leroy@csgroup.eu>
      Cc: Claudio Imbrenda <imbrenda@linux.ibm.com>
      Cc: Dave Hansen <dave.hansen@linux.intel.com>
      Cc: David Hildenbrand <david@redhat.com>
      Cc: "David S. Miller" <davem@davemloft.net>
      Cc: Dinh Nguyen <dinguyen@kernel.org>
      Cc: Geert Uytterhoeven <geert@linux-m68k.org>
      Cc: Geert Uytterhoeven <geert+renesas@glider.be>
      Cc: Guo Ren <guoren@kernel.org>
      Cc: Huacai Chen <chenhuacai@kernel.org>
      Cc: Hugh Dickins <hughd@google.com>
      Cc: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
      Cc: Jonas Bonn <jonas@southpole.se>
      Cc: Matthew Wilcox <willy@infradead.org>
      Cc: Palmer Dabbelt <palmer@rivosinc.com>
      Cc: Paul Walmsley <paul.walmsley@sifive.com>
      Cc: Richard Weinberger <richard@nod.at>
      Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
      Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      7e5f42ae
    • Vishal Moola (Oracle)'s avatar
      mm: convert ptlock_init() to use ptdescs · 75b25d49
      Vishal Moola (Oracle) authored
      This removes some direct accesses to struct page, working towards
      splitting out struct ptdesc from struct page.
      
      Link: https://lkml.kernel.org/r/20230807230513.102486-9-vishal.moola@gmail.comSigned-off-by: default avatarVishal Moola (Oracle) <vishal.moola@gmail.com>
      Acked-by: default avatarMike Rapoport (IBM) <rppt@kernel.org>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Catalin Marinas <catalin.marinas@arm.com>
      Cc: Christophe Leroy <christophe.leroy@csgroup.eu>
      Cc: Claudio Imbrenda <imbrenda@linux.ibm.com>
      Cc: Dave Hansen <dave.hansen@linux.intel.com>
      Cc: David Hildenbrand <david@redhat.com>
      Cc: "David S. Miller" <davem@davemloft.net>
      Cc: Dinh Nguyen <dinguyen@kernel.org>
      Cc: Geert Uytterhoeven <geert@linux-m68k.org>
      Cc: Geert Uytterhoeven <geert+renesas@glider.be>
      Cc: Guo Ren <guoren@kernel.org>
      Cc: Huacai Chen <chenhuacai@kernel.org>
      Cc: Hugh Dickins <hughd@google.com>
      Cc: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
      Cc: Jonas Bonn <jonas@southpole.se>
      Cc: Matthew Wilcox <willy@infradead.org>
      Cc: Palmer Dabbelt <palmer@rivosinc.com>
      Cc: Paul Walmsley <paul.walmsley@sifive.com>
      Cc: Richard Weinberger <richard@nod.at>
      Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
      Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      75b25d49
    • Vishal Moola (Oracle)'s avatar
      mm: convert pmd_ptlock_init() to use ptdescs · edbaefe5
      Vishal Moola (Oracle) authored
      This removes some direct accesses to struct page, working towards
      splitting out struct ptdesc from struct page.
      
      Link: https://lkml.kernel.org/r/20230807230513.102486-8-vishal.moola@gmail.comSigned-off-by: default avatarVishal Moola (Oracle) <vishal.moola@gmail.com>
      Acked-by: default avatarMike Rapoport (IBM) <rppt@kernel.org>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Catalin Marinas <catalin.marinas@arm.com>
      Cc: Christophe Leroy <christophe.leroy@csgroup.eu>
      Cc: Claudio Imbrenda <imbrenda@linux.ibm.com>
      Cc: Dave Hansen <dave.hansen@linux.intel.com>
      Cc: David Hildenbrand <david@redhat.com>
      Cc: "David S. Miller" <davem@davemloft.net>
      Cc: Dinh Nguyen <dinguyen@kernel.org>
      Cc: Geert Uytterhoeven <geert@linux-m68k.org>
      Cc: Geert Uytterhoeven <geert+renesas@glider.be>
      Cc: Guo Ren <guoren@kernel.org>
      Cc: Huacai Chen <chenhuacai@kernel.org>
      Cc: Hugh Dickins <hughd@google.com>
      Cc: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
      Cc: Jonas Bonn <jonas@southpole.se>
      Cc: Matthew Wilcox <willy@infradead.org>
      Cc: Palmer Dabbelt <palmer@rivosinc.com>
      Cc: Paul Walmsley <paul.walmsley@sifive.com>
      Cc: Richard Weinberger <richard@nod.at>
      Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
      Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      edbaefe5
    • Vishal Moola (Oracle)'s avatar
      mm: convert ptlock_ptr() to use ptdescs · 1865484a
      Vishal Moola (Oracle) authored
      This removes some direct accesses to struct page, working towards
      splitting out struct ptdesc from struct page.
      
      Link: https://lkml.kernel.org/r/20230807230513.102486-7-vishal.moola@gmail.comSigned-off-by: default avatarVishal Moola (Oracle) <vishal.moola@gmail.com>
      Acked-by: default avatarMike Rapoport (IBM) <rppt@kernel.org>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Catalin Marinas <catalin.marinas@arm.com>
      Cc: Christophe Leroy <christophe.leroy@csgroup.eu>
      Cc: Claudio Imbrenda <imbrenda@linux.ibm.com>
      Cc: Dave Hansen <dave.hansen@linux.intel.com>
      Cc: David Hildenbrand <david@redhat.com>
      Cc: "David S. Miller" <davem@davemloft.net>
      Cc: Dinh Nguyen <dinguyen@kernel.org>
      Cc: Geert Uytterhoeven <geert@linux-m68k.org>
      Cc: Geert Uytterhoeven <geert+renesas@glider.be>
      Cc: Guo Ren <guoren@kernel.org>
      Cc: Huacai Chen <chenhuacai@kernel.org>
      Cc: Hugh Dickins <hughd@google.com>
      Cc: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
      Cc: Jonas Bonn <jonas@southpole.se>
      Cc: Matthew Wilcox <willy@infradead.org>
      Cc: Palmer Dabbelt <palmer@rivosinc.com>
      Cc: Paul Walmsley <paul.walmsley@sifive.com>
      Cc: Richard Weinberger <richard@nod.at>
      Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
      Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      1865484a
    • Vishal Moola (Oracle)'s avatar
      mm: convert ptlock_alloc() to use ptdescs · f5ecca06
      Vishal Moola (Oracle) authored
      This removes some direct accesses to struct page, working towards
      splitting out struct ptdesc from struct page.
      
      Link: https://lkml.kernel.org/r/20230807230513.102486-6-vishal.moola@gmail.comSigned-off-by: default avatarVishal Moola (Oracle) <vishal.moola@gmail.com>
      Acked-by: default avatarMike Rapoport (IBM) <rppt@kernel.org>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Catalin Marinas <catalin.marinas@arm.com>
      Cc: Christophe Leroy <christophe.leroy@csgroup.eu>
      Cc: Claudio Imbrenda <imbrenda@linux.ibm.com>
      Cc: Dave Hansen <dave.hansen@linux.intel.com>
      Cc: David Hildenbrand <david@redhat.com>
      Cc: "David S. Miller" <davem@davemloft.net>
      Cc: Dinh Nguyen <dinguyen@kernel.org>
      Cc: Geert Uytterhoeven <geert@linux-m68k.org>
      Cc: Geert Uytterhoeven <geert+renesas@glider.be>
      Cc: Guo Ren <guoren@kernel.org>
      Cc: Huacai Chen <chenhuacai@kernel.org>
      Cc: Hugh Dickins <hughd@google.com>
      Cc: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
      Cc: Jonas Bonn <jonas@southpole.se>
      Cc: Matthew Wilcox <willy@infradead.org>
      Cc: Palmer Dabbelt <palmer@rivosinc.com>
      Cc: Paul Walmsley <paul.walmsley@sifive.com>
      Cc: Richard Weinberger <richard@nod.at>
      Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
      Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      f5ecca06
    • Vishal Moola (Oracle)'s avatar
      mm: convert pmd_pgtable_page() callers to use pmd_ptdesc() · f8546d84
      Vishal Moola (Oracle) authored
      Converts internal pmd_pgtable_page() callers to use pmd_ptdesc().  This
      removes some direct accesses to struct page, working towards splitting out
      struct ptdesc from struct page.
      
      Link: https://lkml.kernel.org/r/20230807230513.102486-5-vishal.moola@gmail.comSigned-off-by: default avatarVishal Moola (Oracle) <vishal.moola@gmail.com>
      Acked-by: default avatarMike Rapoport (IBM) <rppt@kernel.org>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Catalin Marinas <catalin.marinas@arm.com>
      Cc: Christophe Leroy <christophe.leroy@csgroup.eu>
      Cc: Claudio Imbrenda <imbrenda@linux.ibm.com>
      Cc: Dave Hansen <dave.hansen@linux.intel.com>
      Cc: David Hildenbrand <david@redhat.com>
      Cc: "David S. Miller" <davem@davemloft.net>
      Cc: Dinh Nguyen <dinguyen@kernel.org>
      Cc: Geert Uytterhoeven <geert@linux-m68k.org>
      Cc: Geert Uytterhoeven <geert+renesas@glider.be>
      Cc: Guo Ren <guoren@kernel.org>
      Cc: Huacai Chen <chenhuacai@kernel.org>
      Cc: Hugh Dickins <hughd@google.com>
      Cc: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
      Cc: Jonas Bonn <jonas@southpole.se>
      Cc: Matthew Wilcox <willy@infradead.org>
      Cc: Palmer Dabbelt <palmer@rivosinc.com>
      Cc: Paul Walmsley <paul.walmsley@sifive.com>
      Cc: Richard Weinberger <richard@nod.at>
      Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
      Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      f8546d84
    • Vishal Moola (Oracle)'s avatar
      mm: add utility functions for ptdesc · bf2d4334
      Vishal Moola (Oracle) authored
      Introduce utility functions setting the foundation for ptdescs.  These
      will also assist in the splitting out of ptdesc from struct page.
      
      Functions that focus on the descriptor are prefixed with ptdesc_* while
      functions that focus on the pagetable are prefixed with pagetable_*.
      
      pagetable_alloc() is defined to allocate new ptdesc pages as compound
      pages.  This is to standardize ptdescs by allowing for one allocation and
      one free function, in contrast to 2 allocation and 2 free functions.
      
      Link: https://lkml.kernel.org/r/20230807230513.102486-4-vishal.moola@gmail.comSigned-off-by: default avatarVishal Moola (Oracle) <vishal.moola@gmail.com>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Catalin Marinas <catalin.marinas@arm.com>
      Cc: Christophe Leroy <christophe.leroy@csgroup.eu>
      Cc: Claudio Imbrenda <imbrenda@linux.ibm.com>
      Cc: Dave Hansen <dave.hansen@linux.intel.com>
      Cc: David Hildenbrand <david@redhat.com>
      Cc: "David S. Miller" <davem@davemloft.net>
      Cc: Dinh Nguyen <dinguyen@kernel.org>
      Cc: Geert Uytterhoeven <geert@linux-m68k.org>
      Cc: Geert Uytterhoeven <geert+renesas@glider.be>
      Cc: Guo Ren <guoren@kernel.org>
      Cc: Huacai Chen <chenhuacai@kernel.org>
      Cc: Hugh Dickins <hughd@google.com>
      Cc: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
      Cc: Jonas Bonn <jonas@southpole.se>
      Cc: Matthew Wilcox <willy@infradead.org>
      Cc: Mike Rapoport (IBM) <rppt@kernel.org>
      Cc: Palmer Dabbelt <palmer@rivosinc.com>
      Cc: Paul Walmsley <paul.walmsley@sifive.com>
      Cc: Richard Weinberger <richard@nod.at>
      Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
      Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      bf2d4334
    • Vishal Moola (Oracle)'s avatar
      pgtable: create struct ptdesc · 9a35de4f
      Vishal Moola (Oracle) authored
      Currently, page table information is stored within struct page.  As part
      of simplifying struct page, create struct ptdesc for page table
      information.
      
      Link: https://lkml.kernel.org/r/20230807230513.102486-3-vishal.moola@gmail.comSigned-off-by: default avatarVishal Moola (Oracle) <vishal.moola@gmail.com>
      Acked-by: default avatarMike Rapoport (IBM) <rppt@kernel.org>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Catalin Marinas <catalin.marinas@arm.com>
      Cc: Christophe Leroy <christophe.leroy@csgroup.eu>
      Cc: Claudio Imbrenda <imbrenda@linux.ibm.com>
      Cc: Dave Hansen <dave.hansen@linux.intel.com>
      Cc: David Hildenbrand <david@redhat.com>
      Cc: "David S. Miller" <davem@davemloft.net>
      Cc: Dinh Nguyen <dinguyen@kernel.org>
      Cc: Geert Uytterhoeven <geert@linux-m68k.org>
      Cc: Geert Uytterhoeven <geert+renesas@glider.be>
      Cc: Guo Ren <guoren@kernel.org>
      Cc: Huacai Chen <chenhuacai@kernel.org>
      Cc: Hugh Dickins <hughd@google.com>
      Cc: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
      Cc: Jonas Bonn <jonas@southpole.se>
      Cc: Matthew Wilcox <willy@infradead.org>
      Cc: Palmer Dabbelt <palmer@rivosinc.com>
      Cc: Paul Walmsley <paul.walmsley@sifive.com>
      Cc: Richard Weinberger <richard@nod.at>
      Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
      Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      9a35de4f
    • Vishal Moola (Oracle)'s avatar
      mm: add PAGE_TYPE_OP folio functions · f7bda0d8
      Vishal Moola (Oracle) authored
      Patch series "Split ptdesc from struct page", v9.
      
      The MM subsystem is trying to shrink struct page.  This patchset
      introduces a memory descriptor for page table tracking - struct ptdesc.
      
      This patchset introduces ptdesc, splits ptdesc from struct page, and
      converts many callers of page table constructor/destructors to use
      ptdescs.
      
      Ptdesc is a foundation to further standardize page tables, and eventually
      allow for dynamic allocation of page tables independent of struct page. 
      However, the use of pages for page table tracking is quite deeply
      ingrained and varied across archictectures, so there is still a lot of
      work to be done before that can happen.
      
      
      This patch (of 31):
      
      No folio equivalents for page type operations have been defined, so define
      them for later folio conversions.
      
      Also changes the Page##uname macros to take in const struct page* since we
      only read the memory here.
      
      Link: https://lkml.kernel.org/r/20230807230513.102486-1-vishal.moola@gmail.com
      Link: https://lkml.kernel.org/r/20230807230513.102486-2-vishal.moola@gmail.comSigned-off-by: default avatarVishal Moola (Oracle) <vishal.moola@gmail.com>
      Acked-by: default avatarMike Rapoport (IBM) <rppt@kernel.org>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Catalin Marinas <catalin.marinas@arm.com>
      Cc: Christophe Leroy <christophe.leroy@csgroup.eu>
      Cc: Claudio Imbrenda <imbrenda@linux.ibm.com>
      Cc: Dave Hansen <dave.hansen@linux.intel.com>
      Cc: David Hildenbrand <david@redhat.com>
      Cc: "David S. Miller" <davem@davemloft.net>
      Cc: Dinh Nguyen <dinguyen@kernel.org>
      Cc: Geert Uytterhoeven <geert@linux-m68k.org>
      Cc: Huacai Chen <chenhuacai@kernel.org>
      Cc: Hugh Dickins <hughd@google.com>
      Cc: Jonas Bonn <jonas@southpole.se>
      Cc: Matthew Wilcox <willy@infradead.org>
      Cc: Paul Walmsley <paul.walmsley@sifive.com>
      Cc: Richard Weinberger <richard@nod.at>
      Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
      Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
      Cc: Geert Uytterhoeven <geert+renesas@glider.be>
      Cc: Guo Ren <guoren@kernel.org>
      Cc: John Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
      Cc: Palmer Dabbelt <palmer@rivosinc.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      f7bda0d8
    • Xiu Jianfeng's avatar
      mm/z3fold: remove obsolete comment for struct z3fold_pool · e1dea6d3
      Xiu Jianfeng authored
      Since commit e774a7bc ("mm: zswap: remove page reclaim logic from
      z3fold"), zpool and zpool_ops have been removed, so also remove the
      corresponding comments.
      
      Link: https://lkml.kernel.org/r/20230814221142.486548-1-xiujianfeng@huaweicloud.comSigned-off-by: default avatarXiu Jianfeng <xiujianfeng@huawei.com>
      Reviewed-by: default avatarMiaohe Lin <linmiaohe@huawei.com>
      Cc: Vitaly Wool <vitaly.wool@konsulko.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      e1dea6d3
    • Kemeng Shi's avatar
      mm/page_alloc: use get_pfnblock_migratetype to avoid extra page_to_pfn · b5ffd297
      Kemeng Shi authored
      We have get_pageblock_migratetype and get_pfnblock_migratetype to get
      migratetype of page.  get_pfnblock_migratetype accepts both page and pfn
      from caller while get_pageblock_migratetype only accept page and get pfn
      with page_to_pfn from page.
      
      In case we already record pfn of page, we can simply call
      get_pfnblock_migratetype to avoid a page_to_pfn.
      
      Link: https://lkml.kernel.org/r/20230811115945.3423894-3-shikemeng@huaweicloud.comSigned-off-by: default avatarKemeng Shi <shikemeng@huaweicloud.com>
      Acked-by: default avatarMel Gorman <mgorman@techsingularity.net>
      Cc: Baolin Wang <baolin.wang@linux.alibaba.com>
      Cc: David Hildenbrand <david@redhat.com>
      Cc: Matthew Wilcox (Oracle) <willy@infradead.org>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      b5ffd297
    • Kemeng Shi's avatar
      mm/page_alloc: remove unnecessary inner __get_pfnblock_flags_mask · a04d12c2
      Kemeng Shi authored
      Patch series "Two minor cleanups for get pageblock migratetype".
      
      This series contains two minor cleanups for get pageblock migratetype. 
      More details can be found in respective patches.
      
      
      This patch (of 2):
      
      get_pfnblock_flags_mask() just calls inline inner
      __get_pfnblock_flags_mask without any extra work.  Just opencode
      __get_pfnblock_flags_mask in get_pfnblock_flags_mask and replace call to
      __get_pfnblock_flags_mask with call to get_pfnblock_flags_mask to remove
      unnecessary __get_pfnblock_flags_mask.
      
      Link: https://lkml.kernel.org/r/20230811115945.3423894-1-shikemeng@huaweicloud.com
      Link: https://lkml.kernel.org/r/20230811115945.3423894-2-shikemeng@huaweicloud.comSigned-off-by: default avatarKemeng Shi <shikemeng@huaweicloud.com>
      Acked-by: default avatarMel Gorman <mgorman@techsingularity.net>
      Reviewed-by: default avatarMatthew Wilcox (Oracle) <willy@infradead.org>
      Cc: Baolin Wang <baolin.wang@linux.alibaba.com>
      Cc: David Hildenbrand <david@redhat.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      a04d12c2
    • ZhangPeng's avatar
      mm: page_alloc: remove unused parameter from reserve_highatomic_pageblock() · 368d983b
      ZhangPeng authored
      Just remove the redundant parameter alloc_order from
      reserve_highatomic_pageblock(). No functional modification involved.
      
      Link: https://lkml.kernel.org/r/20230809073323.1065286-1-zhangpeng362@huawei.comSigned-off-by: default avatarZhangPeng <zhangpeng362@huawei.com>
      Cc: Kefeng Wang <wangkefeng.wang@huawei.com>
      Cc: Mel Gorman <mgorman@techsingularity.net>
      Cc: Nanyong Sun <sunnanyong@huawei.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      368d983b
    • Charan Teja Kalla's avatar
      Multi-gen LRU: skip CMA pages when they are not eligible · b7108d66
      Charan Teja Kalla authored
      This patch is based on the commit 5da226db("mm: skip CMA pages when
      they are not available") which skips cma pages reclaim when they are not
      eligible for the current allocation context.  In mglru, such pages are
      added to the tail of the immediate generation to maintain better LRU
      order, which is unlike the case of conventional LRU where such pages are
      directly added to the head of the LRU list(akin to adding to head of the
      youngest generation in mglru).
      
      No observable issue without this patch on MGLRU, but logically it make
      sense to skip the CMA page reclaim when those pages can't be satisfied for
      the current allocation context.
      
      Link: https://lkml.kernel.org/r/1691568344-13475-1-git-send-email-quic_charante@quicinc.com
      Fixes: ac35a490 ("mm: multi-gen LRU: minimal implementation")
      Signed-off-by: default avatarCharan Teja Kalla <quic_charante@quicinc.com>
      Reviewed-by: default avatarKalesh Singh <kaleshsingh@google.com>
      Cc: David Hildenbrand <david@redhat.com>
      Cc: Suren Baghdasaryan <surenb@google.com>
      Cc: Yu Zhao <yuzhao@google.com>
      Cc: Zhaoyang Huang <zhaoyang.huang@unisoc.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      b7108d66