diff options
| author | Max Kellermann <[email protected]> | 2025-09-12 00:06:09 +0000 |
|---|---|---|
| committer | Jens Axboe <[email protected]> | 2025-09-15 16:46:13 +0000 |
| commit | cd4ea81be3eb94047ad023c631afd9bd6c295400 (patch) | |
| tree | 74ce3a9f2ce1b6fc5dba7891cfbb5968f32be562 /drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c | |
| parent | io_uring/kbuf: always use READ_ONCE() to read ring provided buffer lengths (diff) | |
| download | kernel-cd4ea81be3eb94047ad023c631afd9bd6c295400.tar.gz kernel-cd4ea81be3eb94047ad023c631afd9bd6c295400.zip | |
io_uring/io-wq: fix `max_workers` breakage and `nr_workers` underflow
Commit 88e6c42e40de ("io_uring/io-wq: add check free worker before
create new worker") reused the variable `do_create` for something
else, abusing it for the free worker check.
This caused the value to effectively always be `true` at the time
`nr_workers < max_workers` was checked, but it should really be
`false`. This means the `max_workers` setting was ignored, and worse:
if the limit had already been reached, incrementing `nr_workers` was
skipped even though another worker would be created.
When later lots of workers exit, the `nr_workers` field could easily
underflow, making the problem worse because more and more workers
would be created without incrementing `nr_workers`.
The simple solution is to use a different variable for the free worker
check instead of using one variable for two different things.
Cc: [email protected]
Fixes: 88e6c42e40de ("io_uring/io-wq: add check free worker before create new worker")
Signed-off-by: Max Kellermann <[email protected]>
Reviewed-by: Fengnan Chang <[email protected]>
Signed-off-by: Jens Axboe <[email protected]>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_irq.c')
0 files changed, 0 insertions, 0 deletions
