Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753213AbdGJBsw (ORCPT ); Sun, 9 Jul 2017 21:48:52 -0400 Received: from mga06.intel.com ([134.134.136.31]:24495 "EHLO mga06.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753076AbdGJBsv (ORCPT ); Sun, 9 Jul 2017 21:48:51 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.40,337,1496127600"; d="scan'208";a="1193388557" From: Aubrey Li To: tglx@linutronix.de, peterz@infradead.org, len.brown@intel.com, rjw@rjwysocki.net, ak@linux.intel.com, tim.c.chen@linux.intel.com, arjan@linux.intel.com, paulmck@linux.vnet.ibm.com, yang.zhang.wz@gmail.com Cc: x86@kernel.org, linux-kernel@vger.kernel.org, Aubrey Li Subject: [RFC PATCH v1 00/11] Create fast idle path for short idle periods Date: Mon, 10 Jul 2017 09:38:30 +0800 Message-Id: <1499650721-5928-1-git-send-email-aubrey.li@intel.com> X-Mailer: git-send-email 2.7.4 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2223 Lines: 48 From: Aubrey Li Under some latency intensive workloads, short idle periods occurs very common, so that idle entry and exit path starts to dominate. It's important to optimize them for the short idle period pattern. A fast idle path proposal is introduced here for this purpose. This proposal uses two factors in idle menu governor to predict the next idle period. The one is energy break even point, the other is repeatable interval detector. These two factors are generic to all arches. If the next idle period is longer than the predefined threshold, that means the next idle will be a long idle, then the idle thread will enter the original normal idle path. Otherwise, the coming idle will be a short idle, the idle thread will enter the fast idle path, which is supposed to enter and exit faster than the normal path. The predicted idle period is already computed in the cpuidle framework, so pass it directly to menu governor to select the next c-state. Menu governor does not need to compute again. We measured 3%~5% improvemnt in disk IO workload, and 8%~20% improvement in network workload. Aubrey Li (11): sched/idle: create a fast path for short idle periods cpuidle: attach cpuidle governor statistics to the per-CPU device cpuidle: introduce cpuidle governor for idle prediction sched/idle: make the fast idle path for short idle periods cpuidle: update idle statistics before cpuidle governor timers: keep sleep length updated as needed cpuidle: make idle residency update more generic cpuidle: menu: remove reduplicative implementation cpuidle: menu: feed cpuidle prediction to menu governor cpuidle: update cpuidle governor when needed sched/idle: Add a tuning knob to allow changing fast idle threshold drivers/cpuidle/cpuidle.c | 241 +++++++++++++++++++++++++++++++++++++++ drivers/cpuidle/governors/menu.c | 192 +------------------------------ include/linux/cpuidle.h | 35 ++++++ include/linux/sched/sysctl.h | 1 + kernel/sched/idle.c | 81 +++++++++++-- kernel/sysctl.c | 10 ++ kernel/time/tick-sched.c | 3 + 7 files changed, 366 insertions(+), 197 deletions(-) -- 2.7.4