lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <b2fea9ef-84e9-84dc-c847-5b944a8d832f@microsoft.com>
Date:   Fri, 31 Aug 2018 14:04:59 +0000
From:   Pasha Tatashin <Pavel.Tatashin@...rosoft.com>
To:     Oscar Salvador <osalvador@...hadventures.net>
CC:     "akpm@...ux-foundation.org" <akpm@...ux-foundation.org>,
        "mhocko@...e.com" <mhocko@...e.com>,
        "vbabka@...e.cz" <vbabka@...e.cz>,
        "sfr@...b.auug.org.au" <sfr@...b.auug.org.au>,
        "iamjoonsoo.kim@....com" <iamjoonsoo.kim@....com>,
        "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] mm/page_alloc: Clean up check_for_memory



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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ