From: Paolo Abeni <pabeni@redhat.com>
To: Eric Dumazet <eric.dumazet@gmail.com>
Cc: Edward Cree <ecree@solarflare.com>,
netdev@vger.kernel.org, "David S. Miller" <davem@davemloft.net>,
James Morris <jmorris@namei.org>,
Trond Myklebust <trond.myklebust@primarydata.com>,
Alexander Duyck <aduyck@mirantis.com>,
Daniel Borkmann <daniel@iogearbox.net>,
Eric Dumazet <edumazet@google.com>,
Tom Herbert <tom@herbertland.com>,
Hannes Frederic Sowa <hannes@stressinduktion.org>,
linux-nfs@vger.kernel.org
Subject: Re: [PATCH net-next 2/3] udp: implement memory accounting helpers
Date: Fri, 23 Sep 2016 11:56:05 +0200 [thread overview]
Message-ID: <1474624565.9845.20.camel@redhat.com> (raw)
In-Reply-To: <1474576448.28155.7.camel@edumazet-glaptop3.roam.corp.google.com>
On Thu, 2016-09-22 at 13:34 -0700, Eric Dumazet wrote:
> On Thu, 2016-09-22 at 22:27 +0200, Paolo Abeni wrote:
> > On Thu, 2016-09-22 at 09:30 -0700, Eric Dumazet wrote:
> > > On Thu, 2016-09-22 at 18:14 +0200, Paolo Abeni wrote:
> > >
> > > > I think that the idea behind using atomic ops directly on
> > > > sk_forward_alloc is to avoid adding other fields to the udp_socket.
> > > >
> > > > If we can add some fields to the udp_sock structure, the schema proposed
> > > > in this patch should fit better (modulo bugs ;-), always requiring a
> > > > single atomic operation at memory reclaiming time and at memory
> > > > allocation time.
> > >
> > > But do we want any additional atomic to begin with ?
> > >
> > > Given typical number of UDP sockets on a host, we could reserve/forward
> > > alloc at socket creation time, and when SO_RCVBUF is changed.
> >
> > That would be very efficient and would probably work on most scenario,
> > but if/when the system will reach udp memory pressure things will be
> > very bad: forward allocation on open() will fail and nobody will be able
> > to create any new udp socket, right ?
> >
>
> No, we could allow one page per socket (udp_mem[0]) and applications
> would still work.
>
> TCP has the notion of memory pressure, and behaves roughly the same in
> this case (one skb is allowed to be received)
>
> The other (fat) sockets could notice udp_memory_pressure is set and
> start reclaiming their forward allocations for other sockets.
I agree, that would work. Anyway I think it will more invasive than the
proposed code, after the currently ongoing rework. With the above, on
memory pressure, reclaim will be needed on dequeue, and scheduling will
still needed even on enqueue.
The overall behavior of the two approach will be similar: lazy
reclaiming under memory pressure or on sk closing, and rare memory
scheduling.
> Anyway, just an idea.
Any comments are always very appreciated!
Paolo
next prev parent reply other threads:[~2016-09-23 9:56 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-09-21 17:23 [PATCH net-next 0/3] udp: refactor memory accounting Paolo Abeni
2016-09-21 17:23 ` [PATCH net-next 1/3] net/socket: factor out helpers for memory and queue manipulation Paolo Abeni
[not found] ` <cover.1474477902.git.pabeni-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2016-09-21 17:23 ` [PATCH net-next 2/3] udp: implement memory accounting helpers Paolo Abeni
2016-09-21 23:31 ` Eric Dumazet
2016-09-22 10:33 ` Paolo Abeni
2016-09-22 15:21 ` Edward Cree
[not found] ` <589839b3-5930-2527-b0a3-315be254a175-s/n/eUQHGBpZroRs9YW3xA@public.gmane.org>
2016-09-22 16:14 ` Paolo Abeni
2016-09-22 16:30 ` Eric Dumazet
2016-09-22 20:27 ` Paolo Abeni
2016-09-22 20:34 ` Eric Dumazet
2016-09-22 20:37 ` Eric Dumazet
2016-09-23 9:56 ` Paolo Abeni [this message]
2016-09-21 17:23 ` [PATCH net-next 3/3] udp: use it's own memory accounting schema Paolo Abeni
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=1474624565.9845.20.camel@redhat.com \
--to=pabeni@redhat.com \
--cc=aduyck@mirantis.com \
--cc=daniel@iogearbox.net \
--cc=davem@davemloft.net \
--cc=ecree@solarflare.com \
--cc=edumazet@google.com \
--cc=eric.dumazet@gmail.com \
--cc=hannes@stressinduktion.org \
--cc=jmorris@namei.org \
--cc=linux-nfs@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=tom@herbertland.com \
--cc=trond.myklebust@primarydata.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).