[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <6f6279d5-802a-40b4-a0c7-e8d316ec4cbc@lucifer.local>
Date: Thu, 17 Jul 2025 20:33:54 +0100
From: Lorenzo Stoakes <lorenzo.stoakes@...cle.com>
To: Zi Yan <ziy@...dia.com>
Cc: Andrew Morton <akpm@...ux-foundation.org>,
David Hildenbrand <david@...hat.com>,
Dan Carpenter <dan.carpenter@...aro.org>,
Antonio Quartulli <antonio@...delbit.com>, linux-mm@...ck.org,
Hugh Dickins <hughd@...gle.com>,
Kirill Shutemov <k.shutemov@...il.com>,
Baolin Wang <baolin.wang@...ux.alibaba.com>,
"Liam R. Howlett" <Liam.Howlett@...cle.com>,
Nico Pache <npache@...hat.com>, Ryan Roberts <ryan.roberts@....com>,
Dev Jain <dev.jain@....com>, Barry Song <baohua@...nel.org>,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] mm/huge_memory: refactor after-split (page) cache code.
On Thu, Jul 17, 2025 at 11:45:13AM -0400, Zi Yan wrote:
>
> >>
> >> Since we no longer need to make new_folio->index >= end work for anon
> >> folios, can we drop the end = -1 in the if (is_anon) { ... } branch?
> >
> > Sure.
>
> A second thought on this one. If I remove end = -1, can static analysis
> tools understand that end is not used when a folio is anonymous?
> Probably, I can initialize end to -1 and remove end = -1 in is_anon
> branch.
I don't think we should be concering ourselves with this generally
speaking.
But doesn't David's suggested changes preclude this anyway? As you'd only
be referencing end if mapping is set? But then that'd rely on !anon...
Perhaps you can just move figuring out what end is to the if (mapping)
block...
But as Dan alluded I think (hope :P) humans read this stuff in the end
before reporting :)
So if you add a comment very clearly stating that end won't be used if
!mapping then that alone would do I think.
But I see Dan's replying here anyway so will leave to his expertise/your
discretion.
>
> Best Regards,
> Yan, Zi
Powered by blists - more mailing lists