diff options
author | Sebastian Andrzej Siewior <bigeasy@linutronix.de> | 2020-05-27 22:11:18 +0200 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2020-05-28 10:31:10 +0200 |
commit | ed19f19256be2949af1ab5634e62178d30a355c2 (patch) | |
tree | 5a4650415b231d322b538b6d9cc93151628fa4d7 /drivers/block/zram/zcomp.h | |
parent | 3e92fd7bd2b8418b53cb7304855b8b69bedbe2b4 (diff) | |
download | lwn-ed19f19256be2949af1ab5634e62178d30a355c2.tar.gz lwn-ed19f19256be2949af1ab5634e62178d30a355c2.zip |
zram: Allocate struct zcomp_strm as per-CPU memory
zcomp::stream is a per-CPU pointer, pointing to struct zcomp_strm
which contains two pointers. Having struct zcomp_strm allocated
directly as per-CPU memory would avoid one additional memory
allocation and a pointer dereference. This also simplifies the
addition of a local_lock to struct zcomp_strm.
Allocate zcomp::stream directly as per-CPU memory.
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Acked-by: Peter Zijlstra <peterz@infradead.org>
Link: https://lore.kernel.org/r/20200527201119.1692513-7-bigeasy@linutronix.de
Diffstat (limited to 'drivers/block/zram/zcomp.h')
-rw-r--r-- | drivers/block/zram/zcomp.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/block/zram/zcomp.h b/drivers/block/zram/zcomp.h index 1806475b919d..72c2ee4d843e 100644 --- a/drivers/block/zram/zcomp.h +++ b/drivers/block/zram/zcomp.h @@ -14,7 +14,7 @@ struct zcomp_strm { /* dynamic per-device compression frontend */ struct zcomp { - struct zcomp_strm * __percpu *stream; + struct zcomp_strm __percpu *stream; const char *name; struct hlist_node node; }; |