From: Jesper Dangaard Brouer <brouer@redhat.com>
To: Saeed Mahameed <saeedm@dev.mellanox.co.il>
Cc: brouer@redhat.com, Tom Herbert <tom@herbertland.com>,
Saeed Mahameed <saeedm@mellanox.com>,
netdev <netdev@vger.kernel.org>,
Tariq Toukan <tariqt@mellanox.com>, Davem <davem@davemloft.net>,
Eric Dumazet <eric.dumazet@gmail.com>
Subject: Re: [PATCH net] net/mlx5e: Do not recycle pages from emergency reserve
Date: Mon, 23 Jan 2017 09:39:40 +0100 [thread overview]
Message-ID: <20170123093940.5d69539e@redhat.com> (raw)
In-Reply-To: <CALzJLG9JEorLwV48H3m0vQ1+VDnpYbKhiBoUw+WW-JFouJoj1g@mail.gmail.com>
On Sat, 21 Jan 2017 22:31:26 +0200 Saeed Mahameed <saeedm@dev.mellanox.co.il> wrote:
> > My previous measurements show approx 20℅ speedup on a UDP test with delivery
> > to remote CPU.
> >
> > Removing the cache would of cause be a good usecase for speeding up the page
> > allocator (PCP). Which Mel Gorman and me are working on. AFAIK current page
> > order0 cost 240 cycles. Mel have reduced til to 180, and without NUMA 150
> > cycles. And with bulking this can be amortized to 80 cycles.
> >
>
> Are you trying to say that we won't need the cache if you manage to
> deliver those optimizations ?
These page alloc optimization are good, but not fast-enough to replace
your cache. Maybe I can improve it further, but it will be very hard
to compete with a recycle cache (it can skip many checks the page alloc
need, as it knows the page state).
Said in another way, the gap will be significantly smaller, and you
will not see a big boost from using this cache.
BUT there are other advantages of using a guaranteed recycle pool
facility (like the page_pool). Namely, (1) DMA-overhead: keeping page
DMA mapped to counter DMA+IOMMU overhead, (2) RX-zero-copy: opens up
for a software memory model solution for pre-VMA-mapping pages to
userspace (See: [1] for argument how this avoids leaking kernel mem,
but only expose/leak packet-data mem)
> can you compare those optimizations with the page_frag_cache from
> dev_alloc_skb ?
IHMO the page_frag_cache is indirectly a bulk page allocator facility,
which is limiting the number of times the page allocator is called, and
thus amortize the cost of talking to the page allocator. Performance
wise, it is likely comparable to your page cache, and likely faster
than the 80 cycles order0-bulking.
BUT we generally worry about using these 32K pages, as it opens a
window for attackers pinning down memory.
[1] https://prototype-kernel.readthedocs.io/en/latest/vm/page_pool/design/memory_model_nic.html
--
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:[~2017-01-23 8:39 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-01-19 7:03 [PATCH net] net/mlx5e: Do not recycle pages from emergency reserve Eric Dumazet
2017-01-19 19:14 ` Saeed Mahameed
2017-01-19 19:25 ` Eric Dumazet
2017-01-19 19:39 ` Saeed Mahameed
2017-01-21 18:09 ` Tom Herbert
[not found] ` <CAPe+=50xs=MMqxHPgTiGa3qytL7633Cygf_vBWuAuq=ceLyacg@mail.gmail.com>
2017-01-21 19:26 ` Eric Dumazet
2017-01-23 9:14 ` Jesper Dangaard Brouer
2017-01-24 9:21 ` Saeed Mahameed
2017-01-21 20:31 ` Saeed Mahameed
2017-01-22 17:50 ` Tom Herbert
2017-01-24 9:29 ` Saeed Mahameed
2017-01-23 8:39 ` Jesper Dangaard Brouer [this message]
2017-01-23 15:45 ` David Miller
2017-01-22 18:09 ` Tom Herbert
2017-01-20 10:28 ` Saeed Mahameed
2017-01-20 17:43 ` David Miller
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=20170123093940.5d69539e@redhat.com \
--to=brouer@redhat.com \
--cc=davem@davemloft.net \
--cc=eric.dumazet@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=saeedm@dev.mellanox.co.il \
--cc=saeedm@mellanox.com \
--cc=tariqt@mellanox.com \
--cc=tom@herbertland.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).