All of lore.kernel.org
 help / color / mirror / Atom feed
From: Yunfeng Ye <yeyunfeng@huawei.com>
To: Frederic Weisbecker <frederic@kernel.org>
Cc: <fweisbec@gmail.com>, <tglx@linutronix.de>, <mingo@kernel.org>,
	<linux-kernel@vger.kernel.org>, Shiyuan Hu <hushiyuan@huawei.com>,
	Hewenliang <hewenliang4@huawei.com>
Subject: Re: [PATCH] tick/nohz: Make the idle_exittime update correctly
Date: Fri, 18 Dec 2020 08:54:22 +0800	[thread overview]
Message-ID: <58b1fd2e-e2a2-ab7f-33e5-71e0e5653578@huawei.com> (raw)
In-Reply-To: <20201217135959.GA3736@lothringen>



On 2020/12/17 21:59, Frederic Weisbecker wrote:
> On Thu, Dec 17, 2020 at 02:51:58PM +0800, Yunfeng Ye wrote:
>>
>>
>> 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@huawei.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?
> 
> Right but I need to re-order some code before. That's ok, I'll integrate this
> patch inside the changes.
> 
Ok, thanks.

> Thanks.
> .
> 

  reply	other threads:[~2020-12-18  0:55 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-05  9:41 [PATCH] tick/nohz: Make the idle_exittime update correctly Yunfeng Ye
2020-12-15 12:06 ` Yunfeng Ye
2020-12-15 14:47   ` Frederic Weisbecker
2020-12-17  6:51     ` Yunfeng Ye
2020-12-17 13:59       ` Frederic Weisbecker
2020-12-18  0:54         ` Yunfeng Ye [this message]
2021-02-19 12:33 ` Frederic Weisbecker

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=58b1fd2e-e2a2-ab7f-33e5-71e0e5653578@huawei.com \
    --to=yeyunfeng@huawei.com \
    --cc=frederic@kernel.org \
    --cc=fweisbec@gmail.com \
    --cc=hewenliang4@huawei.com \
    --cc=hushiyuan@huawei.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=tglx@linutronix.de \
    /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.