Linux-mm Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Brendan Jackman <jackmanb@google.com>
To: fujunjie <fujunjie1@qq.com>, <akpm@linux-foundation.org>
Cc: <vbabka@suse.cz>, <surenb@google.com>, <mhocko@suse.com>,
	 <jackmanb@google.com>, <hannes@cmpxchg.org>, <ziy@nvidia.com>,
	 <linux-mm@kvack.org>, <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] mm/page_alloc: optimize lowmem_reserve max lookup using monotonicity
Date: Fri, 14 Nov 2025 12:36:08 +0000	[thread overview]
Message-ID: <DE8F7PLNB92Q.1L2EKEK4C6TL5@google.com> (raw)
In-Reply-To: <tencent_ED235B379E160A5C2BCF688ADDF3921EC808@qq.com>

On Fri Nov 14, 2025 at 10:40 AM UTC, fujunjie wrote:
> Although this code is not on a hot path, the revised form is clearer

Is it...?

If people do think it is clearer, let's at least write the right comment
in the right place. Instead of having one piece of code
(calculate_totalreserve_pages()) describe at a distance the behaviour of
another piece of code (setup_per_zone_lowmem_reserve()), let's describe
an invariant of the data ("lowmem_reserve is monotonic, up to the first
zero value"), at the site where the data is defined.

I know sometimes in code this complex we do need these
"spooky-action-at-a-distance" comments but this doesn't seem like one of
those places to me.


  reply	other threads:[~2025-11-14 12:36 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-14 10:40 [PATCH] mm/page_alloc: optimize lowmem_reserve max lookup using monotonicity fujunjie
2025-11-14 12:36 ` Brendan Jackman [this message]
2025-11-14 14:55   ` Fujunjie
2025-11-14 16:12   ` Zi Yan
2025-11-14 16:34     ` Fujunjie
2025-11-14 17:15       ` Zi Yan

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=DE8F7PLNB92Q.1L2EKEK4C6TL5@google.com \
    --to=jackmanb@google.com \
    --cc=akpm@linux-foundation.org \
    --cc=fujunjie1@qq.com \
    --cc=hannes@cmpxchg.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mhocko@suse.com \
    --cc=surenb@google.com \
    --cc=vbabka@suse.cz \
    --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