Re: [PATCH] mm/rmap: Add anon_vma lifetime debug check

From: David Hildenbrand
Date: Fri Jul 25 2025 - 07:31:58 EST


On 25.07.25 13:24, Jann Horn wrote:
On Fri, Jul 25, 2025 at 1:12 PM David Hildenbrand <david@xxxxxxxxxx> wrote:
On 25.07.25 13:08, Jann Horn wrote:
On Thu, Jul 24, 2025 at 11:56 PM David Hildenbrand <david@xxxxxxxxxx> wrote:
2) We have a folio here, so ... better

if (folio_test_anon(folio) && !folio_test_ksm(folio)) {
...
}

Hrm, okay. It kind of irks me to write it as two checks when really I
want to ask "is it this one specific type", but yeah, will change it.

Well, ksm is a subtype of anon.

I mean... not really? At least ksm folios are not a subtype of normal
anon folios.

Well, what I mean is:

A KSM folio is considered an anon folio.

An anon folio is not necessarily a KSM folio.

Of course, there are implementation differences when it comes to folio->mapping etc, just the way the rmap works.

--
Cheers,

David / dhildenb