path: root/include/crypto/aes.h
diff options
authorSebastian Andrzej Siewior <bigeasy@linutronix.de>2019-03-29 14:09:56 +0100
committerHerbert Xu <herbert@gondor.apana.org.au>2019-04-08 14:36:16 +0800
commit71052dcf4be70be4077817297dcde7b155e745f2 (patch)
tree4422a948fb51418bad38e1cf97763ee2a4d8683a /include/crypto/aes.h
parentcrypto: scompress - return proper error code for allocation failure (diff)
crypto: scompress - Use per-CPU struct instead multiple variables
Two per-CPU variables are allocated as pointer to per-CPU memory which then are used as scratch buffers. We could be smart about this and use instead a per-CPU struct which contains the pointers already and then we need to allocate just the scratch buffers. Add a lock to the struct. By doing so we can avoid the get_cpu() statement and gain lockdep coverage (if enabled) to ensure that the lock is always acquired in the right context. On non-preemptible kernels the lock vanishes. It is okay to use raw_cpu_ptr() in order to get a pointer to the struct since it is protected by the spinlock. The diffstat of this is negative and according to size scompress.o: text data bss dec hex filename 1847 160 24 2031 7ef dbg_before.o 1754 232 4 1990 7c6 dbg_after.o 1799 64 24 1887 75f no_dbg-before.o 1703 88 4 1795 703 no_dbg-after.o The overall size increase difference is also negative. The increase in the data section is only four bytes without lockdep. Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to '')
0 files changed, 0 insertions, 0 deletions