• P
    devcgroup: relax white-list protection down to RCU · 4efd1a1b
    Pavel Emelyanov 提交于
    Currently this list is protected with a simple spinlock, even for reading
    from one.  This is OK, but can be better.
    
    Actually I want it to be better very much, since after replacing the
    OpenVZ device permissions engine with the cgroup-based one I noticed, that
    we set 12 default device permissions for each newly created container (for
    /dev/null, full, terminals, ect devices), and people sometimes have up to
    20 perms more, so traversing the ~30-40 elements list under a spinlock
    doesn't seem very good.
    
    Here's the RCU protection for white-list - dev_whitelist_item-s are added
    and removed under the devcg->lock, but are looked up in permissions
    checking under the rcu_read_lock.
    Signed-off-by: NPavel Emelyanov <xemul@openvz.org>
    Acked-by: NSerge Hallyn <serue@us.ibm.com>
    Cc: Balbir Singh <balbir@in.ibm.com>
    Cc: Paul Menage <menage@google.com>
    Cc: "Paul E. McKenney" <paulmck@us.ibm.com>
    Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
    Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
    4efd1a1b
device_cgroup.c 12.9 KB