Re: tbench regression in 2.6.25-rc1

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: <Valdis.Kletnieks@...>
Cc: David Miller <davem@...>, <dada1@...>, <herbert@...>, <linux-kernel@...>, <netdev@...>
Date: Tuesday, February 19, 2008 - 2:51 am

On Mon, 2008-02-18 at 12:33 -0500, Valdis.Kletnieks@vt.edu wrote: 
Ok. Below is the new patch.

1) Move tclassid under ops in case CONFIG_NET_CLS_ROUTE=y. So sizeof(dst_entry)=200
no matter if CONFIG_NET_CLS_ROUTE=y/n. I tested many patches on my 16-core tigerton by
moving tclassid to different place. It looks like tclassid could also have impact on
performance.
If moving tclassid before metrics, or just don't move tclassid, the performance isn't
good. So I move it behind metrics.

2) Add comments before __refcnt.

If CONFIG_NET_CLS_ROUTE=y, the result with below patch is about 18% better than
the one without the patch.

If CONFIG_NET_CLS_ROUTE=n, the result with below patch is about 30% better than
the one without the patch.

Signed-off-by: Zhang Yanmin <yanmin.zhang@intel.com>

---

--- linux-2.6.25-rc1/include/net/dst.h	2008-02-21 14:33:43.000000000 +0800
+++ linux-2.6.25-rc1_work/include/net/dst.h	2008-02-22 12:52:19.000000000 +0800
@@ -52,15 +52,10 @@ struct dst_entry
 	unsigned short		header_len;	/* more space at head required */
 	unsigned short		trailer_len;	/* space to reserve at tail */
 
-	u32			metrics[RTAX_MAX];
-	struct dst_entry	*path;
-
-	unsigned long		rate_last;	/* rate limiting for ICMP */
 	unsigned int		rate_tokens;
+	unsigned long		rate_last;	/* rate limiting for ICMP */
 
-#ifdef CONFIG_NET_CLS_ROUTE
-	__u32			tclassid;
-#endif
+	struct dst_entry	*path;
 
 	struct neighbour	*neighbour;
 	struct hh_cache		*hh;
@@ -70,10 +65,20 @@ struct dst_entry
 	int			(*output)(struct sk_buff*);
 
 	struct  dst_ops	        *ops;
-		
-	unsigned long		lastuse;
+
+	u32			metrics[RTAX_MAX];
+
+#ifdef CONFIG_NET_CLS_ROUTE
+	__u32			tclassid;
+#endif
+
+	/*
+	 * __refcnt wants to be on a different cache line from
+	 * input/output/ops or performance tanks badly
+	 */
 	atomic_t		__refcnt;	/* client references	*/
 	int			__use;
+	unsigned long		lastuse;
 	union {
 		struct dst_entry *next;
 		struct rtable    *rt_next;


--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
tbench regression in 2.6.25-rc1, Zhang, Yanmin, (Thu Feb 14, 9:52 pm)
Re: tbench regression in 2.6.25-rc1, Eric Dumazet, (Fri Feb 15, 2:05 am)
Re: tbench regression in 2.6.25-rc1, Zhang, Yanmin, (Fri Feb 15, 2:30 am)
Re: tbench regression in 2.6.25-rc1, Eric Dumazet, (Fri Feb 15, 10:21 am)
Re: tbench regression in 2.6.25-rc1, Zhang, Yanmin, (Sun Feb 17, 9:39 pm)
Re: tbench regression in 2.6.25-rc1, David Miller, (Fri Feb 15, 7:22 pm)
Re: tbench regression in 2.6.25-rc1, Zhang, Yanmin, (Mon Feb 18, 4:12 am)
Re: tbench regression in 2.6.25-rc1, , (Mon Feb 18, 1:33 pm)
Re: tbench regression in 2.6.25-rc1, Zhang, Yanmin, (Tue Feb 19, 2:51 am)
Re: tbench regression in 2.6.25-rc1, Eric Dumazet, (Tue Feb 19, 3:40 am)
Re: tbench regression in 2.6.25-rc1, Zhang, Yanmin, (Wed Feb 20, 3:04 am)
Re: tbench regression in 2.6.25-rc1, Eric Dumazet, (Wed Feb 20, 3:38 am)
Re: tbench regression in 2.6.25-rc1, David Miller, (Wed Feb 20, 4:14 am)
Re: tbench regression in 2.6.25-rc1, Zhang, Yanmin, (Wed Feb 20, 4:41 am)
Re: tbench regression in 2.6.25-rc1, Eric Dumazet, (Mon Feb 18, 6:11 am)
Re: tbench regression in 2.6.25-rc1, Zhang, Yanmin, (Mon Feb 18, 10:44 pm)
Re: tbench regression in 2.6.25-rc1, Eric Dumazet, (Tue Feb 19, 3:35 am)
Re: tbench regression in 2.6.25-rc1, Zhang, Yanmin, (Tue Feb 19, 4:40 am)