cgroup: Replace cgroup_rstat_mutex with a spinlock
authorTejun Heo <tj@kernel.org>
Thu, 26 Apr 2018 21:29:05 +0000 (14:29 -0700)
committerTejun Heo <tj@kernel.org>
Thu, 26 Apr 2018 21:29:05 +0000 (14:29 -0700)
commit0fa294fb1985c06c4e3325e30e759d4ca580f59a
tree41bc9abc473d8df21ab0cb1dca6c1b8746abcacb
parent6162cef0f741c70eb0c7ac7e6142f85808d8abc4
cgroup: Replace cgroup_rstat_mutex with a spinlock

Currently, rstat flush path is protected with a mutex which is fine as
all the existing users are from interface file show path.  However,
rstat is being generalized for use by controllers and flushing from
atomic contexts will be necessary.

This patch replaces cgroup_rstat_mutex with a spinlock and adds a
irq-safe flush function - cgroup_rstat_flush_irqsafe().  Explicit
yield handling is added to the flush path so that other flush
functions can yield to other threads and flushers.

Signed-off-by: Tejun Heo <tj@kernel.org>
include/linux/cgroup.h
kernel/cgroup/rstat.c