From: sashiko-bot@kernel.org
To: linuszeng <linuszeng@tencent.com>
Cc: tj@kernel.org, mkoutny@suse.com, hannes@cmpxchg.org,
dri-devel@lists.freedesktop.org
Subject: Re: [PATCH 3/3] mm: page_counter: drop protection fields from struct page_counter
Date: Wed, 09 Sep 2026 08:38:03 +0000 [thread overview]
Message-ID: <20260909083803.B6E3C1F00A3A@smtp.kernel.org> (raw)
In-Reply-To: <20260909-descriptive-name-v1-3-1828961cb01a@tencent.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Low] Orphaned and factually incorrect comment and redundant padding in `struct page_counter`.
--
commit 2561d898691e5e4e0a87e8f8b40818bf2f82cbb1
Author: linuszeng <linuszeng@tencent.com>
mm: page_counter: drop protection fields from struct page_counter
This commit drops protection-related fields from struct page_counter and
moves them into a new struct page_counter_protection. This shrinks the
page_counter structure for non-memory counters like swap and kmem.
> diff --git a/include/linux/page_counter.h b/include/linux/page_counter.h
> index b81f16702764e..a4dd461523af2 100644
> --- a/include/linux/page_counter.h
> +++ b/include/linux/page_counter.h
[ ... ]
> @@ -73,6 +57,9 @@ struct page_counter {
> * support memory.min/memory.low (swap, memsw, kmem, tcpmem, ...).
> */
> struct page_counter_protection *prot;
> +
> + /* Keep all the read most fields in a separete cacheline. */
> + CACHELINE_PADDING(_pad2_);
> } ____cacheline_internodealigned_in_smp;
[Severity: Low]
Does this move of the padding to the end of the struct render both the
comment incorrect and the padding redundant?
Because the struct is already decorated with
____cacheline_internodealigned_in_smp, adding CACHELINE_PADDING(_pad2_) at the
very end appears unnecessary.
Additionally, since the padding was moved, the read-mostly fields (such as
track_failcnt, high, max) now share the second cacheline with the frequently
modified watermark fields. This behavior contradicts the comment that
states it keeps all the read most fields in a separate cacheline.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260909-descriptive-name-v1-0-1828961cb01a@tencent.com?part=3
prev parent reply other threads:[~2026-09-09 8:38 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-09 8:08 [PATCH 0/3] mm: page_counter: move hierarchical protection out of struct page_counter linuszeng via B4 Relay
2026-09-09 8:08 ` linuszeng
2026-09-09 8:08 ` [PATCH 1/3] mm: page_counter: add page_counter_protection struct and init API linuszeng via B4 Relay
2026-09-09 8:08 ` linuszeng
2026-09-09 8:23 ` sashiko-bot
2026-09-09 8:08 ` [PATCH 2/3] mm: page_counter: track protection state in page_counter_protection linuszeng via B4 Relay
2026-09-09 8:08 ` linuszeng
2026-09-09 8:08 ` [PATCH 3/3] mm: page_counter: drop protection fields from struct page_counter linuszeng via B4 Relay
2026-09-09 8:08 ` linuszeng
2026-09-09 8:38 ` sashiko-bot [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=20260909083803.B6E3C1F00A3A@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=dri-devel@lists.freedesktop.org \
--cc=hannes@cmpxchg.org \
--cc=linuszeng@tencent.com \
--cc=mkoutny@suse.com \
--cc=sashiko-reviews@lists.linux.dev \
--cc=tj@kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.