SCST-project / scst

SCST is a SCSI target software stack that allows to export any block device or file via iSCSI, FC or RDMA (SRP).
http://scst.sourceforge.net
88 stars 34 forks source link

scst_sess_free_tgt_devs takes much time if there are many scst_tgt_dev-s #229

Open lvainblat opened 6 months ago

lvainblat commented 6 months ago

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.

bvanassche commented 6 months ago

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