summaryrefslogtreecommitdiffstats
path: root/include/linux/padata.h
diff options
context:
space:
mode:
authorMathias Krause <mathias.krause@secunet.com>2013-10-25 12:14:15 +0200
committerHerbert Xu <herbert@gondor.apana.org.au>2013-10-30 12:02:58 +0800
commit0b6b098efcddac2bf4e2a895c9b655560bbfcee4 (patch)
tree0facc6f31504a5be471d4592f99bce0b28f995e2 /include/linux/padata.h
parentcfc6f11b768a9bdda17aac280474de1f0e344fea (diff)
downloadop-kernel-dev-0b6b098efcddac2bf4e2a895c9b655560bbfcee4.zip
op-kernel-dev-0b6b098efcddac2bf4e2a895c9b655560bbfcee4.tar.gz
padata: make the sequence counter an atomic_t
Using a spinlock to atomically increase a counter sounds wrong -- we've atomic_t for this! Also move 'seq_nr' to a different cache line than 'lock' to reduce cache line trashing. This has the nice side effect of decreasing the size of struct parallel_data from 192 to 128 bytes for a x86-64 build, e.g. occupying only two instead of three cache lines. Those changes results in a 5% performance increase on an IPsec test run using pcrypt. Btw. the seq_lock spinlock was never explicitly initialized -- one more reason to get rid of it. Signed-off-by: Mathias Krause <mathias.krause@secunet.com> Acked-by: Steffen Klassert <steffen.klassert@secunet.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'include/linux/padata.h')
-rw-r--r--include/linux/padata.h3
1 files changed, 1 insertions, 2 deletions
diff --git a/include/linux/padata.h b/include/linux/padata.h
index 86292be..4386946 100644
--- a/include/linux/padata.h
+++ b/include/linux/padata.h
@@ -129,10 +129,9 @@ struct parallel_data {
struct padata_serial_queue __percpu *squeue;
atomic_t reorder_objects;
atomic_t refcnt;
+ atomic_t seq_nr;
struct padata_cpumask cpumask;
spinlock_t lock ____cacheline_aligned;
- spinlock_t seq_lock;
- unsigned int seq_nr;
unsigned int processed;
struct timer_list timer;
};
OpenPOWER on IntegriCloud