diff options
author | Vasiliy Kulikov <segoon@openwall.com> | 2011-07-29 01:56:40 +0200 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-07-30 20:44:20 +0200 |
commit | 4c677e2eefdba9c5bfc4474e2e91b26ae8458a1d (patch) | |
tree | c3c81703d022e0c3c43ddffc3ae165eb25aa0b1d /drivers/hwmon/Makefile | |
parent | shm: handle separate PID namespaces case (diff) | |
download | linux-4c677e2eefdba9c5bfc4474e2e91b26ae8458a1d.tar.xz linux-4c677e2eefdba9c5bfc4474e2e91b26ae8458a1d.zip |
shm: optimize locking and ipc_namespace getting
shm_lock() does a lookup of shm segment in shm_ids(ns).ipcs_idr, which
is redundant as we already know shmid_kernel address. An actual lock is
also not required for reads until we really want to destroy the segment.
exit_shm() and shm_destroy_orphaned() may avoid the loop by checking
whether there is at least one segment in current ipc_namespace.
The check of nsproxy and ipc_ns against NULL is redundant as exit_shm()
is called from do_exit() before the call to exit_notify(), so the
dereferencing current->nsproxy->ipc_ns is guaranteed to be safe.
Reported-by: Oleg Nesterov <oleg@redhat.com>
Signed-off-by: Vasiliy Kulikov <segoon@openwall.com>
Acked-by: Serge Hallyn <serge.hallyn@canonical.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/hwmon/Makefile')
0 files changed, 0 insertions, 0 deletions