1. 18 Jul, 2022 3 commits
    • Alex Sierra's avatar
      mm: rename is_pinnable_page() to is_longterm_pinnable_page() · 6077c943
      Alex Sierra authored
      Patch series "Add MEMORY_DEVICE_COHERENT for coherent device memory
      mapping", v9.
      
      This patch series introduces MEMORY_DEVICE_COHERENT, a type of memory
      owned by a device that can be mapped into CPU page tables like
      MEMORY_DEVICE_GENERIC and can also be migrated like MEMORY_DEVICE_PRIVATE.
      
      This patch series is mostly self-contained except for a few places where
      it needs to update other subsystems to handle the new memory type.
      
      System stability and performance are not affected according to our ongoing
      testing, including xfstests.
      
      How it works: The system BIOS advertises the GPU device memory (aka VRAM)
      as SPM (special purpose memory) in the UEFI system address map.
      
      The amdgpu driver registers the memory with devmap as
      MEMORY_DEVICE_COHERENT using devm_memremap_pages.  The initial user for
      this hardware page migration capability is the Frontier supercomputer
      project.  This functionality is not AMD-specific.  We expect other GPU
      vendors to find this functionality useful, and possibly other hardware
      types in the future.
      
      Our test nodes in the lab are similar to the Frontier configuration, with
      .5 TB of system memory plus 256 GB of device memory split across 4 GPUs,
      all in a single coherent address space.  Page migration is expected to
      improve application efficiency significantly.  We will report empirical
      results as they become available.
      
      Coherent device type pages at gup are now migrated back to system memory
      if they are being pinned long-term (FOLL_LONGTERM).  The reason is, that
      long-term pinning would interfere with the device memory manager owning
      the device-coherent pages (e.g.  evictions in TTM).  These series
      incorporate Alistair Popple patches to do this migration from
      pin_user_pages() calls.  hmm_gup_test has been added to hmm-test to test
      different get user pages calls.
      
      This series includes handling of device-managed anonymous pages returned
      by vm_normal_pages.  Although they behave like normal pages for purposes
      of mapping in CPU page tables and for COW, they do not support LRU lists,
      NUMA migration or THP.
      
      We also introduced a FOLL_LRU flag that adds the same behaviour to
      follow_page and related APIs, to allow callers to specify that they expect
      to put pages on an LRU list.
      
      
      This patch (of 14):
      
      is_pinnable_page() and folio_is_pinnable() are renamed to
      is_longterm_pinnable_page() and folio_is_longterm_pinnable() respectively.
      These functions are used in the FOLL_LONGTERM flag context.
      
      Link: https://lkml.kernel.org/r/20220715150521.18165-1-alex.sierra@amd.com
      Link: https://lkml.kernel.org/r/20220715150521.18165-2-alex.sierra@amd.comSigned-off-by: default avatarAlex Sierra <alex.sierra@amd.com>
      Reviewed-by: default avatarDavid Hildenbrand <david@redhat.com>
      Cc: Jason Gunthorpe <jgg@nvidia.com>
      Cc: Felix Kuehling <Felix.Kuehling@amd.com>
      Cc: Ralph Campbell <rcampbell@nvidia.com>
      Cc: Christoph Hellwig <hch@lst.de>
      Cc: Jerome Glisse <jglisse@redhat.com>
      Cc: Alistair Popple <apopple@nvidia.com>
      Cc: Matthew Wilcox <willy@infradead.org>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      6077c943
    • Kalpana Shetty's avatar
      selftests/vm: add protection_keys tests to run_vmtests · 30f6f861
      Kalpana Shetty authored
      Add "protected_keys" tests to "run_vmtests.sh" would help run all VM
      related tests from a single shell script.
      
      [kalpana.shetty@amd.com: Shuah Khan's review comments incorporated, added -x executable check]
        Link: https://lkml.kernel.org/r/20220617202931.357-1-kalpana.shetty@amd.com
      Link: https://lkml.kernel.org/r/20220610090704.296-1-kalpana.shetty@amd.com
      Link: https://lkml.kernel.org/r/20220531102556.388-1-kalpana.shetty@amd.comSigned-off-by: default avatarKalpana Shetty <kalpana.shetty@amd.com>
      Cc: Shuah Khan <shuah@kernel.org>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      30f6f861
    • SeongJae Park's avatar
      mm/damon/lru_sort: fix potential memory leak in damon_lru_sort_init() · ec1658f0
      SeongJae Park authored
      damon_lru_sort_init() returns an error when damon_select_ops() fails
      without freeing 'ctx' which allocated before.  This commit fixes the
      potential memory leak by freeing 'ctx' under the situation.
      
      Link: https://lkml.kernel.org/r/20220714170458.49727-1-sj@kernel.org
      Fixes: 40e983cc ("mm/damon: introduce DAMON-based LRU-lists Sorting")
      Signed-off-by: default avatarSeongJae Park <sj@kernel.org>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      ec1658f0
  2. 04 Jul, 2022 37 commits