lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:	Tue, 17 Dec 2013 10:15:36 -0800 (PST)
From:	Tom Herbert <therbert@...gle.com>
To:	davem@...emloft.net, edumazet@...gle.com, netdev@...r.kernel.org
Subject: PATCH] net: Cache align dst refcnt

ipv4_dst_check is coming up very high in perf top for TCP_RR tests and
it really is not doing much interesting. Looks like we have false
sharing with dst->refcnt. This patch cache aligns refcnt. There were
already some comments in the code that refcnt needs to be cache aligned.

Signed-off-by: Tom Herbert <therbert@...gle.com>
---
 include/net/dst.h | 11 +++--------
 1 file changed, 3 insertions(+), 8 deletions(-)

diff --git a/include/net/dst.h b/include/net/dst.h
index 44995c1..265b4cd 100644
--- a/include/net/dst.h
+++ b/include/net/dst.h
@@ -85,17 +85,12 @@ struct dst_entry {
 #endif
 
 	/*
-	 * Align __refcnt to a 64 bytes alignment
-	 * (L1_CACHE_SIZE would be too much)
-	 */
-#ifdef CONFIG_64BIT
-	long			__pad_to_align_refcnt[2];
-#endif
-	/*
 	 * __refcnt wants to be on a different cache line from
 	 * input/output/ops or performance tanks badly
 	 */
-	atomic_t		__refcnt;	/* client references	*/
+	atomic_t		__refcnt ____cacheline_aligned_in_smp;
+				/* client references	*/
+
 	int			__use;
 	unsigned long		lastuse;
 	union {
-- 
1.8.5.1

--
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

Powered by Openwall GNU/*/Linux Powered by OpenVZ