linux-stable/Documentation/admin-guide/mm
Maíra Canal 24f9cd195f mm: shmem: override mTHP shmem default with a kernel parameter
Add the ``thp_shmem=`` kernel command line to allow specifying the default
policy of each supported shmem hugepage size.  The kernel parameter
accepts the following format:

thp_shmem=<size>[KMG],<size>[KMG]:<policy>;<size>[KMG]-<size>[KMG]:<policy>

For example,

thp_shmem=16K-64K:always;128K,512K:inherit;256K:advise;1M-2M:never;4M-8M:within_size

Some GPUs may benefit from using huge pages.  Since DRM GEM uses shmem to
allocate anonymous pageable memory, it's essential to control the huge
page allocation policy for the internal shmem mount.  This control can be
achieved through the ``transparent_hugepage_shmem=`` parameter.

Beyond just setting the allocation policy, it's crucial to have granular
control over the size of huge pages that can be allocated.  The GPU may
support only specific huge page sizes, and allocating pages larger/smaller
than those sizes would be ineffective.

Link: https://lkml.kernel.org/r/20241101165719.1074234-6-mcanal@igalia.com
Signed-off-by: Maíra Canal <mcanal@igalia.com>
Reviewed-by: Baolin Wang <baolin.wang@linux.alibaba.com>
Cc: Barry Song <baohua@kernel.org>
Cc: David Hildenbrand <david@redhat.com>
Cc: Hugh Dickins <hughd@google.com>
Cc: Jonathan Corbet <corbet@lwn.net>
Cc: Lance Yang <ioworker0@gmail.com>
Cc: Ryan Roberts <ryan.roberts@arm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
2024-11-11 13:09:43 -08:00
..
damon Docs/damon: use damonitor GitHub organization instead of awslabs 2024-09-09 16:39:00 -07:00
cma_debugfs.rst mm/cma_debug: show complete cma name in debugfs directories 2022-09-11 20:25:50 -07:00
concepts.rst docs/admin-guide/mm: remove useless markup 2023-02-02 10:18:05 -07:00
hugetlbpage.rst docs: hugetlbpage.rst: add hugetlb migration description 2024-04-25 20:56:06 -07:00
idle_page_tracking.rst - Daniel Verkamp has contributed a memfd series ("mm/memfd: add 2023-02-23 17:09:35 -08:00
index.rst docs/admin-guide/mm: correct typo 'quired' to 'queried' 2024-07-03 16:22:36 -06:00
ksm.rst Docs: typos/spelling 2024-05-02 10:02:29 -06:00
memory-hotplug.rst Document/kexec: generalize crash hotplug description 2024-09-01 20:43:37 -07:00
multigen_lru.rst mm: multi-gen LRU: admin guide 2022-09-26 19:46:10 -07:00
nommu-mmap.rst docs: move nommu-mmap.txt to admin-guide and rename to ReST 2020-06-26 11:33:35 -06:00
numa_memory_policy.rst mm/mempolicy: introduce MPOL_WEIGHTED_INTERLEAVE for weighted interleaving 2024-02-22 10:24:46 -08:00
numaperf.rst - Daniel Verkamp has contributed a memfd series ("mm/memfd: add 2023-02-23 17:09:35 -08:00
pagemap.rst kpageflags: detect isolated KPF_THP folios 2024-07-12 15:52:21 -07:00
shrinker_debugfs.rst docs/admin-guide/mm: remove useless markup 2023-02-02 10:18:05 -07:00
soft-dirty.rst docs/admin-guide/mm: remove useless markup 2023-02-02 10:18:05 -07:00
swap_numa.rst docs/admin-guide/mm: remove useless markup 2023-02-02 10:18:05 -07:00
transhuge.rst mm: shmem: override mTHP shmem default with a kernel parameter 2024-11-11 13:09:43 -08:00
userfaultfd.rst userfaultfd: UFFDIO_MOVE uABI 2023-12-29 11:58:24 -08:00
zswap.rst mm: zswap: remove same_filled module params 2024-05-05 17:53:38 -07:00