Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

proc_loadavg: fix ABBA deadlock between read/refresh #606

Merged
merged 1 commit into from
Aug 10, 2023

Conversation

mihalicyn
Copy link
Member

Idea of this fix is to always take nested locks in the same order.

At the same time, we adding an extra check to insert_node() that prevents adding a new load_node with the same cgroup (->cg field) value. This is theoretically possible because we don't hold .rilock/.lock when we call insert_node().

It looks like we have this issue from the initial
implementation of loadavg virtualization and it's hardly reproducible that's why we weren't able to notice it.

Fixes: #605

Idea of this fix is to always take nested locks in
the same order.

At the same time, we adding an extra check to insert_node()
that prevents adding a new load_node with the same cgroup
(->cg field) value. This is theoretically possible because
we don't hold .rilock/.lock when we call insert_node().

It looks like we have this issue from the initial
implementation of loadavg virtualization and it's hardly
reproducible that's why we weren't able to notice it.

Fixes: lxc#605
Signed-off-by: Alexander Mikhalitsyn <[email protected]>
@brauner brauner merged commit 587c661 into lxc:main Aug 10, 2023
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

There is a deadlock on loadavg
2 participants