From: Jesper Dangaard Brouer Date: Mon, 28 Jan 2013 23:44:14 +0000 (+0000) Subject: net: cacheline adjust struct netns_frags for better frag performance X-Git-Tag: v3.9-rc1~139^2~232^2~5 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=cd39a7890aed7433beb3188c7ad8591e260ebf10;p=platform%2Fkernel%2Flinux-3.10.git net: cacheline adjust struct netns_frags for better frag performance This small cacheline adjustment of struct netns_frags improves performance significantly for the fragmentation code. Struct members 'lru_list' and 'mem' are both hot elements, and it hurts performance, due to cacheline bouncing at every call point, when they share a cacheline. Also notice, how mem is placed together with 'high_thresh' and 'low_thresh', as they are used in the compare operations together. Signed-off-by: Jesper Dangaard Brouer Signed-off-by: David S. Miller --- diff --git a/include/net/inet_frag.h b/include/net/inet_frag.h index 32786a0..91e7797 100644 --- a/include/net/inet_frag.h +++ b/include/net/inet_frag.h @@ -3,9 +3,12 @@ struct netns_frags { int nqueues; - atomic_t mem; struct list_head lru_list; + /* Its important for performance to keep lru_list and mem on + * separate cachelines + */ + atomic_t mem ____cacheline_aligned_in_smp; /* sysctls */ int timeout; int high_thresh;