From: Jens Axboe <jens.axboe@oracle.com>
To: Evgeniy Polyakov <johnpol@2ka.mipt.ru>
Cc: David Miller <davem@davemloft.net>, netdev@vger.kernel.org
Subject: Re: [PATCH][RFC] network splice receive
Date: Fri, 8 Jun 2007 11:04:40 +0200 [thread overview]
Message-ID: <20070608090439.GK7341@kernel.dk> (raw)
In-Reply-To: <20070608085620.GC11488@2ka.mipt.ru>
On Fri, Jun 08 2007, Evgeniy Polyakov wrote:
> On Fri, Jun 08, 2007 at 10:38:53AM +0200, Jens Axboe (jens.axboe@oracle.com) wrote:
> > On Fri, Jun 08 2007, David Miller wrote:
> > > From: Jens Axboe <jens.axboe@oracle.com>
> > > Date: Fri, 8 Jun 2007 09:48:24 +0200
> > >
> > > > Perhaps it's possible to solve this at a different level - can we hang
> > > > on to the skb until the pipe buffer has been consumed, and prevent reuse
> > > > that way? Then we don't have to care what backing the skb has, as long
> > > > as it (and its data) isn't being reused until we drop the reference to
> > > > it in sock_pipe_buf_release().
> > >
> > > Depending upon whether the pipe buffer consumption is bounded of not,
> > > this will jam up the TCP sender because the SKB data allocation is
> > > charged against the socket send buffer allocation.
> >
> > Forgive my network ignorance, but is that a problem? Since you bring it
> > up, I guess so :-)
>
> David means, that socket bufer allocation is limited, and delaying
> freeing can end up with exhausint that limit.
OK, so a delayed empty of the pipe could end up causing packet drops
elsewhere due to allocation exhaustion?
> > We can grow the pipe, should we have to. So instead of blocking waiting
> > on reader consumption, we can extend the size of the pipe and keep
> > going.
>
> I have a code, which roughly works (but I will test it some more), which
> just introduces reference counters for slab pages, so that the would not
> be actually freed via page reclaim, but only after reference counters
> are dropped. That forced changes in mm/slab.c so likely it is
> unacceptible solution, but it is interesting as is.
Hmm, still seems like it's working around the problem. We essentially
just need to ensure that the data doesn't get _reused_, not just freed.
It doesn't help holding a reference to the page, if someone else just
reuses it and fills it with other data before it has been consumed and
released by the pipe buffer operations.
That's why I thought the skb referencing was the better idea, then we
don't have to care about the backing of the skb either. Provided that
preventing the free of the skb before the pipe buffer has been consumed
guarantees that the contents aren't reused.
--
Jens Axboe
next prev parent reply other threads:[~2007-06-08 9:06 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-06-05 8:05 [PATCH][RFC] network splice receive Jens Axboe
2007-06-05 11:45 ` Jens Axboe
2007-06-05 12:20 ` Jens Axboe
2007-06-05 12:34 ` jamal
2007-06-06 7:14 ` Jens Axboe
2007-06-05 13:34 ` Evgeniy Polyakov
2007-06-05 14:31 ` Evgeniy Polyakov
2007-06-05 14:49 ` Evgeniy Polyakov
2007-06-06 7:17 ` Jens Axboe
2007-06-07 8:09 ` Evgeniy Polyakov
2007-06-07 10:51 ` Jens Axboe
2007-06-07 14:58 ` Evgeniy Polyakov
2007-06-08 7:48 ` Jens Axboe
2007-06-08 8:06 ` David Miller
2007-06-08 8:38 ` Jens Axboe
2007-06-08 8:56 ` Evgeniy Polyakov
2007-06-08 9:04 ` Jens Axboe [this message]
2007-06-08 13:58 ` Evgeniy Polyakov
2007-06-08 14:14 ` Jens Axboe
2007-06-08 14:57 ` Evgeniy Polyakov
2007-06-08 15:19 ` Jens Axboe
2007-06-08 15:30 ` Evgeniy Polyakov
2007-06-09 6:36 ` Jens Axboe
2007-06-12 11:29 ` Evgeniy Polyakov
2007-06-12 11:33 ` Jens Axboe
2007-06-12 12:35 ` Evgeniy Polyakov
2007-06-12 12:40 ` Jens Axboe
2007-06-12 13:11 ` Evgeniy Polyakov
2007-06-12 13:11 ` Jens Axboe
2007-06-11 8:00 ` Jens Axboe
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=20070608090439.GK7341@kernel.dk \
--to=jens.axboe@oracle.com \
--cc=davem@davemloft.net \
--cc=johnpol@2ka.mipt.ru \
--cc=netdev@vger.kernel.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 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).