Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp1253506pxu; Thu, 17 Dec 2020 06:02:43 -0800 (PST) X-Google-Smtp-Source: ABdhPJwODLmemTLNuNbl9g2kTqexVj+aPZUstJldRFhPTZ+6aLwU23Lgb+E5txUQl7i/CrF/bW9A X-Received: by 2002:a2e:501e:: with SMTP id e30mr15483608ljb.387.1608213761738; Thu, 17 Dec 2020 06:02:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1608213761; cv=none; d=google.com; s=arc-20160816; b=C9nqyg1DLi3V2rLx2r5t0WIpaCdo+8PFzHB3WmwTj9wnZ5PTL/CcBh+C6+jtGmotIc YXXl8ctMVyRQXXf/7zATvdhBEK1eiQyyjcN+6zm3VYquXTbsz3Hnxlr0wIEfxdLKxEo9 LZOogeTLmKxCrJ+BQg87I6bKSLJtv8p4Zn2urvvLtqR9BXIwlIHP5APrU9fzZHDoiPMa wWGHW2eS3px0iH7qUt8u3O7IF6nOmlwCynC1iVZOuHs9shMnUL8xcSK4LJdoTONAc5NU vJR/c1A7MbiuHZAud54kk6Ym50tIf7o8wOusDDDIc1vQ1b25QuiWBKRtHlA+j/hcaUfK OQpg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:dkim-signature:date; bh=1n13omCv0aVbC903nh4r1I6lrOr6ZlQhGlNOhUuT+dU=; b=qz9Xusw6xSNAHPehO391kEsL+0oSIsPb7N+hw6q+lS1R2ZYTd6v0Eg8jRYaOecbb5L 8/AJI7RU5lsky7vMl8AqHW2YHaEhsrdvmSZT/KQ+vpusHsWOygrsSchaBYyAOweNd60r ecL94mpmAPPP/np+56OPDjjcq/6zVHvGMk8tixZD5YdmDOQUXGWUQ2JcUVb+zKxrFQV/ PDNrKMMU7DHCbeLq+9ua0geOdY0cLO3zRkQbv7pmNhNvtVrF0MlUkU3PQikdq0HZ/pa4 /iFgmL6tNEGKltD84WdajtIgBpoDXIuxTMRT/C94+9o0wcSM/PpWzTAu11JzjtqqcIUh sIng== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=gerW71+P; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f8si2618349ejc.50.2020.12.17.06.02.17; Thu, 17 Dec 2020 06:02:41 -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; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=gerW71+P; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726601AbgLQOAn (ORCPT + 99 others); Thu, 17 Dec 2020 09:00:43 -0500 Received: from mail.kernel.org ([198.145.29.99]:59582 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726488AbgLQOAn (ORCPT ); Thu, 17 Dec 2020 09:00:43 -0500 Date: Thu, 17 Dec 2020 14:59:59 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1608213602; bh=svPMXpH6bDkIdejaUcdO9VkfvHen07wvadh8PJV0fLU=; h=From:To:Cc:Subject:References:In-Reply-To:From; b=gerW71+PdJ1eyajH7qobdOXQoi6N5swnm8mDW5oLR0j6UgEIQxj/W9nYT+QA8XKMB sOozaDaRYYdmSyRoZ3Hdz1kj1w+YUeWoV6hc8p0t5+jJsmaU2O/PLcFrk2ILyZ2ssR uye8S3kDU23g7jO/MTqcjP2KvlZYEZjN3X8UEnXHBMuK40AqUtL9n5kQ25s9HNf/jD QasEVpv0Jg0Mpnrh5fsZFQjL2LDRTzM41cyZh/rPFHDACNMaICOVgMJ431/oTL2ea+ lPAAWWzxSgYYUxF+85f/bvZJ6OAR3cXvDgYS4L0PT9SCdLz1m/LXO/Jj/22chXUybX tAwsEoc4u6CHg== From: Frederic Weisbecker To: Yunfeng Ye Cc: fweisbec@gmail.com, tglx@linutronix.de, mingo@kernel.org, linux-kernel@vger.kernel.org, Shiyuan Hu , Hewenliang Subject: Re: [PATCH] tick/nohz: Make the idle_exittime update correctly Message-ID: <20201217135959.GA3736@lothringen> References: <2e194669-c074-069c-4fda-ad5bc313a611@huawei.com> <20201215144757.GA9391@lothringen> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. Thanks.