From patchwork Tue Sep 25 09:38:44 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Lezcano X-Patchwork-Id: 147426 Delivered-To: patch@linaro.org Received: by 2002:a2e:8595:0:0:0:0:0 with SMTP id b21-v6csp502921lji; Tue, 25 Sep 2018 02:39:08 -0700 (PDT) X-Google-Smtp-Source: ACcGV61aWeCtL7psiVm9Zsd2Pa/JbvaKIifARAcdCBtEOefh6hg49IwLCVBvMnY+Ru1zT26QXwFT X-Received: by 2002:a17:902:9f97:: with SMTP id g23-v6mr278544plq.68.1537868348212; Tue, 25 Sep 2018 02:39:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537868348; cv=none; d=google.com; s=arc-20160816; b=BmKpNIfL3vRttd/Bbo9gLYxLt9I1VVJfm2NPeFgFGMVCmXEd+frv5KWGmfz+9Yibd9 fV02ZIV8ve12cSGoZ5YFxxnd53PctlySQxgdeK9bfx0iRtKGwrigzYyvrsWl2YLMaYbQ oPpro9w1rnQSJs9PbKz3vMhYkZBWr3Xbcst66xvftuNK2iPkt25dVTFrQ4H+bV3pkhd8 j9zjuPYRlpzDTAxT9kh4jRW6NE6DPmjGq/MwPZnb2oxY40CzYAN2RQp89BU7vgDwAC75 OEgC5NDFs9Z0M/97f5nGp8hn3xLj3Fm3+L9AcAvd/q+ZjnvhzNGypexBNNH+zR/amXb6 UdiA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature; bh=qJ8VdacrR0OZB3Gp+tWRJQDJ11ucpy9Q/KD5cZtzofU=; b=wiyfPpCdziXPk8c5r7KxVloEksQqdEjmBtfV2t8juEC2pqN5errMkaS1oUdZh3iP5P KhSp9GjXUCuc0QfUxDigbXEKwB7KtV1Gr3vPY06NP1EaMcg3nT+u9uolcljIos+8/CkF cCNaCNZtA36j2BsM8i8qyuG+YMPVZBV2YJbI7/ZtCi4eTTbVcAxQ425TOqJ7QpieKpNt HuvBLtUSyxPApjpXo4sCMNZeTrsr1CMaybJiqiWz5DdFAZ2CoR+AQMzldJusQAT4gxou ER/pYhgHE+jvuwE1zfTjWhDnvhq1UYQe8aAa57PWJ0D6XxSvLeiXk0gQzu7fg779EK57 iwEw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=XCk9hXMm; spf=pass (google.com: best guess record for domain of linux-pm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-pm-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y27-v6si1963290pgl.479.2018.09.25.02.39.07; Tue, 25 Sep 2018 02:39:08 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-pm-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 header.s=google header.b=XCk9hXMm; spf=pass (google.com: best guess record for domain of linux-pm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-pm-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 S1727114AbeIYPpr (ORCPT + 10 others); Tue, 25 Sep 2018 11:45:47 -0400 Received: from mail-wr1-f66.google.com ([209.85.221.66]:38383 "EHLO mail-wr1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726201AbeIYPpr (ORCPT ); Tue, 25 Sep 2018 11:45:47 -0400 Received: by mail-wr1-f66.google.com with SMTP id j8-v6so18849159wrw.5 for ; Tue, 25 Sep 2018 02:39:05 -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=qJ8VdacrR0OZB3Gp+tWRJQDJ11ucpy9Q/KD5cZtzofU=; b=XCk9hXMmPCQHix5vlMEEoppjPa1d5zXoD6Eqt5Gk78tWwm85rFsIvOH64flVcbaJ6g cEBjqwTePJ1GptQSDf8veAE/TVa/Xj7AQBMIIW7PKYzKZBTv4rrSD4Uls0K9ey+j7Crq as73FZumZlROSXNkTOXf7Tfh80BSYYvI4K1eI= 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=qJ8VdacrR0OZB3Gp+tWRJQDJ11ucpy9Q/KD5cZtzofU=; b=IC13Zj7MFLpD4jW5TC4g2RNAs6E+Si6u03jNchSM9pOJXOjfMRMjToGEx0jUmQLbvF BL6SZ/qR8kXkvrUc0Yj9AtY2sOqrttGYxTw2G8FUsXxZ1aFENLmmehrVJYlcI9yvJelA v8e6b6anLqz5bOGQx9B9Ijn5b/eBoefyYZFnHgIMSq5CFgQv9Y294as+XRYfUyhGrIFM maj2Huxsvwg9/muXHKKvG09abSoFABOnlcPHqncY6QlH0gGNhabSchHbbyuySPBo7+a7 1EXT9vn01YL6owHCaM/5/VNYLRz7QP/L+DSR3L2GpKtH0bxez3wCg6IcyT68DG2lAS/+ mo2g== X-Gm-Message-State: ABuFfojosfwZL6KyhVSpiZUsdYrOgPmwa9FfeY7gLEDQHif4hEmYqdr2 T8Tt9LL407xeaiT2lv7bOpoKIA== X-Received: by 2002:adf:f94e:: with SMTP id q14-v6mr144775wrr.151.1537868344865; Tue, 25 Sep 2018 02:39:04 -0700 (PDT) Received: from localhost.localdomain (251.150.136.77.rev.sfr.net. [77.136.150.251]) by smtp.gmail.com with ESMTPSA id x15-v6sm1288203wrt.53.2018.09.25.02.39.03 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 25 Sep 2018 02:39:04 -0700 (PDT) From: Daniel Lezcano To: rafael@kernel.org Cc: linux-pm@vger.kernel.org, Todd Kjos , Joel Fernandes , Colin Cross , "Rafael J. Wysocki" , "Peter Zijlstra (Intel)" , Ramesh Thomas , Alex Shi , linux-kernel@vger.kernel.org (open list) Subject: [PATCH RFC] cpuidle/drivers/menu: Remove get_loadavg in the performance multiplier Date: Tue, 25 Sep 2018 11:38:44 +0200 Message-Id: <1537868328-13405-1-git-send-email-daniel.lezcano@linaro.org> X-Mailer: git-send-email 2.7.4 Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org The function get_loadavg() returns almost always zero. To be more precise, statistically speaking for a total of 1023379 times passing to the function, the load is equal to zero 1020728 times, greater than 100, 610 times, the remaining is between 0 and 5. I'm putting in question this metric. Is it worth to keep it? Cc: Todd Kjos Cc: Joel Fernandes Cc: Colin Cross Signed-off-by: Daniel Lezcano --- drivers/cpuidle/governors/menu.c | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) -- 2.7.4 diff --git a/drivers/cpuidle/governors/menu.c b/drivers/cpuidle/governors/menu.c index e26a409..d939b8e 100644 --- a/drivers/cpuidle/governors/menu.c +++ b/drivers/cpuidle/governors/menu.c @@ -173,18 +173,10 @@ static inline int which_bucket(unsigned int duration, unsigned long nr_iowaiters * to be, the higher this multiplier, and thus the higher * the barrier to go to an expensive C state. */ -static inline int performance_multiplier(unsigned long nr_iowaiters, unsigned long load) +static inline int performance_multiplier(unsigned long nr_iowaiters) { - int mult = 1; - - /* for higher loadavg, we are more reluctant */ - - mult += 2 * get_loadavg(load); - /* for IO wait tasks (per cpu!) we add 5x each */ - mult += 10 * nr_iowaiters; - - return mult; + return 1 + 10 * nr_iowaiters; } static DEFINE_PER_CPU(struct menu_device, menu_devices); @@ -359,7 +351,8 @@ static int menu_select(struct cpuidle_driver *drv, struct cpuidle_device *dev, * Use the performance multiplier and the user-configurable * latency_req to determine the maximum exit latency. */ - interactivity_req = data->predicted_us / performance_multiplier(nr_iowaiters, cpu_load); + interactivity_req = data->predicted_us / + performance_multiplier(nr_iowaiters); if (latency_req > interactivity_req) latency_req = interactivity_req; }