Commit 05070cd
cgroup: reduce cgroup_file_kn_lock hold time in cgroup_file_notify()
cgroup_file_notify() calls kernfs_notify() while holding the global
cgroup_file_kn_lock. kernfs_notify() does non-trivial work including
wake_up_interruptible() and acquisition of a second global spinlock
(kernfs_notify_lock), inflating the hold time.
Take a kernfs_get() reference under the lock and call kernfs_notify()
after dropping it, following the pattern from cgroup_file_show().
Reported-by: Jakub Kicinski <[email protected]>
Signed-off-by: Shakeel Butt <[email protected]>
Signed-off-by: Tejun Heo <[email protected]>1 parent 5b30afc commit 05070cd
1 file changed
Lines changed: 8 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4632 | 4632 | | |
4633 | 4633 | | |
4634 | 4634 | | |
| 4635 | + | |
4635 | 4636 | | |
4636 | 4637 | | |
4637 | 4638 | | |
| |||
4641 | 4642 | | |
4642 | 4643 | | |
4643 | 4644 | | |
4644 | | - | |
| 4645 | + | |
| 4646 | + | |
4645 | 4647 | | |
4646 | 4648 | | |
4647 | 4649 | | |
4648 | 4650 | | |
| 4651 | + | |
| 4652 | + | |
| 4653 | + | |
| 4654 | + | |
| 4655 | + | |
4649 | 4656 | | |
4650 | 4657 | | |
4651 | 4658 | | |
| |||
0 commit comments