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.
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