All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC PATCH 0/2] eventpoll: scale nested leaf additions
@ 2026-10-19 18:29 Pranith Kumar
  2026-10-19 18:29 ` [RFC PATCH 1/2] eventpoll: parallelize independent " Pranith Kumar
  2026-10-19 18:29 ` [RFC PATCH 2/2] eventpoll: separate nested-check objects by cache line Pranith Kumar
  0 siblings, 2 replies; 3+ messages in thread
From: Pranith Kumar @ 2026-10-19 18:29 UTC (permalink / raw)
  To: target-maintainer
  Cc: Pranith Kumar, Alexander Viro, Christian Brauner, Jan Kara,
	linux-fsdevel, linux-kernel

Adding an ordinary file to an epoll watched by another epoll takes
epnested_mutex. Workers adding different files to different epoll
instances therefore serialize on one global lock, even though their
reverse-path checks do not conflict.

The first patch freezes the epoll topology with a shared rwsem during
these leaf additions and uses a hashed per-file mutex to serialize
checks for the same target file. An epoll topology change takes the
rwsem for write and retains epnested_mutex for cycle and path checks.
The second patch separates the generation stamp and topology rwsem
onto cache lines of their own on SMP builds. In the tested ARM64
layout, this also separates them from epnested_mutex.

The series was built and tested on linux-next tag next-20261016
(7.3-rc7 based). Four workers each ran 2,000 epoll
add/delete pairs in nested and flat modes. Throughput:

  Kernel                 Nested pairs/s  Gain % Flat pairs/s Gain %
  Unpatched linux-next        1,558,641    0.0%    6,736,037  0.00%
  Parallel additions          5,325,959 +241.7%    6,771,375 +0.52%
  Parallel + alignment        5,487,081 +252.0%    6,780,276 +0.66%

This patch was developed with AI assistance.

Pranith Kumar (2):
  eventpoll: parallelize independent nested leaf additions
  eventpoll: separate nested-check objects by cache line

 fs/eventpoll.c | 116 ++++++++++++++++++++++++++++++++++++++-----------
 1 file changed, 90 insertions(+), 26 deletions(-)

base-commit: 2efb7a11f1aa4d2dc285fe2680cca22cb9f72f64
-- 
2.47.3

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-10-19 18:29 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-19 18:29 [RFC PATCH 0/2] eventpoll: scale nested leaf additions Pranith Kumar
2026-10-19 18:29 ` [RFC PATCH 1/2] eventpoll: parallelize independent " Pranith Kumar
2026-10-19 18:29 ` [RFC PATCH 2/2] eventpoll: separate nested-check objects by cache line Pranith Kumar

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.