From: "Michael S. Tsirkin" <mst@redhat.com>
To: Ian Campbell <Ian.Campbell@citrix.com>
Cc: David Miller <davem@davemloft.net>,
"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
"eric.dumazet@gmail.com" <eric.dumazet@gmail.com>
Subject: Re: [PATCH RFC 1/6] skbuff: support per-page destructors in copy_ubufs
Date: Sun, 13 May 2012 13:10:28 +0300 [thread overview]
Message-ID: <20120513101028.GC23273@redhat.com> (raw)
In-Reply-To: <1336802484.3891.24.camel@dagon.hellion.org.uk>
On Sat, May 12, 2012 at 07:01:24AM +0100, Ian Campbell wrote:
> On Fri, 2012-05-11 at 17:30 +0100, Michael S. Tsirkin wrote:
> > On Fri, May 11, 2012 at 03:08:36PM +0300, Michael S. Tsirkin wrote:
> > > On Fri, May 11, 2012 at 11:58:12AM +0100, Ian Campbell wrote:
> > > > On Fri, 2012-05-11 at 10:00 +0100, Ian Campbell wrote:
> > > > > I'm seeing copy_ubufs called in my remote NFS test, which I don't
> > > > > think I expected -- I'll investigate why this is happening today.
> > > >
> > > > It's tcp_transmit_skb which can (conditionally) call skb_clone
> > > > (backtrace below)
> > >
> > > Interesting. I didn't realise we clone skbs on data path:
> > > tcp_write_xmit calls tcp_transmit_skb with clone_it flag.
> > > Could someone comment on why we need to clone on good path
> > > like this?
> >
> > Hmm, it's in case we need to retransmit it later.
>
> I wonder if we could avoid the copy_ubuf in this particular clone path
> and have any subsequent calls to copy_ubufs use skb->fclone to determine
> if it can safely replace the frags?
>
> If it cannot then could it do a full copy of the skb (including new
> shinfo, new frag pages etc) as a fallback?
>
> Ian.
>
Yes I think we should call a variant of clone that avoids copy_ubuf on
the first transmit. But need to be careful we don't access the frag
list while it is being modified.
For example very roughly, maybe we could have copy_ubuf detect
packet clone is queued and take some lock?
On retransmit we could check and if we are not the only clone left
(which should be uncommon) trigger copy ubuf then.
Thoughts?
--
MST
next prev parent reply other threads:[~2012-05-13 10:10 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-05-07 13:53 [PATCH RFC 0/6] copy aside frags with destructors (was [PATCH 7/9] net: add skb_orphan_frags to copy aside frags with destructors) Michael S. Tsirkin
2012-05-07 13:54 ` [PATCH RFC 1/6] skbuff: support per-page destructors in copy_ubufs Michael S. Tsirkin
2012-05-10 17:46 ` Ian Campbell
2012-05-10 18:42 ` Michael S. Tsirkin
2012-05-11 9:00 ` Ian Campbell
2012-05-11 10:58 ` Ian Campbell
2012-05-11 12:08 ` Michael S. Tsirkin
2012-05-11 16:30 ` Michael S. Tsirkin
2012-05-12 6:01 ` Ian Campbell
2012-05-13 10:10 ` Michael S. Tsirkin [this message]
2012-05-11 21:12 ` David Miller
2012-05-07 13:54 ` [PATCH RFC 2/6] skbuff: add an api to orphan frags Michael S. Tsirkin
2012-05-08 12:47 ` Michael S. Tsirkin
2012-05-07 13:54 ` [PATCH RFC 3/6] skbuff: convert to skb_orphan_frags Michael S. Tsirkin
2012-05-07 13:54 ` [PATCH RFC 4/6] tun: orphan frags on xmit Michael S. Tsirkin
2012-05-08 14:36 ` Michael S. Tsirkin
2012-05-07 13:54 ` [PATCH RFC 5/6] net: orphan frags on receive Michael S. Tsirkin
2012-05-09 13:54 ` Ian Campbell
2012-05-09 15:12 ` Michael S. Tsirkin
2012-05-14 19:18 ` Michael S. Tsirkin
2012-05-07 13:54 ` [PATCH RFC 6/6] skbuff: set zerocopy flag on frag destructor Michael S. Tsirkin
2012-05-08 12:46 ` Michael S. Tsirkin
2012-05-08 9:41 ` [PATCH RFC 0/6] copy aside frags with destructors (was [PATCH 7/9] net: add skb_orphan_frags to copy aside frags with destructors) Michael S. Tsirkin
2012-05-08 10:54 ` Ian Campbell
2012-05-08 14:49 ` Michael S. Tsirkin
2012-05-09 13:18 ` Ian Campbell
2012-05-09 13:52 ` Michael S. Tsirkin
2012-05-09 14:01 ` Ian Campbell
2012-05-09 15:27 ` Michael S. Tsirkin
2012-05-09 14:56 ` Michael S. Tsirkin
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=20120513101028.GC23273@redhat.com \
--to=mst@redhat.com \
--cc=Ian.Campbell@citrix.com \
--cc=davem@davemloft.net \
--cc=eric.dumazet@gmail.com \
--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).