[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20180921103029.GA15555@techadventures.net>
Date: Fri, 21 Sep 2018 12:30:29 +0200
From: Oscar Salvador <osalvador@...hadventures.net>
To: Pasha Tatashin <Pavel.Tatashin@...rosoft.com>
Cc: "akpm@...ux-foundation.org" <akpm@...ux-foundation.org>,
"mhocko@...e.com" <mhocko@...e.com>,
"dan.j.williams@...el.com" <dan.j.williams@...el.com>,
"david@...hat.com" <david@...hat.com>,
"Jonathan.Cameron@...wei.com" <Jonathan.Cameron@...wei.com>,
"yasu.isimatu@...il.com" <yasu.isimatu@...il.com>,
"malat@...ian.org" <malat@...ian.org>,
"linux-mm@...ck.org" <linux-mm@...ck.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
Oscar Salvador <osalvador@...e.de>
Subject: Re: [PATCH 4/5] mm/memory_hotplug: Simplify
node_states_check_changes_online
On Fri, Sep 21, 2018 at 12:15:53AM +0000, Pasha Tatashin wrote:
Hi Pavel,
> But what if that changes, will this function need to change as well?
That's true.
> Should not we have:
> else
> arg->status_change_nid_high = -1; ?
>
> > + } else
> > + arg->status_change_nid_high = -1;
Yes, I forgot about that else.
> I think it is simpler to have something like this:
>
> int nid = zone_to_nid(zone);
>
> arg->status_change_nid_high = -1;
> arg->status_change_nid = -1;
> arg->status_change_nid = -1;
>
> if (!node_state(nid, N_MEMORY))
> arg->status_change_nid = nid;
> 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))
> arg->status_change_nid_high = nid;
> #endif
I can write it that way, I also like it more.
I will send it in V2.
Thanks for reviewing it!
--
Oscar Salvador
SUSE L3
Powered by blists - more mailing lists