Re: [PATCH v3] tcp: splice as many packets as possible at once

Jarek Poplawski
2009-01-27T07:54:35Z

On Tue, Jan 27, 2009 at 06:11:30PM +1100, Herbert Xu wrote:
> David Miller <davem@davemloft.net> wrote:
> > From: Jarek Poplawski <jarkao2@gmail.com>
> > Date: Thu, 22 Jan 2009 09:04:42 +0000
> >
> >> It seems this sk_sndmsg_page usage (refcounting) isn't consistent.
> >> I used here tcp_sndmsg() way, but I think I'll go back to this question
> >> soon.
> >
> > Indeed, it is something to look into, as well as locking.
> >
> > I'll try to find some time for this, thanks Jarek.
>
> After a quick look it seems to be OK to me. The code in the patch
> is called from tcp_splice_read, which holds the socket lock. So as
> long as the patch uses the usual TCP convention it should work.

Yes, but ip_append_data() (and skb_append_datato_frags() for
NETIF_F_UFO only, so currently not a problem), uses this differently,
and these pages in sk->sk_sndmsg_page could leak or be used after
kfree. (I didn't track locking in these other places).

Thanks,
Jarek P.