ib_srpt: Reduce CPU load caused by stopping a large number of sessions

Avoid that stopping a large number of SRPT sessions causes a high
context switch frequency and hence a high CPU load.


git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@6840 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
Bart Van Assche
2016-03-24 17:15:23 +00:00
parent 63768c8715
commit 8695583ee9

View File

@@ -2187,8 +2187,12 @@ static int srpt_compl_thread(void *arg)
ch->sess_name, ch->qp->qp_num);
scst_unregister_session(ch->sess, false, srpt_unreg_sess);
while (!kthread_should_stop())
schedule_timeout(DIV_ROUND_UP(HZ, 10));
set_current_state(TASK_INTERRUPTIBLE);
while (!kthread_should_stop()) {
schedule();
set_current_state(TASK_INTERRUPTIBLE);
}
__set_current_state(TASK_RUNNING);
return 0;
}