[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <DE8F7PLNB92Q.1L2EKEK4C6TL5@google.com>
Date: Fri, 14 Nov 2025 12:36:08 +0000
From: Brendan Jackman <jackmanb@...gle.com>
To: fujunjie <fujunjie1@...com>, <akpm@...ux-foundation.org>
Cc: <vbabka@...e.cz>, <surenb@...gle.com>, <mhocko@...e.com>,
<jackmanb@...gle.com>, <hannes@...xchg.org>, <ziy@...dia.com>,
<linux-mm@...ck.org>, <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] mm/page_alloc: optimize lowmem_reserve max lookup using monotonicity
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.
Powered by blists - more mailing lists