diff options
| author | Shakeel Butt <shakeel.butt@linux.dev> | 2026-09-12 19:14:53 -0700 |
|---|---|---|
| committer | Christian Brauner <brauner@kernel.org> | 2026-09-25 16:59:11 +0200 |
| commit | 09452e5114bd59ea79e05b5ca4579df898178bfd (patch) | |
| tree | 6ef065dd17298328bf16285ae5c5f686748aced9 /tools/lib/python | |
| parent | 8b64f32fee95a977b137b0dd5050bc68d93f6f60 (diff) | |
| download | linux-next-09452e5114bd59ea79e05b5ca4579df898178bfd.tar.gz linux-next-09452e5114bd59ea79e05b5ca4579df898178bfd.zip | |
kernfs: free the old name outside kernfs_rwsem
kernfs_rename_ns() frees the replaced name with kfree_rcu_mightsleep()
while still holding the kernfs_rwsem write lock. If the batching
allocation fails, which is what happens under memory pressure,
kvfree_call_rcu() falls back to a full synchronize_rcu() before freeing.
A rename can then wait out a grace period with the write lock held, and
every create, remove and rename in the hierarchy waits with it.
The name is already unpublished by then, so nothing needs the free to
happen under the lock. Move it past the unlock.
Signed-off-by: Shakeel Butt <shakeel.butt@linux.dev>
Link: https://patch.msgid.link/20260913021453.21507-4-shakeel.butt@linux.dev
Acked-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
Diffstat (limited to 'tools/lib/python')
0 files changed, 0 insertions, 0 deletions
