summaryrefslogtreecommitdiffstats
path: root/fs
diff options
context:
space:
mode:
authorDavidlohr Bueso <dave@stgolabs.net>2016-12-15 00:06:49 +0100
committerLinus Torvalds <torvalds@linux-foundation.org>2016-12-15 01:04:08 +0100
commit370b262c896e5565b271a3ea3abee4d0914ba443 (patch)
tree7463704f20a1f8d00d717b34ca77a95b56a774fe /fs
parentipc/sem: simplify wait-wake loop (diff)
downloadlinux-370b262c896e5565b271a3ea3abee4d0914ba443.tar.xz
linux-370b262c896e5565b271a3ea3abee4d0914ba443.zip
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 'fs')
0 files changed, 0 insertions, 0 deletions