* Re: [PATCH] mm, memory_hotplug: Fix the wrong usage of N_HIGH_MEMORY
[not found] <20190320080732.14933-1-bhe@redhat.com>
@ 2019-03-20 19:12 ` Andrew Morton
2019-03-20 19:53 ` Michal Hocko
0 siblings, 1 reply; 2+ messages in thread
From: Andrew Morton @ 2019-03-20 19:12 UTC (permalink / raw)
To: Baoquan He
Cc: linux-kernel, osalvador, mhocko, david, richard.weiyang, rppt, linux-mm
On Wed, 20 Mar 2019 16:07:32 +0800 Baoquan He <bhe@redhat.com> wrote:
> In function node_states_check_changes_online(), N_HIGH_MEMORY is used
> to substitute ZONE_HIGHMEM directly. This is not right. N_HIGH_MEMORY
> always has value '3' if CONFIG_HIGHMEM=y, while ZONE_HIGHMEM's value
> is not. It depends on whether CONFIG_ZONE_DMA/CONFIG_ZONE_DMA32 are
> enabled. Obviously it's not true for CONFIG_ZONE_DMA32 on 32bit system,
> and CONFIG_ZONE_DMA is also optional.
>
> Replace it with ZONE_HIGHMEM.
>
> Fixes: 8efe33f40f3e ("mm/memory_hotplug.c: simplify node_states_check_changes_online")
What are the runtime effects of this change?
> --- a/mm/memory_hotplug.c
> +++ b/mm/memory_hotplug.c
> @@ -712,7 +712,7 @@ static void node_states_check_changes_online(unsigned long nr_pages,
> if (zone_idx(zone) <= ZONE_NORMAL && !node_state(nid, N_NORMAL_MEMORY))
> arg->status_change_nid_normal = nid;
> #ifdef CONFIG_HIGHMEM
> - if (zone_idx(zone) <= N_HIGH_MEMORY && !node_state(nid, N_HIGH_MEMORY))
> + if (zone_idx(zone) <= ZONE_HIGHMEM && !node_state(nid, N_HIGH_MEMORY))
> arg->status_change_nid_high = nid;
> #endif
> }
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] mm, memory_hotplug: Fix the wrong usage of N_HIGH_MEMORY
2019-03-20 19:12 ` [PATCH] mm, memory_hotplug: Fix the wrong usage of N_HIGH_MEMORY Andrew Morton
@ 2019-03-20 19:53 ` Michal Hocko
0 siblings, 0 replies; 2+ messages in thread
From: Michal Hocko @ 2019-03-20 19:53 UTC (permalink / raw)
To: Andrew Morton
Cc: Baoquan He, linux-kernel, osalvador, david, richard.weiyang,
rppt, linux-mm
On Wed 20-03-19 12:12:09, Andrew Morton wrote:
> On Wed, 20 Mar 2019 16:07:32 +0800 Baoquan He <bhe@redhat.com> wrote:
>
> > In function node_states_check_changes_online(), N_HIGH_MEMORY is used
> > to substitute ZONE_HIGHMEM directly. This is not right. N_HIGH_MEMORY
> > always has value '3' if CONFIG_HIGHMEM=y, while ZONE_HIGHMEM's value
> > is not. It depends on whether CONFIG_ZONE_DMA/CONFIG_ZONE_DMA32 are
> > enabled. Obviously it's not true for CONFIG_ZONE_DMA32 on 32bit system,
> > and CONFIG_ZONE_DMA is also optional.
> >
> > Replace it with ZONE_HIGHMEM.
> >
> > Fixes: 8efe33f40f3e ("mm/memory_hotplug.c: simplify node_states_check_changes_online")
>
> What are the runtime effects of this change?
There shouldn't be none. The code is just messy. The newer changelog
should make it more clear I believe.
> > --- a/mm/memory_hotplug.c
> > +++ b/mm/memory_hotplug.c
> > @@ -712,7 +712,7 @@ static void node_states_check_changes_online(unsigned long nr_pages,
> > if (zone_idx(zone) <= ZONE_NORMAL && !node_state(nid, N_NORMAL_MEMORY))
> > arg->status_change_nid_normal = nid;
> > #ifdef CONFIG_HIGHMEM
> > - if (zone_idx(zone) <= N_HIGH_MEMORY && !node_state(nid, N_HIGH_MEMORY))
> > + if (zone_idx(zone) <= ZONE_HIGHMEM && !node_state(nid, N_HIGH_MEMORY))
> > arg->status_change_nid_high = nid;
> > #endif
> > }
>
--
Michal Hocko
SUSE Labs
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2019-03-20 19:53 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <20190320080732.14933-1-bhe@redhat.com>
2019-03-20 19:12 ` [PATCH] mm, memory_hotplug: Fix the wrong usage of N_HIGH_MEMORY Andrew Morton
2019-03-20 19:53 ` Michal Hocko
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox