* [PATCH next] netfilter: nf_queue: place volatile data in own cacheline
@ 2016-10-30 23:35 Florian Westphal
2016-10-31 14:19 ` Pablo Neira Ayuso
0 siblings, 1 reply; 2+ messages in thread
From: Florian Westphal @ 2016-10-30 23:35 UTC (permalink / raw)
To: netfilter-devel; +Cc: Florian Westphal
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 <fw@strlen.de>
---
net/netfilter/nfnetlink_queue.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/netfilter/nfnetlink_queue.c b/net/netfilter/nfnetlink_queue.c
index af832c526048..5379f788a372 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 */
--
2.7.3
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH next] netfilter: nf_queue: place volatile data in own cacheline
2016-10-30 23:35 [PATCH next] netfilter: nf_queue: place volatile data in own cacheline Florian Westphal
@ 2016-10-31 14:19 ` Pablo Neira Ayuso
0 siblings, 0 replies; 2+ messages in thread
From: Pablo Neira Ayuso @ 2016-10-31 14:19 UTC (permalink / raw)
To: Florian Westphal; +Cc: netfilter-devel
On Mon, Oct 31, 2016 at 12:35:07AM +0100, Florian Westphal wrote:
> 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.
Applied, thanks Florian.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2016-10-31 14:20 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-10-30 23:35 [PATCH next] netfilter: nf_queue: place volatile data in own cacheline Florian Westphal
2016-10-31 14:19 ` Pablo Neira Ayuso
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).