From: Jesper Dangaard Brouer <brouer@redhat.com>
To: Matthew Wilcox <willy@infradead.org>
Cc: brouer@redhat.com, Alexander Duyck <alexander.duyck@gmail.com>,
Alexander Duyck <alexander.h.duyck@intel.com>,
linux-mm@vger.kernel.org, Netdev <netdev@vger.kernel.org>,
Matthew Wilcox <mawilcox@microsoft.com>,
Paolo Abeni <pabeni@redhat.com>
Subject: Re: [RFC 2/2] page_frag_cache: Store metadata in struct page
Date: Mon, 19 Mar 2018 09:27:18 +0100 [thread overview]
Message-ID: <20180319092718.071f4801@redhat.com> (raw)
In-Reply-To: <20180316210500.GH27498@bombadil.infradead.org>
On Fri, 16 Mar 2018 14:05:00 -0700 Matthew Wilcox <willy@infradead.org> wrote:
> I understand your concern about the cacheline bouncing between the
> freeing and allocating CPUs. Is cross-CPU freeing a frequent
> occurrence? From looking at its current usage, it seemed like the
> allocation and freeing were usually on the same CPU.
While we/the-network-stack in many cases try to alloc and free on the
same CPU. Then, in practical default setups it will be common case to
alloc and free on different CPUs. The scheduler moves processes
between CPUs, and irqbalance change which CPU does the DMA TX
completion (in case of forwarding). I usually pin/align the NIC IRQs
manually (via proc smp_affinity_list) and manually pin/taskset the
userspace process (and makes sure to test both local/remote alloc/free
cases when benchmarking).
I used to recommend people to pin the RX userspace process to the NAPI
RX CPU, but based on my benchmarking I no longer do that. At least for
UDP (after Paolo Abeni's optimizations) then there is a significant
performance advantage of running UDP receiver on another CPU (in the
range from 800Kpps to 2200Kpps). (Plus it avoids the softirq starvation
problem).
Mellanox even have a perf tuning tool, that explicit moves the DMA
TX-completion IRQ to run on another CPU than RX. Thus, I assume that
they have evidence/benchmarks that show this as an advantage.
More recently I implemented XDP cpumap redirect. Which explicitly
moves the raw page/frame to be handled on a remote CPU. Mostly to move
another MM alloc/free overhead away from the RX-CPU, which is the SKB
alloc/free overhead. I'm working on a XDP return frame API, but for
now, performance depend on the page_frag recycle tricks (although for
the sake of accuracy it doesn't directly depend on page_frag_cache API,
but similar pagecnt_bias tricks).
--
Best regards,
Jesper Dangaard Brouer
MSc.CS, Principal Kernel Engineer at Red Hat
LinkedIn: http://www.linkedin.com/in/brouer
next prev parent reply other threads:[~2018-03-19 8:27 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-03-15 19:53 [RFC 0/2] Shrink page_frag_cache Matthew Wilcox
2018-03-15 19:53 ` [RFC 1/2] mm: Use page->mapping to indicate pfmemalloc Matthew Wilcox
2018-03-15 19:53 ` [RFC 2/2] page_frag_cache: Store metadata in struct page Matthew Wilcox
2018-03-15 21:03 ` Eric Dumazet
2018-03-15 21:26 ` Alexander Duyck
2018-03-16 21:05 ` Matthew Wilcox
2018-03-16 21:32 ` Eric Dumazet
2018-03-19 8:27 ` Jesper Dangaard Brouer [this message]
2018-03-17 20:54 ` David Miller
2018-03-17 2:17 ` [page_frag_cache] 47b0eaa4b5: BUG:unable_to_handle_kernel kernel test robot
2018-03-17 2:17 ` kernel test robot
2018-03-20 20:47 ` [RFC 2/2] page_frag_cache: Store metadata in struct page Alexander Duyck
2018-03-15 20:02 ` [RFC 0/2] Shrink page_frag_cache Alexander Duyck
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=20180319092718.071f4801@redhat.com \
--to=brouer@redhat.com \
--cc=alexander.duyck@gmail.com \
--cc=alexander.h.duyck@intel.com \
--cc=linux-mm@vger.kernel.org \
--cc=mawilcox@microsoft.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=willy@infradead.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.