[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <1347868144.26523.71.camel@edumazet-glaptop>
Date: Mon, 17 Sep 2012 09:49:04 +0200
From: Eric Dumazet <eric.dumazet@...il.com>
To: netdev <netdev@...r.kernel.org>
Subject: [RFC] tcp: use order-3 pages in tcp_sendmsg()
We currently use per socket page reserve for tcp_sendmsg() operations.
Its done to raise the probability of coalescing small write() in to
single segments in the skbs.
But it wastes a lot of memory for applications handling a lot of mostly
idle sockets, since each socket holds one page in sk->sk_sndmsg_page
I did a small experiment to use order-3 pages and it gave me a 10% boost
of performance, because each TSO skb can use only two frags of 32KB,
instead of 16 frags of 4KB, so we spend less time in ndo_start_xmit() to
setup the tx descriptor and TX completion path to unmap the frags and
free them.
We also spend less time in tcp_sendmsg(), because we call page allocator
8x less often.
Now back to the per socket page, what about trying to factorize it ?
Since we can sleep (or/and do a cpu migration) in tcp_sendmsg(), we cant
really use a percpu page reserve as we do in __netdev_alloc_frag()
We could instead use a per thread reserve, at the cost of adding a test
in task exit handler.
Recap :
1) Use a per thread page reserve instead of a per socket one
2) Use order-3 pages (or order-0 pages if page size is >= 32768)
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists