summaryrefslogtreecommitdiffstats
path: root/fs/exofs/file.c
diff options
context:
space:
mode:
authorJason Baron <jbaron@akamai.com>2017-11-17 15:29:02 -0800
committerLinus Torvalds <torvalds@linux-foundation.org>2017-11-17 16:10:02 -0800
commit57a173bdf5baab48e8e78825c7366c634acd087c (patch)
treef55b20df760de9869b11ee620f1e87f5f96f9df6 /fs/exofs/file.c
parent2ae928a9441a3b5f13952e1e8a97d03cb23ea603 (diff)
downloadlinux-57a173bdf5baab48e8e78825c7366c634acd087c.tar.bz2
epoll: avoid calling ep_call_nested() from ep_poll_safewake()
ep_poll_safewake() is used to wakeup potentially nested epoll file descriptors. The function uses ep_call_nested() to prevent entering the same wake up queue more than once, and to prevent excessively deep wakeup paths (deeper than EP_MAX_NESTS). However, this is not necessary since we are already preventing these conditions during EPOLL_CTL_ADD. This saves extra function calls, and avoids taking a global lock during the ep_call_nested() calls. I have, however, left ep_call_nested() for the CONFIG_DEBUG_LOCK_ALLOC case, since ep_call_nested() keeps track of the nesting level, and this is required by the call to spin_lock_irqsave_nested(). It would be nice to remove the ep_call_nested() calls for the CONFIG_DEBUG_LOCK_ALLOC case as well, however its not clear how to simply pass the nesting level through multiple wake_up() levels without more surgery. In any case, I don't think CONFIG_DEBUG_LOCK_ALLOC is generally used for production. This patch, also apparently fixes a workload at Google that Salman Qazi reported by completely removing the poll_safewake_ncalls->lock from wakeup paths. Link: http://lkml.kernel.org/r/1507920533-8812-1-git-send-email-jbaron@akamai.com Signed-off-by: Jason Baron <jbaron@akamai.com> Acked-by: Davidlohr Bueso <dbueso@suse.de> Cc: Alexander Viro <viro@zeniv.linux.org.uk> Cc: Salman Qazi <sqazi@google.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'fs/exofs/file.c')
0 files changed, 0 insertions, 0 deletions