• Tejun Heo's avatar
    cgroup: remove cgroup_pidlist->rwsem · 069df3b7
    Tejun Heo authored
    cgroup_pidlist locking is needlessly complicated.  It has outer
    cgroup->pidlist_mutex to protect the list of pidlists associated with
    a cgroup and then each pidlist has rwsem to synchronize updates and
    reads.  Given that the only read access is from seq_file operations
    which are always invoked back-to-back, the rwsem is a giant overkill.
    All it does is adding unnecessary complexity.
    
    This patch removes cgroup_pidlist->rwsem and protects all accesses to
    pidlists belonging to a cgroup with cgroup->pidlist_mutex.
    pidlist->rwsem locking is removed if it's nested inside
    cgroup->pidlist_mutex; otherwise, it's replaced with
    cgroup->pidlist_mutex locking.
    Signed-off-by: default avatarTejun Heo <tj@kernel.org>
    Acked-by: default avatarLi Zefan <lizefan@huawei.com>
    069df3b7
cgroup.c 148 KB