Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

mm: ksm: refer to special VMAs via VM_SPECIAL in ksm_compatible()

There's no need to spell out all the special cases, also doing it this way
makes it absolutely clear that we preclude unmergeable VMAs in general,
and puts the other excluded flags in stark and clear contrast.

Link: https://lkml.kernel.org/r/c8be5b055163b164c8824020164076ee3b9389bd.1748537921.git.lorenzo.stoakes@oracle.com
Signed-off-by: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
Acked-by: David Hildenbrand <david@redhat.com>
Reviewed-by: Chengming Zhou <chengming.zhou@linux.dev>
Reviewed-by: Vlastimil Babka <vbabka@suse.cz>
Reviewed-by: Xu Xin <xu.xin16@zte.com.cn>
Reviewed-by: Liam R. Howlett <Liam.Howlett@oracle.com>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: Christian Brauner <brauner@kernel.org>
Cc: Jan Kara <jack@suse.cz>
Cc: Jann Horn <jannh@google.com>
Cc: Stefan Roesch <shr@devkernel.io>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

authored by

Lorenzo Stoakes and committed by
Andrew Morton
b914c47d de195c67

+2 -3
+2 -3
mm/ksm.c
··· 679 679 680 680 static bool ksm_compatible(const struct file *file, vm_flags_t vm_flags) 681 681 { 682 - if (vm_flags & (VM_SHARED | VM_MAYSHARE | VM_PFNMAP | 683 - VM_IO | VM_DONTEXPAND | VM_HUGETLB | 684 - VM_MIXEDMAP | VM_DROPPABLE)) 682 + if (vm_flags & (VM_SHARED | VM_MAYSHARE | VM_SPECIAL | 683 + VM_HUGETLB | VM_DROPPABLE)) 685 684 return false; /* just ignore the advice */ 686 685 687 686 if (file_is_dax(file))