From: Pasha Tatashin <Pavel.Tatashin@microsoft.com>
To: Oscar Salvador <osalvador@techadventures.net>
Cc: "akpm@linux-foundation.org" <akpm@linux-foundation.org>,
"mhocko@suse.com" <mhocko@suse.com>,
"vbabka@suse.cz" <vbabka@suse.cz>,
"sfr@canb.auug.org.au" <sfr@canb.auug.org.au>,
"iamjoonsoo.kim@lge.com" <iamjoonsoo.kim@lge.com>,
"linux-mm@kvack.org" <linux-mm@kvack.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
Oscar Salvador <osalvador@suse.de>
Subject: Re: [PATCH] mm/page_alloc: Clean up check_for_memory
Date: Fri, 31 Aug 2018 14:04:59 +0000 [thread overview]
Message-ID: <b2fea9ef-84e9-84dc-c847-5b944a8d832f@microsoft.com> (raw)
In-Reply-To: <20180831122401.GA2123@techadventures.net>
On 8/31/18 8:24 AM, Oscar Salvador wrote:
> On Thu, Aug 30, 2018 at 01:55:29AM +0000, Pasha Tatashin wrote:
>> I would re-write the above function like this:
>> static void check_for_memory(pg_data_t *pgdat, int nid)
>> {
>> enum zone_type zone_type;
>>
>> for (zone_type = 0; zone_type < ZONE_MOVABLE; zone_type++) {
>> if (populated_zone(&pgdat->node_zones[zone_type])) {
>> node_set_state(nid, zone_type <= ZONE_NORMAL ?
>> N_NORMAL_MEMORY: N_HIGH_MEMORY);
>> break;
>> }
>> }
>> }
>
> Hi Pavel,
>
> the above would not work fine.
> You set either N_NORMAL_MEMORY or N_HIGH_MEMORY, but a node can have both
> types of memory at the same time (on CONFIG_HIGHMEM systems).
>
> N_HIGH_MEMORY stands for regular or high memory
> while N_NORMAL_MEMORY stands only for regular memory,
> that is why we set it only in case the zone is <= ZONE_NORMAL.
Hi Oscar,
Are you saying the code that is in mainline is broken? Because we set
node_set_state(nid, N_NORMAL_MEMORY); even on node with N_HIGH_MEMORY:
6826 if (N_NORMAL_MEMORY != N_HIGH_MEMORY &&
6827 zone_type <= ZONE_NORMAL)
6828 node_set_state(nid, N_NORMAL_MEMORY);
Thank you,
Pavel
next prev parent reply other threads:[~2018-08-31 14:05 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-08-28 21:01 Oscar Salvador
2018-08-28 21:35 ` Andrew Morton
2018-08-29 20:34 ` Oscar Salvador
2018-08-30 1:55 ` Pasha Tatashin
2018-08-31 12:24 ` Oscar Salvador
2018-08-31 14:04 ` Pasha Tatashin [this message]
2018-08-31 20:45 ` Oscar Salvador
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=b2fea9ef-84e9-84dc-c847-5b944a8d832f@microsoft.com \
--to=pavel.tatashin@microsoft.com \
--cc=akpm@linux-foundation.org \
--cc=iamjoonsoo.kim@lge.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mhocko@suse.com \
--cc=osalvador@suse.de \
--cc=osalvador@techadventures.net \
--cc=sfr@canb.auug.org.au \
--cc=vbabka@suse.cz \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome