Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp1707131pxu; Thu, 17 Dec 2020 17:10:53 -0800 (PST) X-Google-Smtp-Source: ABdhPJwc3D9FrVLxDWuEPXcom5IrvYZrlKUU7LI0GgqU6MHKpaVyT177oW9YFGoxl0ewMqiSKkXH X-Received: by 2002:a05:6402:895:: with SMTP id e21mr2106268edy.284.1608253853568; Thu, 17 Dec 2020 17:10:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1608253853; cv=none; d=google.com; s=arc-20160816; b=thVWBBxF6YFcgMG4E4L7GFkeFdelMjmrgfO7cvzXE95K4rW3AIIt5Ihhm3A7ZqPm1h 2t4LgNApw9+rH8o0KQRSNUO1F8TnLKgl9w1vdmsCuezaojuRPyk///OD3jNM+2qqe44S Zzwd0bBR4tDJlXItMQuyNLJ8yoOij4d16+at+QGMMu7ycXX+ALOY1zrfRIIELASHrjyp uBajgQmit5yLdz8zvuxTritLDa60yGhevjZUNT6lfi2+oyhjmvIlq3c8bDwsGCX797q8 F+udLWP6vbq3eZxSuFWT/7JLBWWaSZQxeC5x/VxWFuwQpDsuh9YaZg8cmOEv6BLqcf+F TUHw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=MCBJRc1rIQknFK9FaZdmlBg5LXFPcrlVMIG+dd4Lzn4=; b=M/jbZPtKmg6y8Q1FG6jE05jExEw8ML/ppexgI5g9hadOyPuGqlDPNwUWgYpqLUCTc0 mhoauS/GjQVP13bAIACPZFmKbGbrUVnaluOCcy5oe+mQzsFd/DvDx0+LvXlmhCNLz4Mv 2Y4IplCcEC+/90LEkkhSRm52I+mHTDxNrkfyzQfWomQ3QpTvmnTYOiSwJsJgMMrHU94Q 0xjZfCEClMBHHYsSG8v+zjC+xJL6lnVlvyOGHH1Y5dRuzvSq3CUjhpHeozbUsYixEMeo n4V3r+ygrgsbIbySiqznuclMMTg/hsSAmfsqcNSHLGR+C9OkcHD0PRF/naDWoV1Y75Vf DqIQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id k9si5566149edo.487.2020.12.17.17.10.31; Thu, 17 Dec 2020 17:10:53 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731893AbgLRAzY (ORCPT + 99 others); Thu, 17 Dec 2020 19:55:24 -0500 Received: from szxga05-in.huawei.com ([45.249.212.191]:9537 "EHLO szxga05-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731747AbgLRAzY (ORCPT ); Thu, 17 Dec 2020 19:55:24 -0500 Received: from DGGEMS403-HUB.china.huawei.com (unknown [172.30.72.60]) by szxga05-in.huawei.com (SkyGuard) with ESMTP id 4Cxr3G2JDkzhp6S; Fri, 18 Dec 2020 08:54:02 +0800 (CST) Received: from [10.174.176.199] (10.174.176.199) by DGGEMS403-HUB.china.huawei.com (10.3.19.203) with Microsoft SMTP Server id 14.3.498.0; Fri, 18 Dec 2020 08:54:33 +0800 Subject: Re: [PATCH] tick/nohz: Make the idle_exittime update correctly To: Frederic Weisbecker CC: , , , , Shiyuan Hu , Hewenliang References: <2e194669-c074-069c-4fda-ad5bc313a611@huawei.com> <20201215144757.GA9391@lothringen> <20201217135959.GA3736@lothringen> From: Yunfeng Ye Message-ID: <58b1fd2e-e2a2-ab7f-33e5-71e0e5653578@huawei.com> Date: Fri, 18 Dec 2020 08:54:22 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: <20201217135959.GA3736@lothringen> Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.174.176.199] X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 >>>> --- >>>> 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. > . >