From patchwork Thu Apr 16 13:21:44 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 227562 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=-9.8 required=3.0 tests=DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable 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 D98BBC2BB55 for ; Thu, 16 Apr 2020 15:47:08 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B5E4421927 for ; Thu, 16 Apr 2020 15:47:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1587052028; bh=b0mQ4z0wqoBcbwo6tGPHmVziT4WViLYPWS9IMTkTYEw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=qQ4XtfJz7mKhc1EkEqgA/9ILZncUc9gJPxPqTHOsaFFnC79reWEqpuDj0x+D5Jnj/ ULM7RBQtyH3TyTDHEB1CQ5xzqLLuhAGDykgWQTKE0kTp9o+pWHx2nyZtylKV7lo5AE Ixnv5rqjTNdGvQ6Rr1E6UAvMazGTDETStPyOHCac= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2896894AbgDPNeL (ORCPT ); Thu, 16 Apr 2020 09:34:11 -0400 Received: from mail.kernel.org ([198.145.29.99]:45268 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2896806AbgDPNdx (ORCPT ); Thu, 16 Apr 2020 09:33:53 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (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 2AEBA21D91; Thu, 16 Apr 2020 13:33:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1587044032; bh=b0mQ4z0wqoBcbwo6tGPHmVziT4WViLYPWS9IMTkTYEw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=wKM6vn5p3U6E7i/FFnsfhFu51AGs9786hSbYTnbqErEdvgYNenfhlmCgxVk2S+XUG /H6xlbePGStbYImLt8Je9IqgtnlFKm/tUMiuZuvDls3O1OygqefhrtPSZzWJ2yLKBX vL03qAjhTRpwFGcerfjklolu5XZUXuu7l/m96kWA= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Tao Zhou , "Peter Zijlstra (Intel)" , Vincent Guittot , Mel Gorman , Sasha Levin Subject: [PATCH 5.5 053/257] sched/fair: Fix condition of avg_load calculation Date: Thu, 16 Apr 2020 15:21:44 +0200 Message-Id: <20200416131332.577020698@linuxfoundation.org> X-Mailer: git-send-email 2.26.1 In-Reply-To: <20200416131325.891903893@linuxfoundation.org> References: <20200416131325.891903893@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: Tao Zhou [ Upstream commit 6c8116c914b65be5e4d6f66d69c8142eb0648c22 ] In update_sg_wakeup_stats(), the comment says: Computing avg_load makes sense only when group is fully busy or overloaded. But, the code below this comment does not check like this. >From reading the code about avg_load in other functions, I confirm that avg_load should be calculated in fully busy or overloaded case. The comment is correct and the checking condition is wrong. So, change that condition. Fixes: 57abff067a08 ("sched/fair: Rework find_idlest_group()") Signed-off-by: Tao Zhou Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: Vincent Guittot Acked-by: Mel Gorman Link: https://lkml.kernel.org/r/Message-ID: Signed-off-by: Sasha Levin --- kernel/sched/fair.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 0ff2f43ac9cd7..1f5ea23c752be 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -8323,7 +8323,8 @@ static inline void update_sg_wakeup_stats(struct sched_domain *sd, * Computing avg_load makes sense only when group is fully busy or * overloaded */ - if (sgs->group_type < group_fully_busy) + if (sgs->group_type == group_fully_busy || + sgs->group_type == group_overloaded) sgs->avg_load = (sgs->group_load * SCHED_CAPACITY_SCALE) / sgs->group_capacity; }