lxc / lxcfs

FUSE filesystem for LXC
https://linuxcontainers.org/lxcfs
Other
1.02k stars 246 forks source link

There is a deadlock on loadavg #605

Closed hdp7891000 closed 11 months ago

hdp7891000 commented 11 months ago

version: 5.0.3

thread A                                                                                                  thread B
proc_loadavg_read                                                                                         load_begin
    locate_node                                                                                               pthread_mutex_lock(&load_hash[i].lock)
        pthread_rwlock_rdlock(&load_hash[locate].rdlock);                                                     del_node
    insert_node                                                                                                   pthread_rwlock_wrlock(&load_hash[locate].rdlock);
        pthread_mutex_lock(&load_hash[locate].lock);
mihalicyn commented 11 months ago

Hi @hdp7891000!

Thanks for report. Have you met this deadlock on a real workload? I'll take a look on this carefully and send a fix if you don't want to prepare the fix by yourself.

hdp7891000 commented 11 months ago

Yes, I just met it online, if any information is needed, I can provide it again. I don't want to fix it myself, thanks for your help.

mihalicyn commented 9 months ago

Hi @hdp7891000

Did you get a chance to test the fix?

hdp7891000 commented 8 months ago

Hi @hdp7891000

Did you get a chance to test the fix?

The patch works fine, no more deadlocks, thank you!