summaryrefslogtreecommitdiff
path: root/drivers/s390
diff options
context:
space:
mode:
authorVineeth Vijayan <vneethv@linux.ibm.com>2020-06-18 16:42:45 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-09-03 11:19:25 +0200
commitc86b5b56fb1b356b8f71973b6ac6bd9bfb842f2c (patch)
tree18993be9a7c7dcc4faad169013a6d278a5c3a87d /drivers/s390
parent35af8a3a8402aa8629674e8f101608d3643f1495 (diff)
s390/cio: add cond_resched() in the slow_eval_known_fn() loop
[ Upstream commit 0b8eb2ee9da1e8c9b8082f404f3948aa82a057b2 ] 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 <oberpar@linux.ibm.com> Signed-off-by: Vineeth Vijayan <vneethv@linux.ibm.com> Signed-off-by: Heiko Carstens <hca@linux.ibm.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'drivers/s390')
-rw-r--r--drivers/s390/cio/css.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/s390/cio/css.c b/drivers/s390/cio/css.c
index 8ecc956ecb59..370a3a2c6de7 100644
--- a/drivers/s390/cio/css.c
+++ b/drivers/s390/cio/css.c
@@ -529,6 +529,11 @@ static int slow_eval_known_fn(struct subchannel *sch, void *data)
rc = css_evaluate_known_subchannel(sch, 1);
if (rc == -EAGAIN)
css_schedule_eval(sch->schid);
+ /*
+ * The loop might take long time for platforms with lots of
+ * known devices. Allow scheduling here.
+ */
+ cond_resched();
}
return 0;
}