From: Eric Dumazet <eric.dumazet@gmail.com>
To: Changli Gao <xiaosuo@gmail.com>
Cc: "David S. Miller" <davem@davemloft.net>,
Oliver Hartkopp <socketcan@hartkopp.net>,
"Michael S. Tsirkin" <mst@redhat.com>,
netdev@vger.kernel.org
Subject: Re: [PATCH] net: af_packet: don't call tpacket_destruct_skb() until the skb is sent out
Date: Fri, 10 Sep 2010 18:58:26 +0200 [thread overview]
Message-ID: <1284137906.24675.97.camel@edumazet-laptop> (raw)
In-Reply-To: <AANLkTi=ZzvCNef7r81WZdbZsiSquYhDrnYAY73r4mo+t@mail.gmail.com>
Le samedi 11 septembre 2010 à 00:47 +0800, Changli Gao a écrit :
> On Fri, Sep 10, 2010 at 10:26 PM, Eric Dumazet <eric.dumazet@gmail.com> wrote:
> > Are you sure sock_wfree(skb) is still needed ?
>
> sock_wfree(skb) is also used to wake up the users who sleep on
> poll(2). If sock_wfree(skb) is moved into skb->destructor(), and
> called before skb is sent out, pollers will be waked up without
> POLLOUT, and since the later skb_shinfo(skb)->destructor() doesn't
> wake up the pollers, POLLOUT events will be lost, and the poller will
> be blocked forever.
>
Then implement poll() to use the number of available slots.
(not use the default poll() that relies on generic sk / inet queues and
counters)
Really, sock_wfree() cannot be used at all, or we also must disable
early orphaning of these skbs.
Goal is to replace skb->destructor use in af_packet by
shinfo->destructor, not mix the two.
> >
> >
> >> + kfree(arg);
> >
> > this new kmalloc()/kfree() for each sent packet wont please the guys
> > using af_packet/mmap interface...
>
> Embed these two pointers into skb_shared_info? It may slow the others.
we have some room because of SKB_PAD alignment,
next prev parent reply other threads:[~2010-09-10 16:58 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-09-10 13:22 [PATCH] net: af_packet: don't call tpacket_destruct_skb() until the skb is sent out Changli Gao
2010-09-10 14:26 ` Eric Dumazet
2010-09-10 16:47 ` Changli Gao
2010-09-10 16:58 ` Eric Dumazet [this message]
2010-09-10 17:12 ` Eric Dumazet
2010-09-11 0:19 ` Changli Gao
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=1284137906.24675.97.camel@edumazet-laptop \
--to=eric.dumazet@gmail.com \
--cc=davem@davemloft.net \
--cc=mst@redhat.com \
--cc=netdev@vger.kernel.org \
--cc=socketcan@hartkopp.net \
--cc=xiaosuo@gmail.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