netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Eric Dumazet <edumazet@google.com>
To: "Lameter, Christopher" <cl@os.amperecomputing.com>
Cc: Adam Li <adamli@os.amperecomputing.com>,
	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, shijie@os.amperecomputing.com
Subject: Re: [PATCH] net: make SK_MEMORY_PCPU_RESERV tunable
Date: Wed, 28 Feb 2024 10:32:47 +0100	[thread overview]
Message-ID: <CANn89iKFPjSQhXRcyb+EDQiH0xJG1WdWVGXXLK6iOcMpM2zKyQ@mail.gmail.com> (raw)
In-Reply-To: <bc168824-25dd-7541-1a34-38b1a3c00489@os.amperecomputing.com>

On Wed, Feb 28, 2024 at 12:08 AM Lameter, Christopher
<cl@os.amperecomputing.com> wrote:
>
> On Tue, 27 Feb 2024, 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 ?
> >
> > On a host with 384 threads, 384*16 ->  6 GB of memory.
>
> Those things also come with corresponding memories of a couple of TB...
>
> > With this kind of use, we might need a shrinker...
>
> Yes. No point of keeping the buffers around if the core stops doing
> networking. But to be done at times when there is no contention please.

I yet have to see the 'contention'  ?

I usually see one on the zone spinlock or memcg ones when
allocating/freeing pages, not on the tcp_memory_allocated atomic

We can add caches for sure, we had a giant one before my patch, and
this was a disaster really,
for workloads with millions of TCP sockets.

  parent reply	other threads:[~2024-02-28  9:33 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 [this message]
2024-02-28 13:23   ` Adam Li
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=CANn89iKFPjSQhXRcyb+EDQiH0xJG1WdWVGXXLK6iOcMpM2zKyQ@mail.gmail.com \
    --to=edumazet@google.com \
    --cc=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=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).