* [PATCH] mm: page_alloc: use correct names in comments
@ 2026-12-04 7:14 Li Peng
2026-12-04 11:32 ` sashiko-bot
2026-12-04 15:14 ` Harry Yoo
0 siblings, 2 replies; 3+ messages in thread
From: Li Peng @ 2026-12-04 7:14 UTC (permalink / raw)
To: vbabka, hannes, surenb, mhocko, brendan.jackman, ziy, akpm
Cc: linux-mm, pengli01
__alloc_pages() should be __alloc_frozen_pages_noprof().
preferred_zone should be preferred_zoneref.
Signed-off-by: Li Peng <pengli01@cestc.cn>
---
mm/page_alloc.h | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/mm/page_alloc.h b/mm/page_alloc.h
index 917653ae14a3..eecf8430a9e7 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.
*/
--
2.53.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] mm: page_alloc: use correct names in comments
2026-12-04 7:14 [PATCH] mm: page_alloc: use correct names in comments Li Peng
@ 2026-12-04 11:32 ` sashiko-bot
2026-12-04 15:14 ` Harry Yoo
1 sibling, 0 replies; 3+ messages in thread
From: sashiko-bot @ 2026-12-04 11:32 UTC (permalink / raw)
To: Li Peng, vbabka, hannes, surenb, mhocko, brendan.jackman, ziy,
akpm
Cc: linux-mm
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
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] mm: page_alloc: use correct names in comments
2026-12-04 7:14 [PATCH] mm: page_alloc: use correct names in comments Li Peng
2026-12-04 11:32 ` sashiko-bot
@ 2026-12-04 15:14 ` Harry Yoo
1 sibling, 0 replies; 3+ messages in thread
From: Harry Yoo @ 2026-12-04 15:14 UTC (permalink / raw)
To: Li Peng
Cc: vbabka, hannes, surenb, mhocko, brendan.jackman, ziy, akpm,
linux-mm
On Fri, Dec 04, 2026 at 03:14:43PM +0800, Li Peng wrote:
> __alloc_pages() should be __alloc_frozen_pages_noprof().
> preferred_zone should be preferred_zoneref.
>
> Signed-off-by: Li Peng <pengli01@cestc.cn>
>
> ---
> mm/page_alloc.h | 6 +++---
> 1 file changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/mm/page_alloc.h b/mm/page_alloc.h
> index 917653ae14a3..eecf8430a9e7 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
I'm not sure this improves the documentation.
> * in __alloc_pages_slowpath(). All other functions pass the whole structure
> * by a const pointer.
> */
> --
> 2.53.0
>
--
Cheers,
Harry / Hyeonggon
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-12-04 15:15 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-12-04 7:14 [PATCH] mm: page_alloc: use correct names in comments Li Peng
2026-12-04 11:32 ` sashiko-bot
2026-12-04 15:14 ` Harry Yoo
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox