mm/shmem: restore SHMEM_HUGE_DENY precedence over MADV_COLLAPSE
authorZach O'Keefe <zokeefe@google.com>
Sat, 24 Dec 2022 08:20:35 +0000 (00:20 -0800)
committerAndrew Morton <akpm@linux-foundation.org>
Thu, 12 Jan 2023 00:14:20 +0000 (16:14 -0800)
commit3de0c269adc6c2fac0bb1fb11965f0de699dc32b
tree715e57e0e6d29364cbe42d2fb8817bcff5e971a0
parent52dc031088f00e323140ece4004e70c33153c6dd
mm/shmem: restore SHMEM_HUGE_DENY precedence over MADV_COLLAPSE

SHMEM_HUGE_DENY is for emergency use by the admin, to disable allocation
of shmem huge pages if, for example, a dangerous bug is found in their
usage: see "deny" in Documentation/mm/transhuge.rst.  An app using
madvise(,,MADV_COLLAPSE) should not be allowed to override it: restore its
precedence over shmem_huge_force.

Restore SHMEM_HUGE_DENY precedence over MADV_COLLAPSE.

Link: https://lkml.kernel.org/r/20221224082035.3197140-2-zokeefe@google.com
Fixes: 7c6c6cc4d3a2 ("mm/shmem: add flag to enforce shmem THP in hugepage_vma_check()")
Signed-off-by: Zach O'Keefe <zokeefe@google.com>
Suggested-by: Hugh Dickins <hughd@google.com>
Acked-by: David Hildenbrand <david@redhat.com>
Cc: Yang Shi <shy828301@gmail.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
mm/shmem.c