[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <cover.1752581388.git.namcao@linutronix.de>
Date: Tue, 15 Jul 2025 14:46:33 +0200
From: Nam Cao <namcao@...utronix.de>
To: Christian Brauner <brauner@...nel.org>,
Linus Torvalds <torvalds@...ux-foundation.org>,
Xi Ruoyao <xry111@...111.site>,
Frederic Weisbecker <frederic@...nel.org>,
Valentin Schneider <vschneid@...hat.com>,
Alexander Viro <viro@...iv.linux.org.uk>,
Jan Kara <jack@...e.cz>,
Sebastian Andrzej Siewior <bigeasy@...utronix.de>,
John Ogness <john.ogness@...utronix.de>,
K Prateek Nayak <kprateek.nayak@....com>,
Clark Williams <clrkwllms@...nel.org>,
Steven Rostedt <rostedt@...dmis.org>,
linux-fsdevel@...r.kernel.org,
linux-kernel@...r.kernel.org,
linux-rt-devel@...ts.linux.dev,
linux-rt-users@...r.kernel.org,
Joe Damato <jdamato@...tly.com>,
Martin Karsten <mkarsten@...terloo.ca>,
Jens Axboe <axboe@...nel.dk>
Cc: Nam Cao <namcao@...utronix.de>
Subject: [PATCH v4 0/1] eventpoll: Fix priority inversion problem
Hi,
This v4 is the follow-up to v3 at:
https://lore.kernel.org/linux-fsdevel/20250527090836.1290532-1-namcao@linutronix.de/
which resolves a priority inversion problem.
The v3 patch was merged, but then got reverted due to regression.
The direction of v3 was wrong in the first place. It changed the
eventpoll's event list to be lockless, making the code harder to read. I
stared at the patch again, but still couldn't figure out what the bug is.
The performance numbers were indeed impressive with lockless, but the
numbers are from a benchmark, which is unclear whether it really reflects
real workload.
This v4 takes a completely different approach: it converts the rwlock to
spinlock. Unfortunately, unlike rwlock, spinlock does not allow concurrent
readers. This patch therefore reduces the performance numbers.
I have some optimization tricks to reduce spinlock contention and bring the
numbers back. But Linus appeared and declared that epoll's performance
shouldn't be the priority. So I decided not to post those optimization
patches.
For those who are curious, the optimization patches are at:
git@...hub.com:covanam/linux.git epoll_optimize
be warned that they have not been well-tested.
The regression with v3 turned me into paranoid mode now. So I made this v4
as obvious as I can.
Nam Cao (1):
eventpoll: Replace rwlock with spinlock
fs/eventpoll.c | 139 +++++++++----------------------------------------
1 file changed, 26 insertions(+), 113 deletions(-)
--
2.39.5
Powered by blists - more mailing lists