lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Thu, 17 Dec 2020 14:51:58 +0800
From:   Yunfeng Ye <yeyunfeng@...wei.com>
To:     Frederic Weisbecker <frederic@...nel.org>
CC:     <fweisbec@...il.com>, <tglx@...utronix.de>, <mingo@...nel.org>,
        <linux-kernel@...r.kernel.org>, Shiyuan Hu <hushiyuan@...wei.com>,
        Hewenliang <hewenliang4@...wei.com>
Subject: Re: [PATCH] tick/nohz: Make the idle_exittime update correctly



On 2020/12/15 22:47, Frederic Weisbecker wrote:
> On Tue, Dec 15, 2020 at 08:06:34PM +0800, Yunfeng Ye wrote:
>> The idle_exittime field of tick_sched is used to record the time when
>> the idle state was left. but currently the idle_exittime is updated in
>> the function tick_nohz_restart_sched_tick(), which is not always in idle
>> state when nohz_full is configured.
>>
>>   tick_irq_exit
>>     tick_nohz_irq_exit
>>       tick_nohz_full_update_tick
>>         tick_nohz_restart_sched_tick
>>           ts->idle_exittime = now;
>>
>> So move to tick_nohz_stop_idle() to make the idle_exittime update
>> correctly.
>>
>> Signed-off-by: Yunfeng Ye <yeyunfeng@...wei.com>
>> ---
>>  kernel/time/tick-sched.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/kernel/time/tick-sched.c b/kernel/time/tick-sched.c
>> index 749ec2a583de..be2e5d772d50 100644
>> --- a/kernel/time/tick-sched.c
>> +++ b/kernel/time/tick-sched.c
>> @@ -591,6 +591,7 @@ static void tick_nohz_stop_idle(struct tick_sched *ts, ktime_t now)
>>  {
>>  	update_ts_time_stats(smp_processor_id(), ts, now, NULL);
>>  	ts->idle_active = 0;
>> +	ts->idle_exittime = now;
> 
> This changes a bit the meaning of idle_exittime then since this is also called
> from idle interrupt entry.
> 
> __tick_nohz_idle_restart_tick() would be a better place.
> 
So is it necessary to modify the comment "@idle_exittime:      Time when the idle state was left" ?

On the other hand, if the patch "nohz: Update tick instead of restarting tick in tick_nohz_idle_exit()"
(https://www.spinics.net/lists/kernel/msg3747039.html ) applied, __tick_nohz_idle_restart_tick will not
be called always, So is it put here also a better place?

Thanks.

> Thanks.
> 
>>
>>  	sched_clock_idle_wakeup_event();
>>  }
>> @@ -901,7 +902,6 @@ static void tick_nohz_restart_sched_tick(struct tick_sched *ts, ktime_t now)
>>  	 * Cancel the scheduled timer and restore the tick
>>  	 */
>>  	ts->tick_stopped  = 0;
>> -	ts->idle_exittime = now;
>>
>>  	tick_nohz_restart(ts, now);
>>  }
>> -- 
>> 2.18.4
>>
> .
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ