Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp1188124pxa; Sat, 1 Aug 2020 21:55:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJypucRWdt8LK/qNcmXxGG9Al00F7L4ZbQZHD1ltJiOOXlSAuWH1ItagpABwaKH0yIQasrWl X-Received: by 2002:aa7:d155:: with SMTP id r21mr9964152edo.87.1596344132404; Sat, 01 Aug 2020 21:55:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596344132; cv=none; d=google.com; s=arc-20160816; b=FRwikmwq2gHx1SLgGnESTYRyzADrnIeXbbQOId5koA/oAD56nMwWyBKoTjo71N+HSl dc6UHY9L0fEiKCa4FboUHGDlojdbTKMBXM2qOc3L11k2TFvXsZetHYe3uXyF+K/GbSF1 IFlcBMmU3eFvkDeTC2fwnESuGivIeWpH8QI3HwrNgYh38YydahcVvIjZVx7Li3vvt6O6 qaJANh1ohzdovMhGQsai7Vdmob9kWE7eC3xClY8PtWzeOH91jlvxTkYnEryRyhheMreW HkeLZxS3zmP+NyP8IWGxlcd/rIRXqxgwGixucjLHxqftT1GwzfBSPBwPS6OzhzK1YvX5 5Xug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=L9fTOiCO40iiD8tO5XrUmAYBh4gt26Udf/w1rmUkrP8=; b=l9PMTK85K/oeak7P6VB9IuKGh0iIa5fPPFurECxl9D9rRnB5a15l4ZKijxyCkcY3rt P4OMTEv1rG1enbzL9SIzTgF6xAh48oeGN6hvCY3CKcFbWKdJA45iQHGz4P14FX2/+HWA kZMq6QUH0JwlkmmyLEsty4U6H8k/Q8+8VcnKL5eDTdSXa5InlpZZR6nRUveWcPWGnx3l Z6ghZ7H2vW6NTFF2KfyBFwI7FGR3bg71lx8uknpLCxwlF8rW6T30pcyXcUfiQNVE7ncl A8z8xxd2gNdGJG6T+ZlfThlxxwkK6k6Y6vOLUZqUKOUDfcb0sRPug01uvGuyQQdRXD6I 5uvA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Le5kU22e; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d15si8556255edp.439.2020.08.01.21.55.08; Sat, 01 Aug 2020 21:55:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Le5kU22e; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725850AbgHBEv7 (ORCPT + 99 others); Sun, 2 Aug 2020 00:51:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35046 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725797AbgHBEv6 (ORCPT ); Sun, 2 Aug 2020 00:51:58 -0400 Received: from mail-pl1-x642.google.com (mail-pl1-x642.google.com [IPv6:2607:f8b0:4864:20::642]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BF8E6C06174A for ; Sat, 1 Aug 2020 21:51:58 -0700 (PDT) Received: by mail-pl1-x642.google.com with SMTP id b9so19176353plx.6 for ; Sat, 01 Aug 2020 21:51:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=L9fTOiCO40iiD8tO5XrUmAYBh4gt26Udf/w1rmUkrP8=; b=Le5kU22eaEv/VutZS7aIQsNrxXMXdvJ/qna8ixX2Tlgk8H/v4DtLEi5h5CxfIhsDVc Q30YX+7Gb5jRNLC6q2yddPNrt1VmSmAFGVWN5q7haVFFe0SPQX3Ak//9POv5sfiE1qkP JyEzs1XH0uZ2dqo0iBzIKfK2DfEfhUyM6sxlmSqd95zQ6vGB2QxmRTNp03O2Fc5mr73p bKYraphllpweHMugUq9tTB5xqw1+/3nfgzFGy+pET0+WnRYJPx1ysq/6iHGTAQqAvN+Q UoNYQMp3bxggiuccwA8PiaM5n/4IVpFS5pG70frAFKs/EXQoPyycP6aYc/a/YCa0KKVv H2Ig== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=L9fTOiCO40iiD8tO5XrUmAYBh4gt26Udf/w1rmUkrP8=; b=UGSB/IiEfnHoAgzUi9RtLl/gnpBQnHH2WGl2+LTxZgTeg1SW1OLXnNW5MF3qRLkUAF g5stS51sLW6JBCPs/JqXKz+O8hI5IWcv/WFgi3VuAa5KEhwcfPv6hNo12okYoAbS5/dg wenOYZLJZ7UPR0w3QG8y4A83GQAVInradAbsqOu6UB1NsqvaYatTlGg6PTQDGFYgPgJW 6ooF2piYU0Isk35W9YkuABlJruJS5tJUIDjxlslbVZPPo3Nf+Tbayzd4uYAIEeGHOqrd GlyaLkkLk+KBBLADn/fPY2Z9V756BsH05i5cfC0xa4HSuvPbgZwLJusetTmdtFexATzc luUQ== X-Gm-Message-State: AOAM530wY+osVxpPdypx3cvZ+XqKcfUq2BfJ1CfYHvgPe5sp/fJiKr5N WbrOdnVWHdXdMkiQijGmPp0= X-Received: by 2002:a17:90a:6285:: with SMTP id d5mr11444698pjj.85.1596343918241; Sat, 01 Aug 2020 21:51:58 -0700 (PDT) Received: from localhost.localdomain ([107.191.53.228]) by smtp.gmail.com with ESMTPSA id f15sm15883414pfk.58.2020.08.01.21.51.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 01 Aug 2020 21:51:57 -0700 (PDT) From: Qi Zheng To: mingo@redhat.com, peterz@infradead.org, juri.lelli@redhat.com, vincent.guittot@linaro.org, dietmar.eggemann@arm.com, rostedt@goodmis.org, bsegall@google.com, mgorman@suse.de Cc: linux-kernel@vger.kernel.org, Qi Zheng Subject: [PATCH] sched/fair: Fix the logic about active_balance in load_balance() Date: Sun, 2 Aug 2020 12:51:41 +0800 Message-Id: <20200802045141.130533-1-arch0.zheng@gmail.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org I think the unbalance scenario here should be that we need to do active balance but it is not actually done. So fix it. Signed-off-by: Qi Zheng --- kernel/sched/fair.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 2ba8f230feb9..6d8c53718b67 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -9710,7 +9710,7 @@ static int load_balance(int this_cpu, struct rq *this_rq, } else sd->nr_balance_failed = 0; - if (likely(!active_balance) || voluntary_active_balance(&env)) { + if (likely(!active_balance) && voluntary_active_balance(&env)) { /* We were unbalanced, so reset the balancing interval */ sd->balance_interval = sd->min_interval; } else { -- 2.25.1