Skip to content

Commit 0611a64

Browse files
dmantipovbrauner
authored andcommitted
eventpoll: prefer kfree_rcu() in __ep_remove()
In '__ep_remove()', prefer 'kfree_rcu()' over 'call_rcu()' with dummy 'epi_rcu_free()' callback. This follows commit d008960 ("fs: prefer kfree_rcu() in fasync_remove_entry()") and should not be backported to stable as well. Signed-off-by: Dmitry Antipov <dmantipov@yandex.ru> Link: https://lore.kernel.org/r/20240221112205.48389-2-dmantipov@yandex.ru Signed-off-by: Christian Brauner <brauner@kernel.org>
1 parent 4af6ccb commit 0611a64

1 file changed

Lines changed: 1 addition & 7 deletions

File tree

fs/eventpoll.c

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -678,12 +678,6 @@ static void ep_done_scan(struct eventpoll *ep,
678678
write_unlock_irq(&ep->lock);
679679
}
680680

681-
static void epi_rcu_free(struct rcu_head *head)
682-
{
683-
struct epitem *epi = container_of(head, struct epitem, rcu);
684-
kmem_cache_free(epi_cache, epi);
685-
}
686-
687681
static void ep_get(struct eventpoll *ep)
688682
{
689683
refcount_inc(&ep->refcount);
@@ -767,7 +761,7 @@ static bool __ep_remove(struct eventpoll *ep, struct epitem *epi, bool force)
767761
* ep->mtx. The rcu read side, reverse_path_check_proc(), does not make
768762
* use of the rbn field.
769763
*/
770-
call_rcu(&epi->rcu, epi_rcu_free);
764+
kfree_rcu(epi, rcu);
771765

772766
percpu_counter_dec(&ep->user->epoll_watches);
773767
return ep_refcount_dec_and_test(ep);

0 commit comments

Comments
 (0)