linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Lorenzo Stoakes <lorenzo.stoakes@oracle.com>
To: Zi Yan <ziy@nvidia.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	David Hildenbrand <david@redhat.com>,
	Dan Carpenter <dan.carpenter@linaro.org>,
	Antonio Quartulli <antonio@mandelbit.com>,
	linux-mm@kvack.org, Hugh Dickins <hughd@google.com>,
	Kirill Shutemov <k.shutemov@gmail.com>,
	Baolin Wang <baolin.wang@linux.alibaba.com>,
	"Liam R. Howlett" <Liam.Howlett@oracle.com>,
	Nico Pache <npache@redhat.com>,
	Ryan Roberts <ryan.roberts@arm.com>, Dev Jain <dev.jain@arm.com>,
	Barry Song <baohua@kernel.org>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] mm/huge_memory: refactor after-split (page) cache code.
Date: Thu, 17 Jul 2025 20:33:54 +0100	[thread overview]
Message-ID: <6f6279d5-802a-40b4-a0c7-e8d316ec4cbc@lucifer.local> (raw)
In-Reply-To: <5464ABD7-C4C9-4BEF-9E5E-21F5A18C42D9@nvidia.com>

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


      parent reply	other threads:[~2025-07-17 19:34 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-16 17:11 Zi Yan
2025-07-16 17:59 ` Dan Carpenter
2025-07-16 19:12   ` Zi Yan
2025-07-16 18:14 ` David Hildenbrand
2025-07-16 19:14   ` Zi Yan
2025-07-16 19:01 ` Antonio Quartulli
2025-07-16 19:13   ` Zi Yan
2025-07-17 14:46 ` Lorenzo Stoakes
2025-07-17 15:30   ` Zi Yan
2025-07-17 15:45     ` Zi Yan
2025-07-17 19:22       ` Dan Carpenter
2025-07-17 19:27         ` Zi Yan
2025-07-17 19:33       ` Lorenzo Stoakes [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=6f6279d5-802a-40b4-a0c7-e8d316ec4cbc@lucifer.local \
    --to=lorenzo.stoakes@oracle.com \
    --cc=Liam.Howlett@oracle.com \
    --cc=akpm@linux-foundation.org \
    --cc=antonio@mandelbit.com \
    --cc=baohua@kernel.org \
    --cc=baolin.wang@linux.alibaba.com \
    --cc=dan.carpenter@linaro.org \
    --cc=david@redhat.com \
    --cc=dev.jain@arm.com \
    --cc=hughd@google.com \
    --cc=k.shutemov@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=npache@redhat.com \
    --cc=ryan.roberts@arm.com \
    --cc=ziy@nvidia.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox