+104
−1
Loading
mainline inclusion from mainline-v6.12-rc1 commit 24f9cd195fbc9382ae0ed8b332e6302d1722d8e0 category: feature bugzilla: https://gitee.com/openeuler/kernel/issues/IBG3J8 Reference: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=24f9cd195fbc9382ae0ed8b332e6302d1722d8e0 -------------------------------- 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> Conflicts: mm/shmem.c Documentation/admin-guide/kernel-parameters.rst [Context conflicts in shmem.c due to miss commit e6584c3964f2, yet use strcpy] [Context conflicts in shmem.c due to miss euler hulk commit 8b52f97e] [Context conflicts in kernel-parameters.rst due to miss commit 600716592a3a] Signed-off-by:
Wang Lian <dev01404@linx-info.com> ---