linux-pm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Lina Iyer <lina.iyer@linaro.org>
To: Thomas Gleixner <tglx@linutronix.de>
Cc: ulf.hansson@linaro.org, khilman@kernel.org, rjw@rjwysocki.net,
	linux-pm@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
	geert@linux-m68k.org, k.kozlowski@samsung.com,
	andy.gross@linaro.org, sboyd@codeaurora.org,
	linux-arm-msm@vger.kernel.org, lorenzo.pieralisi@arm.com,
	ahaslam@baylibre.com, mtitinger@baylibre.com
Subject: Re: [PATCH 08/14] timer: Export next wake up of a CPU
Date: Wed, 27 Jul 2016 09:04:54 -0600	[thread overview]
Message-ID: <20160727150454.GD1369@linaro.org> (raw)
In-Reply-To: <alpine.DEB.2.11.1607271110140.19896@nanos>

On Wed, Jul 27 2016 at 03:16 -0600, Thomas Gleixner wrote:
>On Wed, 22 Jun 2016, Lina Iyer wrote:
>> +static inline ktime_t tick_nohz_get_next_wakeup(int cpu)
>> +{
>> +	ktime_t len = { .tv64 = NSEC_PER_SEC/HZ };
>> +
>> +	/* Next wake up is the tick period, assume it starts now */
>> +	return ktime_add(len, ktime_get());
>
>  return tick_next_period;
>
>Will tell you the point where the next tick interrupt is due.
>
That definitely is better, will change.

>> +}
>> +
>>  static inline u64 get_cpu_idle_time_us(int cpu, u64 *unused) { return -1; }
>>  static inline u64 get_cpu_iowait_time_us(int cpu, u64 *unused) { return -1; }
>>  #endif /* !CONFIG_NO_HZ_COMMON */
>> diff --git a/kernel/time/tick-sched.c b/kernel/time/tick-sched.c
>> index 536ada8..addf3235 100644
>> --- a/kernel/time/tick-sched.c
>> +++ b/kernel/time/tick-sched.c
>> @@ -979,6 +979,19 @@ ktime_t tick_nohz_get_sleep_length(void)
>>  	return ts->sleep_length;
>>  }
>>
>> +/**
>> + * tick_nohz_get_next_wakeup - return the next wake up of the CPU
>> + *
>> + * Called with interrupts disabled on the cpu
>
>So why are you handing in the (undocumented) cpu argument if its called on
>that cpu anyway?
>
Oh, my comment is very misleading. The function may be called from any
CPU for any other CPU. It should be more like "Called when the
interrupts are disabled on the CPU". I guess that doesn't make sense
either. I will remove this comment.

Thanks,
Lina

>> + */
>> +ktime_t tick_nohz_get_next_wakeup(int cpu)
>> +{
>> +	struct clock_event_device *dev =
>> +			per_cpu(tick_cpu_device.evtdev, cpu);
>> +
>> +	return dev->next_event;
>
>Then this becomes
>
>     return __this_cpu_read(tick_cpu_device.evtdev)->nextevt;
>
>Thanks,
>
>	tglx

  reply	other threads:[~2016-07-27 15:04 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-06-22 19:36 [PATCH 00/14] PM: SoC idle support using PM domains Lina Iyer
2016-06-22 19:36 ` [PATCH 01/14] PM / Domains: Allow domain power states to be read from DT Lina Iyer
2016-06-23 17:38   ` Mark Rutland
     [not found] ` <1466624209-27432-1-git-send-email-lina.iyer-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2016-06-22 19:36   ` [PATCH 02/14] dt/bindings: update binding for PM domain idle states Lina Iyer
     [not found]     ` <1466624209-27432-3-git-send-email-lina.iyer-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2016-06-23 17:35       ` Mark Rutland
2016-06-23 18:04         ` Lina Iyer
     [not found]           ` <20160623180451.GD1115-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
2016-06-23 18:19             ` Mark Rutland
2016-06-23 18:39               ` Lina Iyer
2016-06-22 19:36 ` [PATCH 03/14] PM / Domains: Abstract genpd locking Lina Iyer
2016-06-22 19:36 ` [PATCH 04/14] PM / Domains: Support IRQ safe PM domains Lina Iyer
2016-06-22 19:36 ` [PATCH 05/14] PM / doc: update device documentation for devices in " Lina Iyer
2016-07-25 22:50   ` Kevin Hilman
2016-07-25 23:21     ` Lina Iyer
2016-06-22 19:36 ` [PATCH 06/14] PM / cpu_domains: Setup PM domains for CPUs/clusters Lina Iyer
2016-06-22 19:36 ` [PATCH 07/14] ARM: cpuidle: Add runtime PM support for CPUs Lina Iyer
2016-06-22 19:36 ` [PATCH 08/14] timer: Export next wake up of a CPU Lina Iyer
2016-07-26 18:26   ` Kevin Hilman
2016-07-27  9:14   ` Thomas Gleixner
2016-07-27 15:04     ` Lina Iyer [this message]
2016-06-22 19:36 ` [PATCH 09/14] PM / cpu_domains: Add PM Domain governor for CPUs Lina Iyer
2016-06-22 19:36 ` [PATCH 10/14] doc / cpu_domains: Describe CPU PM domains setup and governor Lina Iyer
2016-06-22 19:36 ` [PATCH 11/14] drivers: firmware: psci: Allow OS Initiated suspend mode Lina Iyer
2016-06-24  4:25   ` Vikas Sajjan
2016-06-24 16:53     ` Lina Iyer
2016-06-27 10:12     ` Mark Rutland
2016-06-28  6:07       ` Vikas Sajjan
2016-06-22 19:36 ` [PATCH 12/14] drivers: firmware: psci: Support cluster idle states for OS-Initiated Lina Iyer
2016-06-22 19:36 ` [PATCH 13/14] ARM64: dts: Add PSCI cpuidle support for MSM8916 Lina Iyer
2016-06-22 19:36 ` [PATCH 14/14] ARM64: dts: Define CPU power domain " Lina Iyer
2016-07-26 22:08 ` [PATCH 00/14] PM: SoC idle support using PM domains Kevin Hilman
2016-07-27 15:06   ` Lina Iyer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20160727150454.GD1369@linaro.org \
    --to=lina.iyer@linaro.org \
    --cc=ahaslam@baylibre.com \
    --cc=andy.gross@linaro.org \
    --cc=geert@linux-m68k.org \
    --cc=k.kozlowski@samsung.com \
    --cc=khilman@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=lorenzo.pieralisi@arm.com \
    --cc=mtitinger@baylibre.com \
    --cc=rjw@rjwysocki.net \
    --cc=sboyd@codeaurora.org \
    --cc=tglx@linutronix.de \
    --cc=ulf.hansson@linaro.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).