Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp2956007imm; Fri, 10 Aug 2018 01:00:03 -0700 (PDT) X-Google-Smtp-Source: AA+uWPx0iwpMDYsOLl2nRYEf6FxMHli6c124KDUbBhp60ojpuo0U9mrtpdZ8EKt9Tusuv2dpD00r X-Received: by 2002:a63:9d47:: with SMTP id i68-v6mr5363627pgd.172.1533888003107; Fri, 10 Aug 2018 01:00:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533888003; cv=none; d=google.com; s=arc-20160816; b=ySTycQFFme+XmdWdto7UEBTk6e+xLmGgfl30sx3spl2Fv6Zru2EGRpPjpfUnjfKJ2R e9o+kpU1Zw+eG5yp84oJi0lhUVvYoOS5jk+eOk7zG/WAG2e7dup5ugPhAKynRSGVAG1e iDmH9JdQfk5T5KlODmFZ2ddVKatEng01wkIz4iHp5moIBmw7t3Op6fQT5dD/fSJiSFV2 Qo6yqjK24rFQgXZXC6IH1DRkGnOZ1l4Vn0yb4xY0dUSbgaqis4rnW3LNQle6gOdwgALf UqeJkBrAid3icPgs52Ytu/MtPdKSxC/62BJO25NckCOsLwP2ce6JqoWFgTChjJUa/aJd +4dg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=4S+B4dxAM01fMIMHLp1Y537TpunJAydeh/rHO1fTGa4=; b=RsDZStMWYZukCp0For1UMP8pFy8Pbuee90k7GUxQSNkH/WNgmODjpp57EByU5Ykakd p/mnQwBUvpQremXyZ1KHWW+TwFxAGCZo+VEKdWudTqEh87c6P/WWNARtdbND8e6XGw0m bvyhiy6aVv/bkGrya5Upe5U3pt7NRNLCGRWDEvuNKMpyBx4jk2Zn06eHJzW5p57DK2bk 1KSVkRxtP0LD2I5gGx+d/2DDd4iBzDXHODoHn2tmOXLWXqKJtxMbRq0pjOrGo7VUr0o9 +P09evazupr/ipSko6w5+f8UmzxKL4OYxC5p7dklBBkA7uytS+dKpOjtMFj+dJ9Y1xPq dLzQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=tIWfQghM; 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=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 34-v6si7217740plz.479.2018.08.10.00.59.46; Fri, 10 Aug 2018 01:00:03 -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=fail header.i=@gmail.com header.s=20161025 header.b=tIWfQghM; 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=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727586AbeHJJo3 (ORCPT + 99 others); Fri, 10 Aug 2018 05:44:29 -0400 Received: from mail-oi0-f68.google.com ([209.85.218.68]:41987 "EHLO mail-oi0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725832AbeHJJo3 (ORCPT ); Fri, 10 Aug 2018 05:44:29 -0400 Received: by mail-oi0-f68.google.com with SMTP id b16-v6so14172829oic.9; Fri, 10 Aug 2018 00:15:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=4S+B4dxAM01fMIMHLp1Y537TpunJAydeh/rHO1fTGa4=; b=tIWfQghMFsfD1iiPlP0fIkVhtRwfxzFYcs9iNnIReLxsYOqLsfSbCc816EuW/0dtPY YSfC/vYIOLAaMWWt3PaN4t29tFPjvLgNVGMbb5AFd7AFf93bV3AhmIMscO5N0cy595cQ CItsbCk8d29ZLTgFScYi4/kVDS83Hik8o9yxV+Dvav192KlnswyEVMZaUw3uX7MHtd6o eGsl3ay5k04V1FIclgd1XuS1cAExCVDTvDXUKqSBnAEmCzkXbdeMb+VdX0SsZAHsQJCj 33WMNMII/tjxSzwu1Cub60R8qzhqUrLzzcK3DVI4AY45jYzxpJOFHW8oSJIMn4d/LXRp dA1A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=4S+B4dxAM01fMIMHLp1Y537TpunJAydeh/rHO1fTGa4=; b=oWIEuqcc7zdHFiJJVMFJ48ix/ureiuVXJMhAprHLxYWRK97HyK4hrUvb3G4szh9Loy V51qbEcnVfGfzpMhGWNOHAxtYWJsczVvcpbVf82Qj1rU7tWIqJbnmwZ6u7YuPO0V31Wu HMAKi+2FuNJPWPtLErFC/oXbSO0GuNPIeAPYIycQQTgHaSzLH/OXxexHlRjcxCVMprSc 87JTpT7skynCcbYAfpgNWDtaEPY9f1P2E8jav0vohz4eLeMfubXrQPaLJR1xgcjDHVg+ rPx8WLQkk6UiHoFLXPHJneiIdNSV2/HvHW+nJwGs6icpniX4Cw4nuyj6mok7nz3N6V8f 5LIQ== X-Gm-Message-State: AOUpUlEH6s4B18PEs6pvGoFUY+qiJPkavr9xUb6BrSSvEDt68am9NWTt Xqkrqg8yXwDELaLDdL0jVq/JpD5dVpCjVc43pIzSWA== X-Received: by 2002:aca:ecd0:: with SMTP id k199-v6mr5951370oih.227.1533885354704; Fri, 10 Aug 2018 00:15:54 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a9d:63d2:0:0:0:0:0 with HTTP; Fri, 10 Aug 2018 00:15:54 -0700 (PDT) In-Reply-To: <20180810061917.GB11817@leoy-ThinkPad-X240s> References: <2161372.IsD4PDzmmY@aspire.rjw.lan> <20180810061917.GB11817@leoy-ThinkPad-X240s> From: "Rafael J. Wysocki" Date: Fri, 10 Aug 2018 09:15:54 +0200 X-Google-Sender-Auth: Ok_W3qpNVoEwF-Mt8fVepuhFcnQ Message-ID: Subject: Re: [PATCH] sched: idle: Avoid retaining the tick when it has been stopped To: Leo Yan Cc: "Rafael J. Wysocki" , Peter Zijlstra , Linux PM , LKML , Frederic Weisbecker , Ingo Molnar Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Aug 10, 2018 at 8:19 AM, wrote: > 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; So we disagree here, quite obviously. > 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. No, if the tick is stopped, restarting it is pointless until we exit the loop in do_idle(). > 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'm not following this, sorry. > I still think my patch to restart the tick is valid :) It changes the behavior significantly, though, and it is not clear if the new behavior is desirable. The patch here simply fixes a problem while leaving the overall behavior as is. >> 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(); >>