--- x/fs/eventpoll.c +++ y/fs/eventpoll.c @@ -456,14 +456,21 @@ static struct kmem_cache *pwq_cache __ro struct epitems_head { struct hlist_head epitems; struct epitems_head *next; + struct rcu_head rcu; }; static struct kmem_cache *ephead_cache __ro_after_init; +static void __free_ephead(struct rcu_head *r) +{ + struct epitems_head *head = container_of(r, struct epitems_head, rcu); + kmem_cache_free(ephead_cache, head); +} + static inline void free_ephead(struct epitems_head *head) { if (head) - kmem_cache_free(ephead_cache, head); + call_rcu(&head->rcu, __free_ephead); } static void list_file(struct file *file, struct ep_ctl_ctx *ctx)