From patchwork Wed Apr 19 16:29:28 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vincent Guittot X-Patchwork-Id: 97647 Delivered-To: patch@linaro.org Received: by 10.182.246.10 with SMTP id xs10csp350128obc; Wed, 19 Apr 2017 09:32:30 -0700 (PDT) X-Received: by 10.107.138.9 with SMTP id m9mr4741476iod.80.1492619410977; Wed, 19 Apr 2017 09:30:10 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e79si3627551itd.46.2017.04.19.09.30.10; Wed, 19 Apr 2017 09:30:10 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S966198AbdDSQ3v (ORCPT + 16 others); Wed, 19 Apr 2017 12:29:51 -0400 Received: from mail-wr0-f179.google.com ([209.85.128.179]:33963 "EHLO mail-wr0-f179.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S937981AbdDSQ3s (ORCPT ); Wed, 19 Apr 2017 12:29:48 -0400 Received: by mail-wr0-f179.google.com with SMTP id z109so19258813wrb.1 for ; Wed, 19 Apr 2017 09:29:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=PwpEqIVrzl/6gtwdCD6qZ1EzFx6zMrr1tG5TQ+2HL0o=; b=D6NXyj3BxhMN9p53v3QdDD/uNGB8pq8pBkRRhG8EhJUjCdHF0fyfQ0naiM9WLAnuxk Puhixdk98rHk1wZN8oWBC97ZZsNHr+JolvEOfmVJsOSucKIzTWt/j6NtUnh8BSZjzKtt qX6yiX50tyIfsJ1jZR/DpvGTGl2ddOwJN+zGc= 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; bh=PwpEqIVrzl/6gtwdCD6qZ1EzFx6zMrr1tG5TQ+2HL0o=; b=suIJ92iLcvmb/CP+cMZAeEPyoUb0FH+2IC7/kwNj6uZni1KkJXKHD6s+UtQyObTkAT S/Chsr+qrauDGEnKhkAa/VcUiYVnpEydJdpsFLMERVMdv0f/5q+TOzVVHs3pXI4uf6vg i3k00ZYusWoLPLu/9oVGh0qZJ6mj426FHHy2wd6Y+z4Wp2A+moMuRMv37wHz692E8FC5 EUwBZJWGDk/Rc7roJEh6cL+BCtw3MfvWuKm/utM+3cmJjrYPdY2EsnOFbMfstpd3lqH8 NQrSGiYOcNKVmf2A6Ca1Qz6lnoijVKplDGmCPSe1FW9jpTkk/2hEE7OVulTPr/8dpkv/ sjIg== X-Gm-Message-State: AN3rC/4WtaYZsRNVnT+HcsN/dcknwxC16UKEBAbcy0ADyKjnBnlV55Xj dzb43us1iJ64bAWC X-Received: by 10.223.176.242 with SMTP id j47mr3551594wra.81.1492619381662; Wed, 19 Apr 2017 09:29:41 -0700 (PDT) Received: from localhost.localdomain ([2a01:e0a:f:6020:ddb5:fd5c:4a08:a3bc]) by smtp.gmail.com with ESMTPSA id o9sm4451536wmd.4.2017.04.19.09.29.40 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 19 Apr 2017 09:29:41 -0700 (PDT) From: Vincent Guittot To: mingo@kernel.org, linux-kernel@vger.kernel.org Cc: dietmar.eggemann@arm.com, Morten.Rasmussen@arm.com, yuyang.du@intel.com, pjt@google.com, bsegall@google.com, Vincent Guittot Subject: [PATCH 0/2] sched/cfs: make util/load_avg stable Date: Wed, 19 Apr 2017 18:29:28 +0200 Message-Id: <1492619370-29246-1-git-send-email-vincent.guittot@linaro.org> X-Mailer: git-send-email 2.7.4 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org In the current implementation of load/util_avg, we assume that the ongoing time segment has fully elapsed and util/load_sum is divided by LOAD_AVG_MAX, even if part of the time segment still remains to run . As a consequence, this remaining part is considered as idle time and generates unexpected variations of util_avg of a busy CPU in the range ]1002..1024[ whereas util_avg should stay at 1023. The 1st patch implements Peter's proposal to remove the contribution of the current time segment when computing the util/load_avg. The 2nd one keeps using the current segment but update the max value instead. Both solutions make load/util_avg being stable with the advantage of using the most up to date value for the 2nd patch. I have split it into 2 patches to show the 2 versions but if the 2nd patch looks ok, we should probably squashed them into one. Vincent Guittot (2): sched/cfs: make util/load_avg more stable sched/cfs: take into account current segment kernel/sched/fair.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) -- 2.7.4