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]
Date:   Sat, 15 Feb 2020 08:37:53 +0800
From:   Wei Yang <richardw.yang@...ux.intel.com>
To:     Michal Hocko <mhocko@...nel.org>
Cc:     Wei Yang <richardw.yang@...ux.intel.com>,
        akpm@...ux-foundation.org, linux-mm@...ck.org,
        linux-kernel@...r.kernel.org, rientjes@...gle.com
Subject: Re: [PATCH v2] mm/vmscan.c: only adjust related kswapd cpu affinity
 when online cpu

On Fri, Feb 14, 2020 at 09:51:13AM +0100, Michal Hocko wrote:
>On Fri 14-02-20 15:33:20, Wei Yang wrote:
>> When onlining a cpu, kswapd_cpu_online() is called to adjust kswapd cpu
>> affinity.
>> 
>> Current routine does like this:
>> 
>>   a) Iterate all the numa node
>>   b) Adjust cpu affinity when node has an online cpu
>> 
>> For a) this is not necessary, since the particular online cpu belongs to
>> a particular numa node. So it is not necessary to iterate on every nodes
>> on the system. This new onlined cpu just affect kswapd cpu affinity of
>> this particular node.
>> 
>> For b) several cpumask operation is used to check whether the node has
>> an online CPU. Since at this point we are sure one of our CPU onlined,
>> we can set the cpu affinity directly to current cpumask_of_node().
>> 
>> This patch simplifies the logic by set cpu affinity of the affected
>> kswapd.
>
>How have you tested this patch?
>

I online one cpu and confirm the "cpu" is the one we just onlined.

If my understanding is correct, this is the expected behavior.

>Also this is an old code and quite convoluted but does it still work as
>inteded? I mean, I do not see any cpu offline callback to reduce the
>cpu mask as all the CPUs for the given node go offline? Wouldn't the

You are right, I didn't see the counterpart for cpu offline. This is the
question I want to ask. Seems we didn't handle it at the very beginning.

>scheduler simply go and fallback to no affinity if that happens?
>In other words what is the value of kswapd_cpu_online in the first
>place?

Some cases may this function be useful.

If we have a memory node which doesn't have any online cpu, the default
cpumask is not set. After one of the cpu online, we want to change cpu
affinity.

Or we want to add more cpu to the system, we could allow kswapd use more cpu
resources. Otherwise, kswapd would be limited to those original cpus.

>-- 
>Michal Hocko
>SUSE Labs

-- 
Wei Yang
Help you, Help me

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ