Skip to content

Commit 0b8eb2e

Browse files
vneethvhcahca
authored andcommitted
s390/cio: add cond_resched() in the slow_eval_known_fn() loop
The scanning through subchannels during the time of an event could take significant amount of time in case of platforms with lots of known subchannels. This might result in higher scheduling latencies for other tasks especially on systems with a single CPU. Add cond_resched() call, as the loop in slow_eval_known_fn() can be executed for a longer duration. Reviewed-by: Peter Oberparleiter <[email protected]> Signed-off-by: Vineeth Vijayan <[email protected]> Signed-off-by: Heiko Carstens <[email protected]>
1 parent 9123e3a commit 0b8eb2e

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

drivers/s390/cio/css.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -677,6 +677,11 @@ static int slow_eval_known_fn(struct subchannel *sch, void *data)
677677
rc = css_evaluate_known_subchannel(sch, 1);
678678
if (rc == -EAGAIN)
679679
css_schedule_eval(sch->schid);
680+
/*
681+
* The loop might take long time for platforms with lots of
682+
* known devices. Allow scheduling here.
683+
*/
684+
cond_resched();
680685
}
681686
return 0;
682687
}

0 commit comments

Comments
 (0)