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

From: Evgeniy Polyakov
Date: Tue Jan 20 2009 - 05:00:55 EST


Hi Jarek.

On Tue, Jan 20, 2009 at 09:33:52AM +0000, Jarek Poplawski (jarkao2@xxxxxxxxx) wrote:
> > Here is a tiny upgrade to save some memory by reusing a page for more
> > chunks if possible, which I think could be considered, after the
> > testing of the main patch is finished. (There could be also added an
> > additional freeing of this cached page before socket destruction,
> > maybe in tcp_splice_read(), if somebody finds good place.)
>
> OOPS! I did it again... Here is better refcounting.
>
> Jarek P.
>
> --- (take 2)
>
> include/net/sock.h | 4 ++++
> net/core/skbuff.c | 32 ++++++++++++++++++++++++++------
> net/core/sock.c | 2 ++
> net/ipv4/tcp_ipv4.c | 8 ++++++++
> 4 files changed, 40 insertions(+), 6 deletions(-)
>
> diff --git a/include/net/sock.h b/include/net/sock.h
> index 5a3a151..4ded741 100644
> --- a/include/net/sock.h
> +++ b/include/net/sock.h
> @@ -190,6 +190,8 @@ struct sock_common {
> * @sk_user_data: RPC layer private data
> * @sk_sndmsg_page: cached page for sendmsg
> * @sk_sndmsg_off: cached offset for sendmsg
> + * @sk_splice_page: cached page for splice
> + * @sk_splice_off: cached offset for splice

Ugh, increase every socket by 16 bytes... Does TCP one still fit the
page?

--
Evgeniy Polyakov
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/