Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp335914imm; Wed, 22 Aug 2018 05:11:28 -0700 (PDT) X-Google-Smtp-Source: ANB0VdaLDQ1vqwed9WEZ8GaFG9NhZVqTwzwsFCe/Szo6KE+IYDgm+azpO6M+UdXHAnteh+FyummZ X-Received: by 2002:a17:902:8bc8:: with SMTP id r8-v6mr6986533plo.257.1534939888633; Wed, 22 Aug 2018 05:11:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1534939888; cv=none; d=google.com; s=arc-20160816; b=uwlS+TrEUQaEUYQPayxUDiGhj/KNiYQp7ePdCFVKmbn5rF6xSnP6GogxXtgF+AVetE G3TEOGvN4fGiqjWkX3rJ6jWpU8vyGaUou79ZdCYctEdyhrfunW9BBr0sq4GRfyvUfFzR ygYC8Czn6lWNG6rs87cdGsfurh5GAwckuhZ5jTY/FtjJJuHi8QdCdGiwGJkQpe0x3gCI oGK/YnwY1+dsINX31XRvmtKLWj5HF7LarlMKt92ckym1pbshXJL1lLN8mZ5GO902g8sa Mn40iM432gWV359VWj78d34VZLN3uGm/hkwqR8OxAVFBNKdZ5lSNWBu0B8tGHDpHCOl2 flpw== 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=Q+T0B0xKuHc6PmkV7Nqp2zDRINoJzHXAWhbbqChYAyY=; b=FKO5ufmkC+vJWW+/VPSfKrUOumwg69eIa7ky6iLo7NpADWz3k1ThDfXXpWo2+O4td5 TkrlZVtCE5GJ2ieeIPcrLw74kAIVWgp95m6P13QEqj7aL+zaUqCpZTRqicCxqubeDRNs tpBi+UVTer12eARURU4W8gceyGFugRfjFMBk3hgijZ5dhv5UlT22iGTtS+jwplz+SuQR WMI4zpgNMYkJVJfiL9Qyd/Ce3YHDY98eGTuGiU4mcOCNBqaO2QH2ahjEQa6M9r1ceNYu F7qsTnNo35ZWO3KxMTSVJW96M9rzCjouSYqam1B7x/M1Fyv4XQiwskgC05dZks64YGJU FNng== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=fZV0h+Gf; 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 v3-v6si1552321pgc.447.2018.08.22.05.11.08; Wed, 22 Aug 2018 05:11:28 -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=fZV0h+Gf; 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 S1728786AbeHVP2Q (ORCPT + 99 others); Wed, 22 Aug 2018 11:28:16 -0400 Received: from mail-wm0-f67.google.com ([74.125.82.67]:50188 "EHLO mail-wm0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728365AbeHVP2P (ORCPT ); Wed, 22 Aug 2018 11:28:15 -0400 Received: by mail-wm0-f67.google.com with SMTP id s12-v6so1801585wmc.0 for ; Wed, 22 Aug 2018 05:03:37 -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=Q+T0B0xKuHc6PmkV7Nqp2zDRINoJzHXAWhbbqChYAyY=; b=fZV0h+GflwtpC51Vcm1oDJzJMcGXjs0cbovopM3YgoFm2f16VeaHNajuQhjVfGC7Oy kunslYkozEXA7GktpPnSS2G0AGZPnby+ly0X9RV+Wn4PRbs67AfDS+3A8suo4hjiAZ6V orE4cSmYbODBAF6wDDvxEYOqHl7fW6Dyy5hds= 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=Q+T0B0xKuHc6PmkV7Nqp2zDRINoJzHXAWhbbqChYAyY=; b=Cg4rlbHXhOzzkWoZcZB1ImON5+R7LM5npZrN/4MmHAC8RNVs37jJCDQd58tT4Wt5dG 9vMIQfN4GDDSY/axP1T+F7/3TDK/UriRCTsk9C05dwXx5iYBepqoUfapJRUwYm8mxUTm JK1xwBagqcvN2JpCstntuqf99gu8l7VGzzjZs7CIbDlU3JdIiBZuZOXaaUCHh4EkTKJ/ KaFt8SyUmc8of1KwdjN6SrPPM4YIZXC07+YCXgWJ2MRYN0MWkZuwnDuZMNLquYFiGXCY Mc5b0zWJXEiXx32SmprY9yXOZtFQaMRbQKu7a6eGX5s/THq7ROw9W+PU8DHccsz6k7H+ FNmg== X-Gm-Message-State: APzg51Cg33yX45ymZ7Gi3pFyQ0pjAvZrYW5sgycx/b5TUJzGpeeitsd4 YIldLkGX+3nvsWtqzGVWtZeJvA== X-Received: by 2002:a1c:ec06:: with SMTP id k6-v6mr2272867wmh.39.1534939416710; Wed, 22 Aug 2018 05:03:36 -0700 (PDT) Received: from leoy-ThinkPad-X240s ([45.76.138.171]) by smtp.gmail.com with ESMTPSA id z141-v6sm2637210wmc.3.2018.08.22.05.03.33 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 22 Aug 2018 05:03:35 -0700 (PDT) Date: Wed, 22 Aug 2018 20:03:30 +0800 From: leo.yan@linaro.org To: "Rafael J. Wysocki" Cc: Linux PM , Peter Zijlstra , LKML , Daniel Lezcano , Frederic Weisbecker Subject: Re: [PATCH] cpuidle: menu: Retain tick when shallow state is selected Message-ID: <20180822120330.GB8949@leoy-ThinkPad-X240s> References: <34910476.pgRhNDWo5t@aspire.rjw.lan> <20180822120200.GA8949@leoy-ThinkPad-X240s> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180822120200.GA8949@leoy-ThinkPad-X240s> 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 Wed, Aug 22, 2018 at 08:02:00PM +0800, Leo Yan wrote: [...] > > + if (!tick_nohz_tick_stopped()) { > > + /* > > + * If the state selected so far is shallow, > > + * waking up early won't hurt, so retain the > > + * tick in that case and let the governor run > > + * again in the next iteration of the loop. > > + */ > > + expected_interval = drv->states[idx].target_residency; > > + break; > > + } > > + > > This is reliable, how we can rely on a shallow idle state target > residency to decide if need to stop a tick or not? s/This is reliable/This isn't reliable > > > /* > > * If the state selected so far is shallow and this > > * state's target residency matches the time till the > >