Re: [PATCH v3 2/2] ksm: Optimize rmap_walk_ksm by passing a suitable address range

From: David Hildenbrand (Arm)

Date: Thu Apr 09 2026 - 06:01:11 EST


On 4/9/26 11:53, Lorenzo Stoakes wrote:
> On Thu, Apr 09, 2026 at 11:41:46AM +0200, David Hildenbrand (Arm) wrote:
>> On 4/9/26 11:37, David Hildenbrand (Arm) wrote:
>>>
>>> Right, anon_vma_chain has. Dammit.
>>>
>>>
>>> That's what I said elsewhere and what I was trying to avoid here.
>>>
>>> It's 64bytes, and adding a new item will increase it to 96 bytes IIUC.
>>
>> As we're using a dedicate kmem cache it might "only" add 8 bytes, not
>> sure. Still an undesired increase given that we need that for each entry
>> in the stable/unstable tree.
>
> Hm, random idea, but I wonder if we could cram a bit somewhere that
> indicates whether a remap has in fact taken place?

He, also what I raised elsewhere :)

We would have space for that in the rmap_item.

But see my other message, maybe we can indeed store the pgoff. Needs a
second thought.

--
Cheers,

David