netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Hannes Frederic Sowa <hannes@stressinduktion.org>
To: Dan Ballard <dan@mindstab.net>,
	Lennart Poettering <lennart@poettering.net>,
	kay.sievers@vrfy.org, Arnd Bergmann <arnd@arndb.de>,
	"David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Eliezer Tamir <eliezer.tamir@linux.intel.com>,
	Neil Horman <nhorman@tuxdriver.com>,
	Li Zefan <lizefan@huawei.com>,
	linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org,
	netdev@vger.kernel.org
Subject: Re: [PATCH 1/1] Per socket value for max datagram queue length
Date: Wed, 22 Jan 2014 16:32:35 +0100	[thread overview]
Message-ID: <20140122153235.GC7269@order.stressinduktion.org> (raw)
In-Reply-To: <20140122152036.GB7269@order.stressinduktion.org>

On Wed, Jan 22, 2014 at 04:20:36PM +0100, Hannes Frederic Sowa wrote:
> On Wed, Jan 22, 2014 at 07:11:20AM -0800, Dan Ballard wrote:
> > diff --git a/net/core/sock.c b/net/core/sock.c
> > index 5393b4b..1ff69d1 100644
> > --- a/net/core/sock.c
> > +++ b/net/core/sock.c
> > @@ -915,6 +915,10 @@ set_rcvbuf:
> >                                          sk->sk_max_pacing_rate);
> >                 break;
> > 
> > +       case SO_MAX_DGRAM_QLEN:
> > +               sk->sk_max_ack_backlog = val;
> > +               break;
> > +
> 
> Shouldn't the backlog be capped for unprivileged users to some configurable
> value? I even think that max_dgram_qlen should be the upper bound.
> 
> I guess it is not that serious as socket read accounting does account all
> packets which sit in the backlog queue.

Just a follow-up:

sk_max_ack_backlog is also responsible for limiting the af_unix
dgram queues.  Currently there is no socket accounting for the read
side of those unix dgram sockets. I tried to fix this once here,
http://patchwork.ozlabs.org/patch/231032/, but until that is done we
depend on max_dgram_qlen to limit those queues at all.

I hope I can get back to this patch anytime soon, as it solves the problem
that a bidirectional protocol ping-ponging with a dgram server socket
and not fetching its messages from the backlog queue can bring a server
to halt because it doesn't have any send space on the socket anymore.

Greetings,

  Hannes

  reply	other threads:[~2014-01-22 15:32 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-22 15:11 [PATCH 1/1] Per socket value for max datagram queue length Dan Ballard
2014-01-22 15:20 ` Hannes Frederic Sowa
2014-01-22 15:32   ` Hannes Frederic Sowa [this message]
2014-01-22 15:30 ` Eric Dumazet
2014-01-22 15:32 ` Daniel Borkmann

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=20140122153235.GC7269@order.stressinduktion.org \
    --to=hannes@stressinduktion.org \
    --cc=arnd@arndb.de \
    --cc=dan@mindstab.net \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=eliezer.tamir@linux.intel.com \
    --cc=kay.sievers@vrfy.org \
    --cc=lennart@poettering.net \
    --cc=linux-arch@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lizefan@huawei.com \
    --cc=netdev@vger.kernel.org \
    --cc=nhorman@tuxdriver.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).