mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-07-27 14:29:59 -04:00
fs/pipe: write to ->poll_usage only once
Both GNU and BSD makes share a "token pipe" between their instances, as a result a -j $BIGNUM invocation results in multicore perf problems in the poll handler. Avoiding the store will reduce it a little bit. However, the crux of the problem is the locked queuing up in poll_wait(). Signed-off-by: Mateusz Guzik <mjguzik@gmail.com> Link: https://patch.msgid.link/20260516021852.256932-1-mjguzik@gmail.com Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
This commit is contained in:
committed by
Christian Brauner
parent
50d377ef12
commit
7dc6acb3d5
@@ -664,7 +664,8 @@ pipe_poll(struct file *filp, poll_table *wait)
|
||||
union pipe_index idx;
|
||||
|
||||
/* Epoll has some historical nasty semantics, this enables them */
|
||||
WRITE_ONCE(pipe->poll_usage, true);
|
||||
if (unlikely(!READ_ONCE(pipe->poll_usage)))
|
||||
WRITE_ONCE(pipe->poll_usage, true);
|
||||
|
||||
/*
|
||||
* Reading pipe state only -- no need for acquiring the semaphore.
|
||||
|
||||
Reference in New Issue
Block a user