From patchwork Thu Dec 3 14:11:22 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mel Gorman X-Patchwork-Id: 11948945 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=-18.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, 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 20BF8C43211 for ; Thu, 3 Dec 2020 14:13:19 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id ACF9020705 for ; Thu, 3 Dec 2020 14:13:18 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org ACF9020705 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=techsingularity.net Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=1ZLr1ObO9PsTVOb8N1rWJi1otzv8+Ys/DWH+hSVarzU=; b=2Bv3DQYRbjML3Xe0zXqRBgNs/ typtbaNQQZE5O8Nz1m9NT23BDYjv9/fvOZ2d10NW+f2WoBiP+YgDcz54v4lKmz2jfTN/N/J8wNoA4 uAPJvlOGrlIXTElXr74NIog0AAvFmqem3CuCTkqufZ9UFzvyBougc8NwloB+8Qgih1X0RKRTYHAoK nnsVQoNe9Wt2AaDcCin0JKCZft8Zo6dI759nZOqY/T6En7kFokBKFGSj0K/6ZJz4OKHUzhH8hqnhp NZLgJ+44bEBgPGn7pzq4jwfPCWdo4cwePXg0spLahM8r/KL0+B91xIkUepDzo0C8aEBza5PobbYqm +JbLyz1mw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kkpKt-0003qq-8f; Thu, 03 Dec 2020 14:11:55 +0000 Received: from casper.infradead.org ([2001:8b0:10b:1236::1]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kkpKZ-0003lv-Ab for linux-arm-kernel@merlin.infradead.org; Thu, 03 Dec 2020 14:11:35 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description; bh=RKWjwt0ValWwD5pq+efQIOTaeFEdeNs/1sZsRbm/UUA=; b=m0yx1iMxnj1NRCUFsNmNfmoY1a Tl6HwZOMmgDfUHdSTc/rtz4QkLkLOo5+2uPEFh31z2pNwET8UrcS+47+oowPIj8EhaHj+3BysSnrn Jm8Yc704qxtQ4Rse6/tudewoWZYMPlT4TvBeIeV5qsLP1vM+8ctWK8pPfaLGmmgTfzLRKdKzqF6AN tF7hQ+klTFThSV6Q8jphHuYPm41FeBqGIUO5DW+XB5+hviLhjpBVUoYuLOcp9nzNKefig+c6DgwdG hOa2PYfZ0cSg6OWya77kDEs5YSHRsSH7YROLWT4Sw8DqN7y+jfskaU1IUn/dxBXPK3fMW+OH2c86N 4fG/R4nw==; Received: from outbound-smtp31.blacknight.com ([81.17.249.62]) by casper.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kkpKU-0005fv-MU for linux-arm-kernel@lists.infradead.org; Thu, 03 Dec 2020 14:11:33 +0000 Received: from mail.blacknight.com (pemlinmail03.blacknight.ie [81.17.254.16]) by outbound-smtp31.blacknight.com (Postfix) with ESMTPS id 8D989C0B10 for ; Thu, 3 Dec 2020 14:11:26 +0000 (GMT) Received: (qmail 22909 invoked from network); 3 Dec 2020 14:11:26 -0000 Received: from unknown (HELO stampy.112glenside.lan) (mgorman@techsingularity.net@[84.203.22.4]) by 81.17.254.9 with ESMTPA; 3 Dec 2020 14:11:26 -0000 From: Mel Gorman To: LKML Subject: [PATCH 08/10] sched/fair: Reintroduce SIS_AVG_CPU but in the context of SIS_PROP to reduce search depth Date: Thu, 3 Dec 2020 14:11:22 +0000 Message-Id: <20201203141124.7391-9-mgorman@techsingularity.net> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20201203141124.7391-1-mgorman@techsingularity.net> References: <20201203141124.7391-1-mgorman@techsingularity.net> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201203_141131_038599_DEBBC09E X-CRM114-Status: UNSURE ( 9.66 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Barry Song , Juri Lelli , Vincent Guittot , Peter Ziljstra , Aubrey Li , Ingo Molnar , Mel Gorman , Valentin Schneider , Linux-ARM Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Subject says it all but no supporting data at this time. This might help the hackbench case in isolation or throw other workloads under the bus. Final version will have proper data. Signed-off-by: Mel Gorman --- kernel/sched/fair.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 185fc6e28f8e..33ce65b67381 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -6024,6 +6024,14 @@ static int sis_search_depth(struct sched_domain *sd, struct sched_domain *this_s nr = div_u64(span_avg, avg_cost); else nr = 4; + + /* + * Throttle the depth search futher if average idle time is + * below the average cost. This is primarily to deal with + * the saturated case where searches are likely to fail. + */ + if (avg_idle < avg_cost) + nr >>= 1; } return nr;