lkml.org 
[lkml]   [2021]   [Aug]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH RFC 1/2] hrtimer: support hrtimer suspend when CPU suspend
Date
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

\
 
 \ /
  Last update: 2021-08-10 16:59    [W:0.047 / U:1.332 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site