Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp2886483imm; Thu, 9 Aug 2018 23:27:54 -0700 (PDT) X-Google-Smtp-Source: AA+uWPxMmavAILAGlze1ET41QZGerEs7wsf2OXK1x2ThUosROgvn4QQX5H5Zz7E7wtvLwGrEMHUL X-Received: by 2002:a63:c50c:: with SMTP id f12-v6mr4976668pgd.88.1533882474118; Thu, 09 Aug 2018 23:27:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533882474; cv=none; d=google.com; s=arc-20160816; b=qnRBxvgoHRKs4pxBjhKN2wBjdk4NoJC6N3SHp0ezeeGjIZFIJzuEbWey2eFA/Ma7Rn TjQhw71muxNK6rpP+t7aDLwmhaALpwoL2YR7QHIuDDSQz4ca02RWVwWGnNzE/8Af2bdB FFspC1egucRmDOxN0cNJcv3SV3Eosn/BeJINzVXRYYA6ChaYETtM+FsXEy9nPonsDAdZ tvsxWgvxSv/6KN/1dqaxJ1nC/xWtddBUqtm83FtvSDfsKmmS9rc5TMj1Wa/Vr8J1cxDh YIAkSiKE6wKXY/yf3rOCWrHhulP8LIj8KB8xDsJFQoe7G5OSBdG/1Pv+8T+TtSZreXuV xYXg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=FdR6rdke0qLN2sPf5y/eL4/h3v/o2Q1BNuOk1+EvdYo=; b=hzfTLkJWK12KbElOPn+W7+vDeQihRZj9oVHb1a58L1YyjMCqLX9tmAizi4c9iJIT12 eOJpMGPk2nZY2cBdT7ArAYHbIJVMSSjenoFcRlcpy0EUtCR2oD9oiotRg0GhxJxNCozS nuV0tKW8IgkFTcAYd4BYTkQvT4CemELOch8b9l9d085tIe3iCpcNAIQjYMbojM1sRphx vY1TuVAuif4crOBs8/7EmqrzJsKqF722YAf3+hkry4QmTylMNO7y+m5jG/HGFmd5MKoK EZlShBY9L3+Ct4pYmKU3Et4SR3Z1vkSksrA0+ONvflI82mxB1ixLelNjdZqDiJdL905P Crdg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=e55G1Ksg; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 15-v6si8462199pgu.205.2018.08.09.23.27.28; Thu, 09 Aug 2018 23:27:54 -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 header.s=google header.b=e55G1Ksg; 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 S1727457AbeHJIru (ORCPT + 99 others); Fri, 10 Aug 2018 04:47:50 -0400 Received: from mail-wr1-f68.google.com ([209.85.221.68]:43695 "EHLO mail-wr1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725917AbeHJIru (ORCPT ); Fri, 10 Aug 2018 04:47:50 -0400 Received: by mail-wr1-f68.google.com with SMTP id b15-v6so7198409wrv.10 for ; Thu, 09 Aug 2018 23:19:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=FdR6rdke0qLN2sPf5y/eL4/h3v/o2Q1BNuOk1+EvdYo=; b=e55G1KsgH1VAY3acbVWBZr48hthMG3Gh67kNxRg0kM1vXagwwnYJgEYA1lJU4dYnZW tz2MVaUiP/F/MesJw+yK21Y1a6pWbyjKNr8LCfG+ri8JWtP2c/ibaPr935pPtNzGmDo/ tco3NcxQGRT3SlkrnePJMpDBdicjziiqYdvAo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=FdR6rdke0qLN2sPf5y/eL4/h3v/o2Q1BNuOk1+EvdYo=; b=CiKcWoMGiPbxneEuS+H5WTgEbb+w1FyBn5Oh/SyaKdlrXpIIIbWPL84GVnlFcvrCwo WPhBBKxZnqrSPViXUcKRloT5zZ6ehW4BDUQMXIcxTRUGiAM+Xf+ufFDBIELj1KO1xGe5 jbIQ3MkHo55Lxb//MWfbkRoF/PwtdLpUlpmvZwK2I0L+nlf+IqbwoWKLkpuvMmQLDsKU qryaGyAnyoi/TcqbI5+p2oaYaMKo0RBiX2JU7xN3glcEcwvRbjKPqdR1X+utymi5RSMX 9rQC4Z82uEYh+qsXqZPQT20DLBn0nw/HFs4IpmjL6xGWKeN6KUt8lx4hfn64MWxKadEu GOOA== X-Gm-Message-State: AOUpUlH21dY+/JeBnH9nXVt2InyBlT3l33B72wM2auZRQYvIU+T9Huos qrLltNi6PrQoWf6pniDYKeYmqw== X-Received: by 2002:adf:c612:: with SMTP id n18-v6mr3176714wrg.177.1533881965183; Thu, 09 Aug 2018 23:19:25 -0700 (PDT) Received: from leoy-ThinkPad-X240s ([45.76.138.171]) by smtp.gmail.com with ESMTPSA id x82-v6sm2075993wmd.11.2018.08.09.23.19.21 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 09 Aug 2018 23:19:24 -0700 (PDT) Date: Fri, 10 Aug 2018 14:19:17 +0800 From: leo.yan@linaro.org To: "Rafael J. Wysocki" Cc: Peter Zijlstra , Linux PM , LKML , Frederic Weisbecker , Ingo Molnar Subject: Re: [PATCH] sched: idle: Avoid retaining the tick when it has been stopped Message-ID: <20180810061917.GB11817@leoy-ThinkPad-X240s> References: <2161372.IsD4PDzmmY@aspire.rjw.lan> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <2161372.IsD4PDzmmY@aspire.rjw.lan> User-Agent: Mutt/1.10+31 (9cdd884) (2018-06-19) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Aug 09, 2018 at 07:08:34PM +0200, Rafael J . Wysocki wrote: > From: Rafael J. Wysocki > > If the tick has been stopped already, but the governor has not asked to > stop it (which it can do sometimes), the idle loop should invoke > tick_nohz_idle_stop_tick(), to let tick_nohz_stop_tick() take care > of this case properly. IMHO, I don't think this patch is on the right way; from the idle loop side, it needs to provide sane fundamental supports, for example, it can stop or restart the tick per idle governor's request. On the other hand, the idle governors can decide their own policy for how to use the tick in idle loop. This patch seems mixes two things and finally it's possible to couple the implementation between idle loop and 'menu' governor for sched tick usage. I still think my patch to restart the tick is valid :) Thanks, Leo Yan > Fixes: 554c8aa8ecad (sched: idle: Select idle state before stopping the tick) > Signed-off-by: Rafael J. Wysocki > --- > kernel/sched/idle.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > Index: linux-pm/kernel/sched/idle.c > =================================================================== > --- linux-pm.orig/kernel/sched/idle.c > +++ linux-pm/kernel/sched/idle.c > @@ -190,7 +190,7 @@ static void cpuidle_idle_call(void) > */ > next_state = cpuidle_select(drv, dev, &stop_tick); > > - if (stop_tick) > + if (stop_tick || tick_nohz_tick_stopped()) > tick_nohz_idle_stop_tick(); > else > tick_nohz_idle_retain_tick(); >