diff options
| author | Zqiang <qiang.zhang@linux.dev> | 2026-07-09 18:06:02 +0800 |
|---|---|---|
| committer | Paul E. McKenney <paulmck@kernel.org> | 2026-08-11 17:29:38 -0700 |
| commit | 78a38cbf6f20bc8247e93d1149f97c12dba9fbfb (patch) | |
| tree | 6ac7eb6c0266b5f3c473875935941cabdf31a821 /scripts/basic | |
| parent | 3f90d04303c11a5006059016fc1ebedcbbff682d (diff) | |
| download | linux-78a38cbf6f20bc8247e93d1149f97c12dba9fbfb.tar.gz linux-78a38cbf6f20bc8247e93d1149f97c12dba9fbfb.zip | |
srcu: Queue sdp->work when the delay timer is successfully deleted
In the cleanup_srcu_struct() function, when iterating over per-cpu's
srcu_data, timer_delete_sync(&sdp->delay_work) is called to cancel the
delayed work before doing flush_work(&sdp->work).
However, suppose that timer_delete_sync() returns 1, which means that it
successfully deleted an pending timer before it had a chance to fire.
But this also means that the sdp->work will not be queued, so that the
subsequent flush_work(&sdp->work) will returns immediately without waiting
for anything. Taken together, all of this means that any recently queued
SRCU callbacks to not be invoked, which can result in memory leaks,
hangs, or worse.
Fix this by checking the return value of timer_delete_sync(), if it
returns 1, explicitly queue sdp->work so that the callbacks will be
invoked and the following flush_work() will correctly wait for all of
those callbacks to finish executing.
[ Zqiang: Apply feedback from Breno Leitao and kernel test robot. ]
Signed-off-by: Zqiang <qiang.zhang@linux.dev>
Tested-by: kernel test robot <oliver.sang@intel.com>
Reviewed-by: Frederic Weisbecker <frederic@kernel.org>
Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
Diffstat (limited to 'scripts/basic')
0 files changed, 0 insertions, 0 deletions
