All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Gleixner <tglx@linutronix.de>
To: Wang Qing <wangqing@vivo.com>,
	Frederic Weisbecker <fweisbec@gmail.com>,
	Ingo Molnar <mingo@kernel.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	Petr Mladek <pmladek@suse.com>, Wang Qing <wangqing@vivo.com>,
	Santosh Sivaraj <santosh@fossix.org>,
	"Peter Zijlstra (Intel)" <peterz@infradead.org>,
	linux-kernel@vger.kernel.org, Tejun Heo <tj@kernel.org>
Subject: Re: [PATCH RFC 1/2] hrtimer: support hrtimer suspend when CPU suspend
Date: Tue, 10 Aug 2021 16:58:10 +0200	[thread overview]
Message-ID: <87zgtpqrct.ffs@tglx> (raw)
In-Reply-To: <1624352816-26450-2-git-send-email-wangqing@vivo.com>

On Tue, Jun 22 2021 at 17:06, Wang Qing wrote:
>  /**
> diff --git a/kernel/time/hrtimer.c b/kernel/time/hrtimer.c
> index 4a66725..db34c9d
> --- a/kernel/time/hrtimer.c
> +++ b/kernel/time/hrtimer.c
> @@ -513,7 +513,8 @@ static ktime_t __hrtimer_next_event_base(struct hrtimer_cpu_base *cpu_base,
>  
>  		next = timerqueue_getnext(&base->active);
>  		timer = container_of(next, struct hrtimer, node);
> -		if (timer == exclude) {
> +		if ((timer == exclude) ||
> +		(tick_nohz_tick_inidle() && timer->is_suspend)) {

Aside of being indented in unreadable ways, how is this supposed to be
correct? If the first expiring timer is excluded what prevents the next
one from being marked to stop in suspend or the other way round.

What's wrong with just canceling the offending timer before going into
suspend and rearming it on resume instead of adding a half baken magic
case for timers?

Thanks,

      tglx

  reply	other threads:[~2021-08-10 14:58 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-22  9:06 [PATCH RFC 0/2] hrtimer: watchdog: support hrtimer suspend when CPU suspend Wang Qing
2021-06-22  9:06 ` [PATCH RFC 1/2] hrtimer: " Wang Qing
2021-08-10 14:58   ` Thomas Gleixner [this message]
2021-06-22  9:06 ` [PATCH RFC 2/2] watchdog: support watchdog " Wang Qing

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=87zgtpqrct.ffs@tglx \
    --to=tglx@linutronix.de \
    --cc=akpm@linux-foundation.org \
    --cc=fweisbec@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=peterz@infradead.org \
    --cc=pmladek@suse.com \
    --cc=santosh@fossix.org \
    --cc=tj@kernel.org \
    --cc=wangqing@vivo.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.