Blob Blame History Raw
From: Vineeth Vijayan <vneethv@linux.ibm.com>
Date: Thu, 18 Jun 2020 16:42:45 +0200
Subject: s390/cio: add cond_resched() in the slow_eval_known_fn() loop
Git-commit: 0b8eb2ee9da1e8c9b8082f404f3948aa82a057b2
Patch-mainline: v5.9-rc2
References: bsc#1177805 LTC#188737

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>
Acked-by: Petr Tesarik <ptesarik@suse.com>
---
 drivers/s390/cio/css.c |    5 +++++
 1 file changed, 5 insertions(+)

--- a/drivers/s390/cio/css.c
+++ b/drivers/s390/cio/css.c
@@ -545,6 +545,11 @@ static int slow_eval_known_fn(struct sub
 		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;
 }