summaryrefslogtreecommitdiffstats
path: root/mm
diff options
context:
space:
mode:
authorDavidlohr Bueso <dave@stgolabs.net>2016-12-14 15:06:49 -0800
committerLinus Torvalds <torvalds@linux-foundation.org>2016-12-14 16:04:08 -0800
commit370b262c896e5565b271a3ea3abee4d0914ba443 (patch)
tree7463704f20a1f8d00d717b34ca77a95b56a774fe /mm
parentb5fa01a22e4ba9e3ca6de7cb94c3d21e42da449c (diff)
downloadop-kernel-dev-370b262c896e5565b271a3ea3abee4d0914ba443.zip
op-kernel-dev-370b262c896e5565b271a3ea3abee4d0914ba443.tar.gz
ipc/sem: avoid idr tree lookup for interrupted semop
We can avoid the idr tree lookup (albeit possibly avoiding idr_find_fast()) when being awoken in EINTR, as the semid will not change in this context while blocked. Use the sma pointer directly and take the sem_lock, then re-check for RMID races. We continue to re-check the queue.status with the lock held such that we can detect situations where we where are dealing with a spurious wakeup but another task that holds the sem_lock updated the queue.status while we were spinning for it. Once we take the lock it obviously won't change again. Being the only caller, get rid of sem_obtain_lock() altogether. Link: http://lkml.kernel.org/r/1478708774-28826-3-git-send-email-dave@stgolabs.net Signed-off-by: Davidlohr Bueso <dbueso@suse.de> Cc: Manfred Spraul <manfred@colorfullife.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud