Thread (146 messages) 146 messages, 8 authors, 23h ago

Re: [PATCH v3 31/40] mm/vma: introduce vma[_flags]_is_persistent()

From: "Lorenzo Stoakes (ARM)" <ljs@kernel.org>
Date: 2026-10-02 14:00:05
Also in: bpf, fuse-devel, kvm, kvm-riscv, kvmarm, linux-arch, linux-doc, linux-fbdev, linux-fsdevel, linux-mm, linux-perf-users, linux-rdma, linux-s390, linux-scsi, linux-sound, linux-trace-kernel, linux-usb, lkml, selinux, sparclinux

On Fri, Oct 02, 2026 at 03:11:27PM +0200, David Hildenbrand (Arm) wrote:
I'd be very happy if we could find a clear way to describe "this is what we call
user memory: anon+pagecache", if that could come handy in such a context.
Rather than arguing about it, how about shifting things to 'what backs the
mapping' and something like:

/* big long kdoc... */
static inline bool vma_flags_is_mm_backed(const vma_flags_t *flags)
{
	/* hugetlb is a fixed mapping, but the mm owns it entirely. */
	if (vma_flags_is_hugetlb(flags))
		return true;

	/*
	 * Kernel-owned mappings are populated by their owner, and fixed mappings
	 * have a layout the mm cannot assume ordinary fault semantics over.
	 */
	if (vma_flags_is_kernel_owned(flags) ||
	    vma_flags_is_fixed_mapping(flags))
		return false;

	/* The mm has promised it may discard droppable memory at any time. */
	return !vma_flags_test_single_mask(flags, VMA_DROPPABLE);
}

?

--
Cheers, Lorenzo
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help