From patchwork Tue Sep 1 15:09:55 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 310455 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7882CC43461 for ; Tue, 1 Sep 2020 15:42:07 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 43B78206EB for ; Tue, 1 Sep 2020 15:42:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1598974927; bh=i00RryqNd79GBkkS/0eKB14jaLHW8lpO6MOMluTgeKw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=AZsj321brZluKoZXZpCfECz9xokFE279dz7WZPdLl81uA//SigrAx0T9r37JzuVlR yWIsWP8asoujOsqen7y/4Txto3z2wPkWrmIjXcLXpJT2U4+UpAJaEGS97N0Rp9sga6 ZVx1z1P/k22+vf+hb6mIu1jG0/syK/YzuRkwK3Bw= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728832AbgIAPmG (ORCPT ); Tue, 1 Sep 2020 11:42:06 -0400 Received: from mail.kernel.org ([198.145.29.99]:54524 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730497AbgIAPmD (ORCPT ); Tue, 1 Sep 2020 11:42:03 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id C32C02064B; Tue, 1 Sep 2020 15:41:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1598974917; bh=i00RryqNd79GBkkS/0eKB14jaLHW8lpO6MOMluTgeKw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=2iPdSGZq+aacsm1KpSCtLgLgSPk41D9oxkNi5OKUOkRIe4dcNpNwj9V18E+ag/kmL ICGEGBGJ1bAh6QnJLw70yUs/Soh5bTf8Tp4NpdMC+EDaaW+yPvUVTUizFw5i6s5c9R 9rToMGoKcoItGYLx3ZTCEr9Ul0bC3n4bUnGyp2EI= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Peter Oberparleiter , Vineeth Vijayan , Heiko Carstens , Sasha Levin Subject: [PATCH 5.8 139/255] s390/cio: add cond_resched() in the slow_eval_known_fn() loop Date: Tue, 1 Sep 2020 17:09:55 +0200 Message-Id: <20200901151007.374245138@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200901151000.800754757@linuxfoundation.org> References: <20200901151000.800754757@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Vineeth Vijayan [ 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 Signed-off-by: Vineeth Vijayan Signed-off-by: Heiko Carstens Signed-off-by: Sasha Levin --- drivers/s390/cio/css.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/s390/cio/css.c b/drivers/s390/cio/css.c index 94edbb33d0d1f..aca022239b333 100644 --- a/drivers/s390/cio/css.c +++ b/drivers/s390/cio/css.c @@ -677,6 +677,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; }