From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 01C57C76195 for ; Tue, 16 Jul 2019 15:25:14 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id D98D42173E for ; Tue, 16 Jul 2019 15:25:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388026AbfGPPZN (ORCPT ); Tue, 16 Jul 2019 11:25:13 -0400 Received: from cloudserver094114.home.pl ([79.96.170.134]:55704 "EHLO cloudserver094114.home.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728421AbfGPPZM (ORCPT ); Tue, 16 Jul 2019 11:25:12 -0400 Received: from 79.184.255.39.ipv4.supernova.orange.pl (79.184.255.39) (HELO kreacher.localnet) by serwer1319399.home.pl (79.96.170.134) with SMTP (IdeaSmtpServer 0.83.267) id fc8f4a0a9c6fad49; Tue, 16 Jul 2019 17:25:10 +0200 From: "Rafael J. Wysocki" To: Linux PM Cc: Thomas Lindroth , LKML , Peter Zijlstra , Frederic Weisbecker Subject: [PATCH] cpuidle: Always stop scheduler tick on adaptive-tick CPUs Date: Tue, 16 Jul 2019 17:25:10 +0200 Message-ID: <6254683.2O5gIZElE2@kreacher> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Rafael J. Wysocki Running the scheduler tick on idle adaptive-tick CPUs is not useful and it may also be not expected by users (as reported by Thomas), so add a check to cpuidle_idle_call() to always stop the tick on them regardless of the idle duration predicted by the governor. Fixes: 554c8aa8ecad ("sched: idle: Select idle state before stopping the tick") Reported-by: Thomas Lindroth Tested-by: Thomas Lindroth Signed-off-by: Rafael J. Wysocki --- kernel/sched/idle.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) Index: linux-pm/kernel/sched/idle.c =================================================================== --- linux-pm.orig/kernel/sched/idle.c +++ linux-pm/kernel/sched/idle.c @@ -191,7 +191,8 @@ static void cpuidle_idle_call(void) */ next_state = cpuidle_select(drv, dev, &stop_tick); - if (stop_tick || tick_nohz_tick_stopped()) + if (stop_tick || tick_nohz_tick_stopped() || + !housekeeping_cpu(dev->cpu, HK_FLAG_TICK)) tick_nohz_idle_stop_tick(); else tick_nohz_idle_retain_tick();