On Monday, November 12, 2018 at 5:02:44 PM UTC-8, 
satyajit.deshm...@nutanix.com wrote:
>
> Hello,
>
> We had a use case, where we had to log into multiple iSCSI targets in 
> parallel. And it was important for these operations to complete in a timely 
> manner.
> We found 2 major codes that caused large delays in the login command:
> 1. idbm_lock() and idbm_unlock() APIs
> 2. session_is_running() duplicate session checking code. This performs the 
> entire sysfs scan for each logged in target and results in O(n^2) sysfs 
> lookups, causing huge delays, when there are multiple iSCSI targets logged 
> into.
>
> We have a patch for issue #1 above and have attached it.
> This definitely optimized the login times, as the code now does not 
> perform redundant sleeps.
> Would be great if someone could review this patch, and see if this could 
> be generally useful to optimize the login times.
>
>
LOL. I spent almost a week, a while ago, looking at issue #2, but my eyes 
glossed over and my laziness won out. As you point out, the sysfs stuff 
does not scale, and already some users of open-iscsi are being bit by this.

For issue#1, I like the idea of getting better locking, but your suggested 
code has some issues:

1. It does not time out, ever (unless sent a signal). The original code 
times out after 300 seconds. This may not be an issue in practice, since 
(theoretically) if a process that has this lock goes away, the lock goes 
away. And if we assume that all other users of the lock play fair, this may 
be ok.

2. It does not allow lock "stacking". The current code just increments a 
counter if a second call to lock the process is done. But I don't think 
your code keeps track of number of locks. With the old code, two locks then 
one unlock would leave it locked, but in your code it would leave it 
unlocked. So it needs "stacking".

3. The old code creates the LOCK_DIR if needed. I'm not sure anybody else 
does, so we'd have to make sure.

Thank you, as this spurs me to look at this code again. I look forward to 
seeing your reply.

Thanks,
> Satyajit
>

-- 
You received this message because you are subscribed to the Google Groups 
"open-iscsi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to open-iscsi+unsubscr...@googlegroups.com.
To post to this group, send email to open-iscsi@googlegroups.com.
Visit this group at https://groups.google.com/group/open-iscsi.
For more options, visit https://groups.google.com/d/optout.

Reply via email to