The patch titled Subject: epoll: loosen irq safety in ep_poll_callback() has been added to the -mm tree. Its filename is epoll-loosen-irq-safety-in-ep_poll_callback.patch This patch should soon appear at http://ozlabs.org/~akpm/mmots/broken-out/epoll-loosen-irq-safety-in-ep_poll_callback.patch and later at http://ozlabs.org/~akpm/mmotm/broken-out/epoll-loosen-irq-safety-in-ep_poll_callback.patch Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/process/submit-checklist.rst when testing your code *** The -mm tree is included into linux-next and is updated there every 3-4 working days ------------------------------------------------------ From: Roman Penyaev <rpenyaev@xxxxxxx> Subject: epoll: loosen irq safety in ep_poll_callback() Callers of the ep_poll_callback() (all set of wake_up_*poll()) disable interrupts, so no need to save/restore irq flags. Link: http://lkml.kernel.org/r/20190103150104.17128-3-rpenyaev@xxxxxxx Signed-off-by: Roman Penyaev <rpenyaev@xxxxxxx> Reviewed-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> Cc: Davidlohr Bueso <dbueso@xxxxxxx> Cc: Jason Baron <jbaron@xxxxxxxxxx> Cc: Al Viro <viro@xxxxxxxxxxxxxxxxxx> Cc: "Paul E. McKenney" <paulmck@xxxxxxxxxxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- fs/eventpoll.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) --- a/fs/eventpoll.c~epoll-loosen-irq-safety-in-ep_poll_callback +++ a/fs/eventpoll.c @@ -1124,13 +1124,18 @@ struct file *get_epoll_tfile_raw_ptr(str static int ep_poll_callback(wait_queue_entry_t *wait, unsigned mode, int sync, void *key) { int pwake = 0; - unsigned long flags; struct epitem *epi = ep_item_from_wait(wait); struct eventpoll *ep = epi->ep; __poll_t pollflags = key_to_poll(key); int ewake = 0; - spin_lock_irqsave(&ep->wq.lock, flags); + /* + * Called by irq context or interrupts are disabled by the wake_up_*poll + * callers. + */ + lockdep_assert_irqs_disabled(); + + spin_lock(&ep->wq.lock); ep_set_busy_poll_napi_id(epi); @@ -1207,7 +1212,7 @@ static int ep_poll_callback(wait_queue_e pwake++; out_unlock: - spin_unlock_irqrestore(&ep->wq.lock, flags); + spin_unlock(&ep->wq.lock); /* We have to call this outside the lock */ if (pwake) _ Patches currently in -mm which might be from rpenyaev@xxxxxxx are epoll-make-sure-all-elements-in-ready-list-are-in-fifo-order.patch epoll-loosen-irq-safety-in-ep_poll_callback.patch epoll-unify-awaking-of-wakeup-source-on-ep_poll_callback-path.patch epoll-use-rwlock-in-order-to-reduce-ep_poll_callback-contention.patch