From: Florian Westphal Date: Sun, 30 Oct 2016 23:35:07 +0000 (+0100) Subject: netfilter: nf_queue: place volatile data in own cacheline X-Git-Tag: v4.14-rc1~1973^2~355^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=886bc50348fd69972baa4616ce95b7dc9ff8afe7;p=platform%2Fkernel%2Flinux-rpi3.git netfilter: nf_queue: place volatile data in own cacheline As the comment indicates, the data at the end of nfqnl_instance struct is written on every queue/dequeue, so it should reside in its own cacheline. Before this change, 'lock' was in first cacheline so we dirtied both. Signed-off-by: Florian Westphal Signed-off-by: Pablo Neira Ayuso --- diff --git a/net/netfilter/nfnetlink_queue.c b/net/netfilter/nfnetlink_queue.c index af832c5..5379f78 100644 --- a/net/netfilter/nfnetlink_queue.c +++ b/net/netfilter/nfnetlink_queue.c @@ -69,7 +69,7 @@ struct nfqnl_instance { * Following fields are dirtied for each queued packet, * keep them in same cache line if possible. */ - spinlock_t lock; + spinlock_t lock ____cacheline_aligned_in_smp; unsigned int queue_total; unsigned int id_sequence; /* 'sequence' of pkt ids */ struct list_head queue_list; /* packets in queue */