Re: [PATCH v3 2/2] mm/ksm: add initialization helpers for scan_get_next_rmap_item()
From: David Hildenbrand (Arm)
Date: Mon Nov 16 2026 - 10:27:24 EST
>> +static struct ksm_mm_slot *scan_get_first_mm(void)
>> +{
>> + struct ksm_mm_slot *mm_slot = &ksm_mm_head;
>> + struct mm_slot *slot;
>> +
>> + scoped_guard(spinlock, &ksm_mmlist_lock) {
>> + slot = list_entry(mm_slot->slot.mm_node.next,
>> + struct mm_slot, mm_node);
>> + mm_slot = mm_slot_entry(slot, struct ksm_mm_slot, slot);
>> + ksm_scan.mm_slot = mm_slot;
>> + }
>> +
>> + /*
>> + * Although we tested list_empty() above, a racing __ksm_exit
>
> I think you need to update this comment to reflect the fact that you moved the
> list_empty() check :)
Yeah, with both things
Reviewed-by: David Hildenbrand (Arm) <david@xxxxxxxxxx>
Xu, can you send a v4 that I can pick up?
--
Cheers,
David