Re: 2.6.24-rc2: Network commit causes SLUB performance regression with tbench

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: <nickpiggin@...>
Cc: <clameter@...>, <netdev@...>, <herbert@...>, <linux-kernel@...>
Date: Wednesday, November 14, 2007 - 7:10 am

From: Nick Piggin <nickpiggin@yahoo.com.au>
Date: Wed, 14 Nov 2007 09:27:39 +1100

 ...

Thanks for all of this data Nick.

So the thing that's being effected here in TCP is
net/ipv4/tcp.c:select_size(), specifically the else branch:

	int tmp = tp->mss_cache;
 ...
		else {
			int pgbreak = SKB_MAX_HEAD(MAX_TCP_HEADER);

			if (tmp >= pgbreak &&
			    tmp <= pgbreak + (MAX_SKB_FRAGS - 1) * PAGE_SIZE)
				tmp = pgbreak;
		}

This is deciding, in 'tmp', how much linear sk_buff space to
allocate.  'tmp' is initially set to the path MSS, which
for loopback is 16K - the space necessary for packet headers.

The SKB_MAX_HEAD() value has changed as a result of Herbert's
bug fix.   I suspect this 'if' test is passing both with and
without the patch.

But pgbreak is now smaller, and thus the skb->data linear
data area size we choose to use is smaller as well.

You can test if this is precisely what is causing the performance
regression by using the old calculation just here in select_size().

Add something like this local to net/ipv4/tcp.c:

#define OLD_SKB_WITH_OVERHEAD(X)	\
	(((X) - sizeof(struct skb_shared_info)) & \
	 ~(SMP_CACHE_BYTES - 1))
#define OLD_SKB_MAX_ORDER(X, ORDER) \
	OLD_SKB_WITH_OVERHEAD((PAGE_SIZE << (ORDER)) - (X))
#define OLD_SKB_MAX_HEAD(X)		(OLD_SKB_MAX_ORDER((X), 0))

And then use OLD_SKB_MAX_HEAD() in select_size().
-
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
2.6.24-rc2 slab vs slob tbench numbers, Nick Piggin, (Fri Nov 9, 8:36 am)
Re: 2.6.24-rc2 slab vs slob tbench numbers, Matt Mackall, (Mon Nov 12, 4:13 pm)
Re: 2.6.24-rc2 slab vs slob tbench numbers, Nick Piggin, (Tue Nov 13, 7:44 am)
Re: 2.6.24-rc2 slab vs slob tbench numbers, Christoph Lameter, (Fri Nov 9, 11:15 am)
Re: 2.6.24-rc2 slab vs slob tbench numbers, Christoph Lameter, (Fri Nov 9, 1:49 pm)
Re: 2.6.24-rc2: Network commit causes SLUB performance regre..., Christoph Lameter, (Mon Nov 12, 3:44 pm)
Re: 2.6.24-rc2: Network commit causes SLUB performance regre..., David Miller, (Wed Nov 14, 7:10 am)
Re: 2.6.24-rc2: Network commit causes SLUB performance regre..., Christoph Lameter, (Wed Nov 14, 9:03 pm)
Re: 2.6.24-rc2: Network commit causes SLUB performance regre..., Christoph Lameter, (Wed Nov 14, 2:33 pm)