From: liuye <liuye@kylinos.cn>
To: Matthew Wilcox <willy@infradead.org>
Cc: akpm@linux-foundation.org, linux-mm@kvack.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] mm/debug: Fix minor issues in mm
Date: Thu, 13 Mar 2025 09:04:46 +0800 [thread overview]
Message-ID: <fa38b65e-3271-4989-a95a-64bd8c37441e@kylinos.cn> (raw)
In-Reply-To: <Z9F8JYitsY9viNg4@casper.infradead.org>
在 2025/3/12 20:20, Matthew Wilcox 写道:
>> - if ((head & 1) == 0) {
>> + if (head & 1) {
>> + foliop = (struct folio *)(head - 1);
>> + idx = folio_page_idx(foliop, page);
>> + } else {
>> foliop = (struct folio *)&precise;
>> idx = 0;
>> if (!folio_test_large(foliop))
>> goto dump;
>> foliop = (struct folio *)page;
>> - } else {
>> - foliop = (struct folio *)(head - 1);
>> - idx = folio_page_idx(foliop, page);
>> }
>>
>> if (idx < MAX_FOLIO_NR_PAGES) {
>
> How is this "simpler"? It seems like churn for the sake of churn.
> NACK.
This modification simplifies the condition check by directly testing
head & 1 instead of using ((head & 1) == 0). The updated logic first handles
the case where head & 1 is set, assigning foliop and idx accordingly.
This improves code readability and reduces unnecessary branching,
making the structure more straightforward and easier to maintain.
I am personally accustomed to this format, but if it is not accepted
by the majority, then drop it.
Thanks,
Liu Ye
prev parent reply other threads:[~2025-03-13 1:05 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-03-12 3:23 Liu Ye
2025-03-12 8:37 ` Oscar Salvador
2025-03-12 12:20 ` Matthew Wilcox
2025-03-13 1:04 ` liuye [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=fa38b65e-3271-4989-a95a-64bd8c37441e@kylinos.cn \
--to=liuye@kylinos.cn \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=willy@infradead.org \
/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