Re: [PATCH v3 3/7] proc/task_mmu: clarify shmem mapping walk conditions in smap_gather_stats()
From: David Hildenbrand (Arm)
Date: Fri Sep 11 2026 - 14:06:27 EST
On 9/11/26 19:39, Suren Baghdasaryan wrote:
> On Fri, Sep 11, 2026 at 10:10 AM Lorenzo Stoakes (ARM) <ljs@xxxxxxxxxx> wrote:
>>
>> On Fri, Sep 11, 2026 at 04:58:40PM +0000, Suren Baghdasaryan wrote:
>>>
>>> Well, the "other" Lorenzo does not agree with you and suggested this
>>> approach in [1]. Specifically, see the comment:
>>> ```
>>> I also don't love that 0 is taken to be 'start from vma->vm_start' and I
>>> also don't love that the code in smap_gather_stats() actually special cases
>>> this...
>>
>> I'm not sure what part of this is disagreement?
>>
>> It's saying passing 0 is a hack, which is one that is still in place and which
>> this patch makes worse, because instead of explicitly calling out the invalid
>> value, you're treating it as if it were valid.
>>
>>>
>>> How about passing last_vma_end and making smap_gather_stats() more sane? In
>>> the other invocation of smap_gather_stats() we could pass vma->vm_start
>>> here.
>>
>> Yup, well me of 3 months ago should have suggested what I suggested re: wrapper
>> (I think you cut that suggestion out of my reply).
>>
>>> ```
>>>
>>> [1] https://lore.kernel.org/all/aifO_rCurVhFRTcl@lucifer/
>>
>>>
>>>
>>> See [1]. This is exactly how you wrote it at the end of that reply.
>>
>> Assuming you passed vma->vm_start, not 0? Passing 0 makes it really strange.
>
> Ah! Now I see the problem you are pointing out. Ok, in v2 [2] this was
> done correctly and that's the way you want it!
> Okay, I agree this split was incorrect. I think I'll move is_partial
> conversion completely into the next patch and this one will only
> update the comment and use vma_is_cow_mapping() instead of open-coding
> it.
Ah, that makes sense, I missed that as I was mostly focusing on the cow stuff only.
--
Cheers,
David