From: Mike Rapoport <rppt@kernel.org>
To: Sang-Heon Jeon <ekffu200098@gmail.com>
Cc: Andrew Morton <akpm@linux-foundation.org>, linux-mm@kvack.org
Subject: Re: [PATCH] memblock: use for_each_zone() in reset_all_zones_managed_pages()
Date: Mon, 14 Sep 2026 11:20:17 +0300 [thread overview]
Message-ID: <aqeuQZwr3flydCRk@kernel.org> (raw)
In-Reply-To: <CABFDxMGHwUrssk09-2j0yoQh9AVHTqoJDmJw3o8k10astr+bsg@mail.gmail.com>
On Thu, Sep 10, 2026 at 11:35:41PM +0900, Sang-Heon Jeon wrote:
> On Thu, Sep 10, 2026 at 9:19 PM Sang-Heon Jeon <ekffu200098@gmail.com> wrote:
> >
> > On Thu, Sep 10, 2026 at 7:13 PM Mike Rapoport <rppt@kernel.org> wrote:
> > >
> > > On 2026-09-10 12:58 +0300, Mike Rapoport wrote:
> > > > On Wed, 09 Sep 2026 01:57:32 +0900, Sang-Heon Jeon wrote:
> > > > > memblock: use for_each_zone() in reset_all_zones_managed_pages()
> > > >
> > > > Applied to for-next branch of memblock.git tree, thanks!
> > > >
> > > > [1/1] memblock: use for_each_zone() in reset_all_zones_managed_pages()
> > > > commit: 0876b2d8794913c867a1bb0dc3fd22ea1c5f0a95
> > > >
> > > > tree: https://git.kernel.org/pub/scm/linux/kernel/git/rppt/memblock
> > > > branch: for-next
> > >
> > > Hmm, I was too hasty.
> > > This breaks mmemblock tests, so I dropped it for now.
> >
> > Sorry for the noise. I missed it. I will keep it in mind next time.
> > Just give me a second to check.
>
> With the below fixes, tests will be fine again. Is it okay to send the
> v2 patchset with below fixes?
memblock tests do not cover late parts of mm initialization, I believe it
would be fine to just define for_each_zone() to a nop.
> diff --git a/tools/testing/memblock/linux/mmzone.h
> b/tools/testing/memblock/linux/mmzone.h
> index 8d934ff5b080..631fe07923e7 100644
> --- a/tools/testing/memblock/linux/mmzone.h
> +++ b/tools/testing/memblock/linux/mmzone.h
> @@ -7,13 +7,20 @@
>
> struct pglist_data *first_online_pgdat(void);
> struct pglist_data *next_online_pgdat(struct pglist_data *pgdat);
> +struct zone *next_zone(struct zone *zone);
>
> #define for_each_online_pgdat(pgdat) \
> for (pgdat = first_online_pgdat(); \
> pgdat; \
> pgdat = next_online_pgdat(pgdat))
>
> +#define for_each_zone(zone) \
> + for (zone = (first_online_pgdat())->node_zones; \
> + zone; \
> + zone = next_zone(zone))
> +
> enum zone_type {
> + ZONE_NORMAL,
> __MAX_NR_ZONES
> };
>
> @@ -27,6 +34,7 @@ enum zone_type {
> #define pageblock_start_pfn(pfn) ALIGN_DOWN((pfn), pageblock_nr_pages)
>
> struct zone {
> + struct pglist_data *zone_pgdat;
> atomic_long_t managed_pages;
> };
>
> diff --git a/tools/testing/memblock/mmzone.c b/tools/testing/memblock/mmzone.c
> index e719450f81cb..e73848bdc8d6 100644
> --- a/tools/testing/memblock/mmzone.c
> +++ b/tools/testing/memblock/mmzone.c
> @@ -1,9 +1,15 @@
> // SPDX-License-Identifier: GPL-2.0-or-later
> #include <linux/mmzone.h>
>
> +static pg_data_t dummy_pgdat = {
> + .node_zones = {
> + [0 ... MAX_NR_ZONES - 1] = { .zone_pgdat = &dummy_pgdat },
> + },
> +};
> +
> struct pglist_data *first_online_pgdat(void)
> {
> - return NULL;
> + return &dummy_pgdat;
> }
>
> struct pglist_data *next_online_pgdat(struct pglist_data *pgdat)
> @@ -11,6 +17,22 @@ struct pglist_data *next_online_pgdat(struct
> pglist_data *pgdat)
> return NULL;
> }
>
> +struct zone *next_zone(struct zone *zone)
> +{
> + pg_data_t *pgdat = zone->zone_pgdat;
> +
> + if (zone < pgdat->node_zones + MAX_NR_ZONES - 1)
> + zone++;
> + else {
> + pgdat = next_online_pgdat(pgdat);
> + if (pgdat)
> + zone = pgdat->node_zones;
> + else
> + zone = NULL;
> + }
> + return zone;
> +}
> +
> void atomic_long_set(atomic_long_t *v, long i)
> {
> }
>
> > > > --
> > > > Sincerely yours,
> > > > Mike.
> > > >
> > > >
> > > >
> > > >
> > > >
> > >
> > >
> >
> > Best regards
> > Sang-Heon Jeon
>
> Best regards,
> Sang-Heon Jeon
--
Sincerely yours,
Mike.
next prev parent reply other threads:[~2026-09-14 8:20 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-08 16:57 [PATCH] memblock: use for_each_zone() in reset_all_zones_managed_pages() Sang-Heon Jeon
2026-09-10 9:58 ` Mike Rapoport
2026-09-10 10:13 ` Mike Rapoport
2026-09-10 12:19 ` Sang-Heon Jeon
2026-09-10 14:35 ` Sang-Heon Jeon
2026-09-14 8:20 ` Mike Rapoport [this message]
2026-09-15 7:46 ` Sang-Heon Jeon
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=aqeuQZwr3flydCRk@kernel.org \
--to=rppt@kernel.org \
--cc=akpm@linux-foundation.org \
--cc=ekffu200098@gmail.com \
--cc=linux-mm@kvack.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.