All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Li Peng" <pengli01@cestc.cn>, vbabka <vbabka@kernel.org>,
	hannes <hannes@cmpxchg.org>, surenb <surenb@google.com>,
	mhocko <mhocko@suse.com>,
	brendan.jackman <brendan.jackman@linux.dev>, ziy <ziy@nvidia.com>,
	akpm <akpm@linux-foundation.org>
Cc: linux-mm <linux-mm@kvack.org>
Subject: Re: [PATCH] mm: page_alloc: use correct names in comments
Date: Fri, 04 Dec 2026 11:32:17 +0000	[thread overview]
Message-ID: <sashiko-outbox-249688@kernel.org> (raw)
In-Reply-To: <202612041514435383505@cestc.cn>

Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Low] mm: struct alloc_context comment in page_alloc.h remains
  inaccurate
--

commit 13c5027028d24a5e197ab6d511a71cee69960e28
Author: Li Peng <pengli01@cestc.cn>

mm: page_alloc: use correct names in comments

This commit updates the comment above struct alloc_context to replace
__alloc_pages() with __alloc_frozen_pages_noprof() and preferred_zone
with preferred_zoneref.

> diff --git a/mm/page_alloc.h b/mm/page_alloc.h
> index 917653ae14a3d..eecf8430a9e7a 100644
> --- a/mm/page_alloc.h
> +++ b/mm/page_alloc.h
> @@ -69,10 +69,10 @@
>   * family of functions.
>   *
>   * nodemask, migratetype and highest_zoneidx are initialized only once in
> - * __alloc_pages() and then never change.
> + * __alloc_frozen_pages_noprof() and then never change.
>   *
> - * zonelist, preferred_zone and highest_zoneidx are set first in
> - * __alloc_pages() for the fast path, and might be later changed
> + * zonelist, preferred_zoneref and highest_zoneidx are set first in
> + * __alloc_frozen_pages_noprof() for the fast path, and might be later changed
>   * in __alloc_pages_slowpath(). All other functions pass the whole structure
>   * by a const pointer.
>   */

[Severity: Low]
Does this comment still misstate where struct alloc_context is initialized
and which fields are mutable?

These fields are initialized in prepare_alloc_pages() (called by both
__alloc_frozen_pages_noprof() and alloc_pages_bulk_noprof()), rather than
directly in __alloc_frozen_pages_noprof().

The two paragraphs also contradict each other on highest_zoneidx, which is
only set once in prepare_alloc_pages().

Likewise, zonelist never changes after initialization, whereas nodemask is
updated in __alloc_frozen_pages_noprof(), __alloc_pages_slowpath(), and
check_retry_cpuset().

Finally, not all other helpers pass struct alloc_context by const pointer;
check_retry_cpuset() takes a non-const pointer and clears ac->nodemask.

Updating the comment to name prepare_alloc_pages() and separate the
immutable fields (zonelist, migratetype, highest_zoneidx) from the mutable
ones would match the current implementation.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/202612041514435383505@cestc.cn?part=1


  reply	other threads:[~2026-12-04 11:32 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-04  7:14 [PATCH] mm: page_alloc: use correct names in comments Li Peng
2026-12-04 11:32 ` sashiko-bot [this message]
2026-12-04 15:14 ` Harry Yoo

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=sashiko-outbox-249688@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=akpm@linux-foundation.org \
    --cc=brendan.jackman@linux.dev \
    --cc=hannes@cmpxchg.org \
    --cc=linux-mm@kvack.org \
    --cc=mhocko@suse.com \
    --cc=pengli01@cestc.cn \
    --cc=sashiko-reviews@lists.linux.dev \
    --cc=surenb@google.com \
    --cc=vbabka@kernel.org \
    --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 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.