This repository has been archived by the owner on Jun 18, 2024. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
kernfs: convert kernfs_idr_lock to an irq safe raw spinlock
bpf_cgroup_from_id() (provided by sched-ext) needs to acquire kernfs_idr_lock and it can be used in the scheduler dispatch path with rq->_lock held. But any kernfs function that is acquiring kernfs_idr_lock can be interrupted by a scheduler tick, that would try to acquire rq->_lock, triggering the following deadlock scenario: CPU0 CPU1 ---- ---- lock(kernfs_idr_lock); lock(rq->__lock); lock(kernfs_idr_lock); <Interrupt> lock(rq->__lock); More in general, considering that bpf_cgroup_from_id() is provided as a kfunc, potentially similar deadlock conditions can be triggered from any kprobe/tracepoint/fentry. For this reason, in order to prevent any potential deadlock scenario, convert kernfs_idr_lock to a raw irq safe spinlock. Signed-off-by: Andrea Righi <andrea.righi@canonical.com>
- Loading branch information