Re: [PATCH v2] lib: optimize cpumask_local_spread()

From: Shaokun Zhang
Date: Wed Nov 06 2019 - 20:48:47 EST


Hi Michal,

On 2019/11/6 17:22, Michal Hocko wrote:
> On Wed 06-11-19 16:02:29, Shaokun Zhang wrote:
>> Hi Michal,
>>
>> On 2019/11/6 15:17, Michal Hocko wrote:
>>> On Tue 05-11-19 17:33:59, Andrew Morton wrote:
>>>> On Tue, 5 Nov 2019 08:01:41 +0100 Michal Hocko <mhocko@xxxxxxxxxx> wrote:
>>>>
>>>>> On Mon 04-11-19 18:27:48, Shaokun Zhang wrote:
>>>>>> From: yuqi jin <jinyuqi@xxxxxxxxxx>
>>>>>>
>>>>>> In the multi-processor and NUMA system, I/O device may have many numa
>>>>>> nodes belonging to multiple cpus. When we get a local numa, it is
>>>>>> better to find the node closest to the local numa node, instead
>>>>>> of choosing any online cpu immediately.
>>>>>>
>>>>>> For the current code, it only considers the local NUMA node and it
>>>>>> doesn't compute the distances between different NUMA nodes for the
>>>>>> non-local NUMA nodes. Let's optimize it and find the nearest node
>>>>>> through NUMA distance. The performance will be better if it return
>>>>>> the nearest node than the random node.
>>>>>
>>>>> Numbers please
>>>>
>>>> The changelog had
>>>>
>>>> : When Parameter Server workload is tested using NIC device on Huawei
>>>> : Kunpeng 920 SoC:
>>>> : Without the patch, the performance is 22W QPS;
>>>> : Added this patch, the performance become better and it is 26W QPS.
>>>
>>> Maybe it is just me but this doesn't really tell me a lot. What is
>>> Parameter Server workload? What do I do to replicate those numbers? Is
>>
>> I will give it better description on it in next version. Since it returns
>> the nearest node from the non-local node than the random one, no harmless
>> to others, Right?
>
> Well, I am not really familiar with consumers of this API to understand
> the full consequences and that is why I keep asking. From a very

Good job, thanks you and Andrew's nice comment, at the beginning, I'm not sure
how to fix this issue correctly and it become better now.

> highlevel POV prefering CPUs on the same NUMA domain sounds like a
> reasonable thing to do.

Thanks :-)

>