diff options
author | 2021-09-02 14:54:03 -0700 | |
---|---|---|
committer | 2021-09-03 09:58:11 -0700 | |
commit | bf11b9a8e9a93c1fc0ebfc2929622d5cf7d43888 (patch) | |
tree | 448140dd50b971531e350d1c4d73041b908bf1d3 /ipc | |
parent | mm: delete unused get_kernel_page() (diff) | |
download | wireguard-linux-bf11b9a8e9a93c1fc0ebfc2929622d5cf7d43888.tar.xz wireguard-linux-bf11b9a8e9a93c1fc0ebfc2929622d5cf7d43888.zip |
shmem: use raw_spinlock_t for ->stat_lock
Each CPU has SHMEM_INO_BATCH inodes available in `->ino_batch' which is
per-CPU. Access here is serialized by disabling preemption. If the pool
is empty, it gets reloaded from `->next_ino'. Access here is serialized
by ->stat_lock which is a spinlock_t and can not be acquired with disabled
preemption.
One way around it would make per-CPU ino_batch struct containing the inode
number a local_lock_t.
Another solution is to promote ->stat_lock to a raw_spinlock_t. The
critical sections are short. The mpol_put() must be moved outside of the
critical section to avoid invoking the destructor with disabled
preemption.
Link: https://lkml.kernel.org/r/20210806142916.jdwkb5bx62q5fwfo@linutronix.de
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Acked-by: Hugh Dickins <hughd@google.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'ipc')
0 files changed, 0 insertions, 0 deletions