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: <87wnceu9ew.fsf@linux.ibm.com>
Date:   Fri, 15 Jul 2022 12:53:03 +0530
From:   "Aneesh Kumar K.V" <aneesh.kumar@...ux.ibm.com>
To:     Alistair Popple <apopple@...dia.com>
Cc:     linux-mm@...ck.org, akpm@...ux-foundation.org,
        Wei Xu <weixugc@...gle.com>, Huang Ying <ying.huang@...el.com>,
        Yang Shi <shy828301@...il.com>,
        Davidlohr Bueso <dave@...olabs.net>,
        Tim C Chen <tim.c.chen@...el.com>,
        Michal Hocko <mhocko@...nel.org>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        Hesham Almatary <hesham.almatary@...wei.com>,
        Dave Hansen <dave.hansen@...el.com>,
        Jonathan Cameron <Jonathan.Cameron@...wei.com>,
        Dan Williams <dan.j.williams@...el.com>,
        Johannes Weiner <hannes@...xchg.org>, jvgediya.oss@...il.com
Subject: Re: [PATCH v9 4/8] mm/demotion: Add hotplug callbacks to handle new
 numa node onlined

Alistair Popple <apopple@...dia.com> writes:

> "Aneesh Kumar K.V" <aneesh.kumar@...ux.ibm.com> writes:
>
>> If the new NUMA node onlined doesn't have a memory tier assigned,
>> the kernel adds the NUMA node to default memory tier.
>>
>> Signed-off-by: Aneesh Kumar K.V <aneesh.kumar@...ux.ibm.com>
>> ---
>>  mm/memory-tiers.c | 68 +++++++++++++++++++++++++++++++++++++++++++++++
>>  1 file changed, 68 insertions(+)
>>
>> diff --git a/mm/memory-tiers.c b/mm/memory-tiers.c
>> index 79347d4ab05e..5706ad647136 100644
>> --- a/mm/memory-tiers.c
>> +++ b/mm/memory-tiers.c
>> @@ -5,6 +5,7 @@
>>  #include <linux/slab.h>
>>  #include <linux/lockdep.h>
>>  #include <linux/moduleparam.h>
>> +#include <linux/memory.h>
>>  #include <linux/memory-tiers.h>
>>
>>  struct memory_tier {
>> @@ -130,8 +131,73 @@ int node_create_and_set_memory_tier(int node, int tier)
>>  }
>>  EXPORT_SYMBOL_GPL(node_create_and_set_memory_tier);
>>
>> +static int __node_set_memory_tier(int node, int tier)
>> +{
>> +	int ret = 0;
>> +	struct memory_tier *memtier;
>> +
>> +	memtier = __get_memory_tier_from_id(tier);
>> +	if (!memtier) {
>> +		ret = -EINVAL;
>> +		goto out;
>> +	}
>> +	node_set(node, memtier->nodelist);
>> +out:
>> +	return ret;
>> +}
>> +
>> +static int node_set_memory_tier(int node, int tier)
>
> Minor comment, but I don't like the name of this function as it doesn't
> always set the node to the given tier.
>
> Something like this would make it clearer the tier value is only used if
> the node isn't already assigned to a tier:
>
> static int init_node_memory_tier(int node, int default_tier)
>

Will rename to init_node_memory_tier()

-aneesh

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ