Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp3952010pxa; Sun, 9 Aug 2020 18:03:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxez1LQPvlWZgqXv3VcNJ5sFcUhOVapjVtoToQSmrLpibpOJvMG3wdVM/KR7gbs2J8sB2gM X-Received: by 2002:a17:906:d92c:: with SMTP id rn12mr18808336ejb.187.1597021437693; Sun, 09 Aug 2020 18:03:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597021437; cv=none; d=google.com; s=arc-20160816; b=YBMkEa5y2mwqO2UcPJ41iSPXArsImlp3rEzifKwTKKYQImypVjCrHbX68Z2cnRsDyq cp/erA2gfn+8aF1w+cGUuTAuhOuUdQE49KycoilxDc6E2xmlq+Qx1bpPDY9qxXqQtnzv eldyDm2a+Hw+aJb9W2C5duA+YPkb/KSHbd/Ijv5bkz1x94/xlei+v2SUoHJdJEOPuOUO HUYe1ySaulq5ARmd4DSTR+EMyvsJ3hy/1bzOM59/FqT8ezPT/a7GyC3wuCbbGI5S2ELS yo9U6ifP4sgpLBKJVfDtcqQ9jkil+R2r+0DwwiFPGXS9I+6fI4w3Dr5fRaVX5sCER97v 3Haw== 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=WXUIwf2ehBPUDiy3lFJF1kJPO1DKKK/C2iqXILzYiwQ=; b=G1tNRshH48gS51heEny69ARleTxe0LX82CydfGIDbl9o5sqCCH33XHbJn+ciZ83Chm nq2iAPC/cvvicL4H/kGxO9VOCnvRqonUp3BiasuAvH/ZEF73uaXr3302MYDNbthcTqyU vtuu9n9ihVLKsVCaDGmHG9qo8V7HYnj2j4F531j9Y/1qyipVUMcORUqZN9C8PvuqY9tz j6p9YcDjh1rvYgXpjDrNQCH9J0ckVwNvBs8leYMW42Kl7l+3tL99Uyv5uYG25pmyb8u2 JP1jmoZeN0UOQeQkLrWaSFkKkNQI3KcKM8Z667UuRE+2WzAgddOeyYSWTimnmPCJtlJp MVMw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=XpGjhd5I; 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 o18si9568541ejx.472.2020.08.09.18.03.35; Sun, 09 Aug 2020 18:03:57 -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=XpGjhd5I; 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 S1726439AbgHJBAV (ORCPT + 99 others); Sun, 9 Aug 2020 21:00:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44948 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726335AbgHJBAU (ORCPT ); Sun, 9 Aug 2020 21:00:20 -0400 Received: from mail-pj1-x1044.google.com (mail-pj1-x1044.google.com [IPv6:2607:f8b0:4864:20::1044]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D990FC061756 for ; Sun, 9 Aug 2020 18:00:19 -0700 (PDT) Received: by mail-pj1-x1044.google.com with SMTP id l60so3942969pjb.3 for ; Sun, 09 Aug 2020 18:00:19 -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=WXUIwf2ehBPUDiy3lFJF1kJPO1DKKK/C2iqXILzYiwQ=; b=XpGjhd5IF5/XHVzC9m/JLd1F/Oqsq9kyQql9WB89B7hF5M2gyx7A0Ru4wOjMq5a0St Ap1yomu4hZ0kRLmRJBGqkQktBer/GHiTgQz/K9V9qK6zVSRC6h0+U3jNTlYHhZmjuk+t 7cBahxYgAIkoIZxNU9wO40PDX9V47v07DpIoxkAmTAlh2HwL/SyLlHRtMOJjGuISax/O LU6JzGavRyA0rn19wN0/Atf4QXdxPmkj7mkplxZcP+/W1N5+QjV3qaMJRre+ZD50X+oq cmHApQfgdS3cnIE6ajopdgzuKyIPSPkYuUD6xTr7cj2p0n/PnQhe7apWHNT/P45dbWPx CXvQ== 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=WXUIwf2ehBPUDiy3lFJF1kJPO1DKKK/C2iqXILzYiwQ=; b=OC+Bd2YUueHPNnkoRKJwhyhwHmGZnqTYQmIGwtkH0QBl511YvoSP/gbaWXd7FtycYs HPeLz/AkyX3BYTdjKgjZQJbz6sEixHAEeq/LOmLdJynkzAxHLwSgqJDV/UflGd4UTQ/z 3kFmKw5HIsdLnDgR6fP3KT1rM2VeBp6SHjl+JA1fnZzNyQyh0JiSEjgAW8deOhlSDyIu l4J2sbrptr76M0rW3Dzilwn7hHCEUod3F4HMcAGtls+TIgj/reDuqug2rOe0PlSjCURe +yYcR8Gc0fTJ1w6DmriBhMJ1oBBPbKMe4qj7/ZKrG7jpJZXKs8YcrNj4C78TwnssvGYC Y9Lw== X-Gm-Message-State: AOAM530E4r6ZbYih1EmW1FBWS8tNqBeufNfWEySq0U1mabvBzou7Ukkk YX7kUm2K0SI59dhbtYaW82Y= X-Received: by 2002:a17:90a:bc96:: with SMTP id x22mr26078715pjr.164.1597021218377; Sun, 09 Aug 2020 18:00:18 -0700 (PDT) Received: from XiaoXinPro-13.hytera.com ([167.99.75.144]) by smtp.gmail.com with ESMTPSA id r91sm17477735pja.56.2020.08.09.18.00.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 09 Aug 2020 18:00:17 -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: Remove the duplicate check from group_has_capacity() Date: Mon, 10 Aug 2020 09:00:09 +0800 Message-Id: <20200810010009.92758-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 1. The group_has_capacity() function is only called in group_classify(). 2. The following inequality has already been checked in group_is_overloaded() which was also called in group_classify(). (sgs->group_capacity * imbalance_pct) < (sgs->group_runnable * 100) So just remove the duplicate check from group_has_capacity(). Signed-off-by: Qi Zheng --- kernel/sched/fair.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/kernel/sched/fair.c b/kernel/sched/fair.c index 2ba8f230feb9..a41903fb327a 100644 --- a/kernel/sched/fair.c +++ b/kernel/sched/fair.c @@ -8234,10 +8234,6 @@ group_has_capacity(unsigned int imbalance_pct, struct sg_lb_stats *sgs) if (sgs->sum_nr_running < sgs->group_weight) return true; - if ((sgs->group_capacity * imbalance_pct) < - (sgs->group_runnable * 100)) - return false; - if ((sgs->group_capacity * 100) > (sgs->group_util * imbalance_pct)) return true; -- 2.25.1