netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: edumazet@google.com
Cc: netdev@vger.kernel.org, eric.dumazet@gmail.com,
	soheil@google.com, arjunroy@google.com
Subject: Re: [PATCH net-next] selftests: net: avoid ptl lock contention in tcp_mmap
Date: Sat, 16 Nov 2019 13:13:09 -0800 (PST)	[thread overview]
Message-ID: <20191116.131309.972370574405253412.davem@davemloft.net> (raw)
In-Reply-To: <20191116015554.51077-1-edumazet@google.com>

From: Eric Dumazet <edumazet@google.com>
Date: Fri, 15 Nov 2019 17:55:54 -0800

> tcp_mmap is used as a reference program for TCP rx zerocopy,
> so it is important to point out some potential issues.
> 
> If multiple threads are concurrently using getsockopt(...
> TCP_ZEROCOPY_RECEIVE), there is a chance the low-level mm
> functions compete on shared ptl lock, if vma are arbitrary placed.
> 
> Instead of letting the mm layer place the chunks back to back,
> this patch enforces an alignment so that each thread uses
> a different ptl lock.
> 
> Performance measured on a 100 Gbit NIC, with 8 tcp_mmap clients
> launched at the same time :
> 
> $ for f in {1..8}; do ./tcp_mmap -H 2002:a05:6608:290:: & done
> 
> In the following run, we reproduce the old behavior by requesting no alignment :
> 
> $ tcp_mmap -sz -C $((128*1024)) -a 4096
 ...
> New behavior (automatic alignment based on Hugepagesize),
> we can see the system overhead being dramatically reduced.
> 
> $ tcp_mmap -sz -C $((128*1024))
 ...
> Signed-off-by: Eric Dumazet <edumazet@google.com>

Applied, thanks Eric.

      parent reply	other threads:[~2019-11-16 21:13 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-16  1:55 [PATCH net-next] selftests: net: avoid ptl lock contention in tcp_mmap Eric Dumazet
2019-11-16  2:07 ` Soheil Hassas Yeganeh
2019-11-16 21:13 ` David Miller [this message]

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=20191116.131309.972370574405253412.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=arjunroy@google.com \
    --cc=edumazet@google.com \
    --cc=eric.dumazet@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=soheil@google.com \
    /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).