Skip to content

Commit 886bc50

Browse files
Florian Westphalummakynes
authored andcommitted
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 <[email protected]> Signed-off-by: Pablo Neira Ayuso <[email protected]>
1 parent e41e9d6 commit 886bc50

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

net/netfilter/nfnetlink_queue.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ struct nfqnl_instance {
6969
* Following fields are dirtied for each queued packet,
7070
* keep them in same cache line if possible.
7171
*/
72-
spinlock_t lock;
72+
spinlock_t lock ____cacheline_aligned_in_smp;
7373
unsigned int queue_total;
7474
unsigned int id_sequence; /* 'sequence' of pkt ids */
7575
struct list_head queue_list; /* packets in queue */

0 commit comments

Comments
 (0)