lkml.org 
[lkml]   [2020]   [Oct]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRE: [PATCH] bpf: Avoid allocing memory on memoryless numa node
Date
Thanks Alexei for your suggestion,
I will try to do it.

-----Original Message-----
From: Alexei Starovoitov [mailto:alexei.starovoitov@gmail.com]
Sent: Monday, October 12, 2020 9:21 AM
To: tianxianting (RD) <tian.xianting@h3c.com>
Cc: Alexei Starovoitov <ast@kernel.org>; Daniel Borkmann <daniel@iogearbox.net>; David S. Miller <davem@davemloft.net>; Jakub Kicinski <kuba@kernel.org>; Jesper Dangaard Brouer <hawk@kernel.org>; John Fastabend <john.fastabend@gmail.com>; Martin KaFai Lau <kafai@fb.com>; Song Liu <songliubraving@fb.com>; Yonghong Song <yhs@fb.com>; Andrii Nakryiko <andriin@fb.com>; KP Singh <kpsingh@chromium.org>; Network Development <netdev@vger.kernel.org>; bpf <bpf@vger.kernel.org>; LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] bpf: Avoid allocing memory on memoryless numa node

On Sat, Oct 10, 2020 at 1:55 AM Xianting Tian <tian.xianting@h3c.com> wrote:
>
> In architecture like powerpc, we can have cpus without any local
> memory attached to it. In such cases the node does not have real memory.
>
> Use local_memory_node(), which is guaranteed to have memory.
> local_memory_node is a noop in other architectures that does not
> support memoryless nodes.
...
> /* Have map->numa_node, but choose node of redirect target CPU */
> - numa = cpu_to_node(cpu);
> + numa = local_memory_node(cpu_to_node(cpu));

There are so many calls to cpu_to_node() throughout the kernel.
Are you going to convert all of them one patch at a time to the above sequence?
Why not do this CONFIG_HAVE_MEMORYLESS_NODES in cpu_to_node() instead?
and save the churn.
\
 
 \ /
  Last update: 2020-10-12 03:27    [W:0.040 / U:0.276 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site