Details
-
Bug
-
Resolution: Fixed
-
Minor
-
None
-
3
-
15022
Description
the following code from class_cleanup():
/* wait for already-arrived-connections to finish. */ while (obd->obd_conn_inprogress > 0) { spin_unlock(&obd->obd_dev_lock); cond_resched(); spin_lock(&obd->obd_dev_lock); } spin_unlock(&obd->obd_dev_lock);
contains at least two defects (if not going to substitute busy loop waiting by another more suitable synchronisation mechanism) :
- spinlocks are not necessary for atomic access to obd_conn_inprogress field, reading is already atomic.
- yield() should be used instead of cond_resched()