lkml.org 
[lkml]   [2021]   [Jan]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] fix the issue that the tick_nohz_get_sleep_length() function could return a negative value
From
Date
On 1/20/21 10:58 AM, Zhou Ti (x2019cwm) wrote:
> Fix the issue that the tick_nohz_get_sleep_length() function could return
> a negative value.
>
> The variable "next_event" has a small possibility to be smaller than the
> variable "now" during running. Since both the menu idle governor and the
> teo idle governor use u64 to store the return value of the function, this
> may result in an extremely large and invalid value.
>
> One can easily detect the existence of this issue by using printk to
> output a warning.
>
> Signed-off-by: Ti Zhou <x2019cwm@stfx.ca>
> ---
> --- tip/kernel/time/tick-sched.c.orig 2021-01-20 05:34:25.151325912 -0400
> +++ tip/kernel/time/tick-sched.c 2021-01-20 07:09:15.060980886 -0400
> @@ -1156,6 +1156,9 @@ ktime_t tick_nohz_get_sleep_length(ktime
> next_event = min_t(u64, next_event,
> hrtimer_next_event_without(&ts->sched_timer));
>
> + if (unlikely(next_event < now))
> + next_event = now;
> +
> return ktime_sub(next_event, now);
> }
>

Hi,

You need to send this to some maintainer who can apply/merge it.
Just sending it to a mailing list is not sufficient.

thanks.
--
~Randy

\
 
 \ /
  Last update: 2021-01-21 01:28    [W:0.045 / U:3.600 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site