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 for Android: free password hash cracker in your pocket
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <9782df45-b0da-46fa-9e0d-1c8f8b0e05d0@os.amperecomputing.com>
Date: Sat, 12 Oct 2024 10:39:45 +0800
From: Adam Li <adamli@...amperecomputing.com>
To: Saeed Mahameed <saeed@...nel.org>
Cc: leon@...nel.org, tariqt@...dia.com, davem@...emloft.net,
 edumazet@...gle.com, kuba@...nel.org, pabeni@...hat.com,
 netdev@...r.kernel.org, linux-rdma@...r.kernel.org,
 linux-kernel@...r.kernel.org, patches@...erecomputing.com,
 "Lameter, Christopher" <cl@...amperecomputing.com>,
 shijie@...amperecomputing.com, cl@...ux.com,
 Adam Li <adam.li@...erecomputing.com>
Subject: Re: [PATCH] net/mlx5: Node-aware allocation for mlx5_buf_list

Hi Saeed,

Very sorry for the slow reply.

On 9/11/2024 4:45 AM, Saeed Mahameed wrote:
> On 06 Sep 06:11, Adam Li wrote:
>> Allocation for mlx5_frag_buf.frags[i].buf is node-aware.
>> Make mlx5_frag_buf.frags allocation node-aware too.
>>
> 
> Why ? buf is accessed by the device but "frags" only accessed by CPU.
> 
Yes, this patch hopes to minimize CPU cross node memory access.
I observed 'frags' is accessed on RX path from mlx5e_alloc_rx_mpwqe().

>> Signed-off-by: Adam Li <adamli@...amperecomputing.com>
>> Reviewed-by: Christoph Lameter (Ampere) <cl@...ux.com>
>> ---
>> drivers/net/ethernet/mellanox/mlx5/core/alloc.c | 4 ++--
>> 1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/net/ethernet/mellanox/mlx5/core/alloc.c b/drivers/net/ethernet/mellanox/mlx5/core/alloc.c
>> index 6aca004e88cd..fda17b41ff17 100644
>> --- a/drivers/net/ethernet/mellanox/mlx5/core/alloc.c
>> +++ b/drivers/net/ethernet/mellanox/mlx5/core/alloc.c
>> @@ -79,8 +79,8 @@ int mlx5_frag_buf_alloc_node(struct mlx5_core_dev *dev, int size,
>>     buf->size = size;
>>     buf->npages = DIV_ROUND_UP(size, PAGE_SIZE);
>>     buf->page_shift = PAGE_SHIFT;
>> -    buf->frags = kcalloc(buf->npages, sizeof(struct mlx5_buf_list),
>> -                 GFP_KERNEL);
>> +    buf->frags = kcalloc_node(buf->npages, sizeof(struct mlx5_buf_list),
>> +                  GFP_KERNEL, node);
>>     if (!buf->frags)
>>         goto err_out;
>>
>> -- 
>> 2.25.1
>>
>>

Thanks,
-adam


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ