The following patch fixes a problem where the CPU becomes compute bound when rediscovering targets, when there are hundreds of sessions.
When his occurs, most of the time is spent in the function iscsi_sysfs_for_each_session(). This function does a scandir(), sorted alphabetically, to get a list of sessions, then scans that list looking for a match. When there are hundreds of sesions this can take forever. This patch saves the current session and then ensures that this session sorted to the front of the list. Testing shows that CPU usage goes from near 100% to near 0% when running cable plug tests with hundreds of sessions. Signed-off-by: Lee Duncan <[email protected]> -- 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 [email protected]. To post to this group, send email to [email protected]. Visit this group at http://groups.google.com/group/open-iscsi. For more options, visit https://groups.google.com/d/optout.
