scst_sess_free_tgt_devs() removes all tgt_dev-s of the session, and for every tgt_dev it issues synchronize_rcu().
Single synchronize_rcu() may take up to 10 ms, if target has 1000 devices, it will take 10sec to free all tgt_devs.
If possible, need to call synchronize_rcu() only once, out of the loop.
Another possibility is to use call_rcu() to invoke scst_free_tgt_dev(). That would allow to remove the synchronize_rcu() call from scst_sess_free_tgt_devs().
scst_sess_free_tgt_devs() removes all tgt_dev-s of the session, and for every tgt_dev it issues synchronize_rcu(). Single synchronize_rcu() may take up to 10 ms, if target has 1000 devices, it will take 10sec to free all tgt_devs. If possible, need to call synchronize_rcu() only once, out of the loop.