diff options
| author | Eric Sandeen <sandeen@redhat.com> | 2025-02-27 20:41:08 +0300 |
|---|---|---|
| committer | Christian Brauner <brauner@kernel.org> | 2025-03-01 13:02:35 +0300 |
| commit | f13abc1e8e1a3b7455511c4e122750127f6bc9b0 (patch) | |
| tree | 66e795bbc8f75e76111228f9dbeb5930353bb668 /tools/perf/scripts/python/libxed.py | |
| parent | e249056c91a2f14ee40de2bf24cf72d8e68101f5 (diff) | |
| download | linux-f13abc1e8e1a3b7455511c4e122750127f6bc9b0.tar.xz | |
watch_queue: fix pipe accounting mismatch
Currently, watch_queue_set_size() modifies the pipe buffers charged to
user->pipe_bufs without updating the pipe->nr_accounted on the pipe
itself, due to the if (!pipe_has_watch_queue()) test in
pipe_resize_ring(). This means that when the pipe is ultimately freed,
we decrement user->pipe_bufs by something other than what than we had
charged to it, potentially leading to an underflow. This in turn can
cause subsequent too_many_pipe_buffers_soft() tests to fail with -EPERM.
To remedy this, explicitly account for the pipe usage in
watch_queue_set_size() to match the number set via account_pipe_buffers()
(It's unclear why watch_queue_set_size() does not update nr_accounted;
it may be due to intentional overprovisioning in watch_queue_set_size()?)
Fixes: e95aada4cb93d ("pipe: wakeup wr_wait after setting max_usage")
Signed-off-by: Eric Sandeen <sandeen@redhat.com>
Link: https://lore.kernel.org/r/206682a8-0604-49e5-8224-fdbe0c12b460@redhat.com
Signed-off-by: Christian Brauner <brauner@kernel.org>
Diffstat (limited to 'tools/perf/scripts/python/libxed.py')
0 files changed, 0 insertions, 0 deletions
