netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Adam Li <adamli@os.amperecomputing.com>
To: Eric Dumazet <edumazet@google.com>
Cc: corbet@lwn.net, davem@davemloft.net, kuba@kernel.org,
	pabeni@redhat.com, willemb@google.com, yangtiezhu@loongson.cn,
	atenart@kernel.org, kuniyu@amazon.com, wuyun.abel@bytedance.com,
	leitao@debian.org, alexander@mihalicyn.com, dhowells@redhat.com,
	paulmck@kernel.org, joel.granados@gmail.com, urezki@gmail.com,
	joel@joelfernandes.org, linux-doc@vger.kernel.org,
	linux-kernel@vger.kernel.org, netdev@vger.kernel.org,
	patches@amperecomputing.com, cl@os.amperecomputing.com,
	shijie@os.amperecomputing.com
Subject: Re: [PATCH] net: make SK_MEMORY_PCPU_RESERV tunable
Date: Wed, 28 Feb 2024 21:23:23 +0800	[thread overview]
Message-ID: <a8de785f-8cc3-4075-a5f2-259e20222dcb@os.amperecomputing.com> (raw)
In-Reply-To: <CANn89iLbA4_YdQrF+9Rmv2uVSb1HLhu0qXqCm923FCut1E78FA@mail.gmail.com>

On 2/28/2024 4:38 AM, Eric Dumazet wrote:

>>
>> sk_prot->memory_allocated points to global atomic variable:
>> atomic_long_t tcp_memory_allocated ____cacheline_aligned_in_smp;
>>
>> If increasing the per-cpu cache size from 1MB to e.g. 16MB,
>> changes to sk->sk_prot->memory_allocated can be further reduced.
>> Performance may be improved on system with many cores.
> 
> This looks good, do you have any performance numbers to share ?

I ran localhost memcached test on system with 320 CPU threads,
perf shows 4% cycles spent in __sk_mem_raise_allocated() -->sk_memory_allocated().
If increasing SK_MEMORY_PCPU_RESERV to 16MB, perf cycles spent in
__sk_mem_raise_allocated() drops to 0.4%.

Thanks,
-adam


  parent reply	other threads:[~2024-02-28 13:21 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-26  2:24 [PATCH] net: make SK_MEMORY_PCPU_RESERV tunable Adam Li
2024-02-26 16:01 ` Lameter, Christopher
2024-02-27 20:38 ` Eric Dumazet
2024-02-27 23:08   ` Lameter, Christopher
2024-02-28  1:13     ` Jakub Kicinski
2024-02-28  9:32     ` Eric Dumazet
2024-02-28 13:23   ` Adam Li [this message]
2024-02-28 13:46     ` Eric Dumazet
2024-03-06 17:01       ` Lameter, Christopher
2024-03-06 17:28         ` Eric Dumazet
2024-02-28  9:30 ` patchwork-bot+netdevbpf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=a8de785f-8cc3-4075-a5f2-259e20222dcb@os.amperecomputing.com \
    --to=adamli@os.amperecomputing.com \
    --cc=alexander@mihalicyn.com \
    --cc=atenart@kernel.org \
    --cc=cl@os.amperecomputing.com \
    --cc=corbet@lwn.net \
    --cc=davem@davemloft.net \
    --cc=dhowells@redhat.com \
    --cc=edumazet@google.com \
    --cc=joel.granados@gmail.com \
    --cc=joel@joelfernandes.org \
    --cc=kuba@kernel.org \
    --cc=kuniyu@amazon.com \
    --cc=leitao@debian.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=patches@amperecomputing.com \
    --cc=paulmck@kernel.org \
    --cc=shijie@os.amperecomputing.com \
    --cc=urezki@gmail.com \
    --cc=willemb@google.com \
    --cc=wuyun.abel@bytedance.com \
    --cc=yangtiezhu@loongson.cn \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).