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:   Sun, 11 Oct 2020 12:18:03 -0700
From:   Jakub Kicinski <kuba@...nel.org>
To:     Xianting Tian <tian.xianting@....com>
Cc:     <davem@...emloft.net>, <netdev@...r.kernel.org>,
        <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] net: Avoid allocing memory on memoryless numa node

On Sun, 11 Oct 2020 12:11:40 +0800 Xianting Tian 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.
> 
> Signed-off-by: Xianting Tian <tian.xianting@....com>
> ---
>  net/core/dev.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/net/core/dev.c b/net/core/dev.c
> index 266073e30..dcb4533ef 100644
> --- a/net/core/dev.c
> +++ b/net/core/dev.c
> @@ -2590,7 +2590,7 @@ static struct xps_map *expand_xps_map(struct xps_map *map, int attr_index,
>  		new_map = kzalloc(XPS_MAP_SIZE(alloc_len), GFP_KERNEL);
>  	else
>  		new_map = kzalloc_node(XPS_MAP_SIZE(alloc_len), GFP_KERNEL,
> -				       cpu_to_node(attr_index));
> +				       local_memory_node(cpu_to_node(attr_index)));
>  	if (!new_map)
>  		return NULL;
>  

Are we going to patch all kmalloc_node() callers now to apply
local_memory_node()?  Can't the allocator take care of this?

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ