Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp3430737pxu; Tue, 15 Dec 2020 06:57:25 -0800 (PST) X-Google-Smtp-Source: ABdhPJzp8rMN82OHQwZysJfWJooi7GtnQGRo/bsSnjQw5osB49MWLW43AIyLLGzJ1znG1f8qQaE+ X-Received: by 2002:a50:fd10:: with SMTP id i16mr30176833eds.331.1608044245626; Tue, 15 Dec 2020 06:57:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1608044245; cv=none; d=google.com; s=arc-20160816; b=X2YV0oMIB1jCO5pBEc/G6u9uTgObmahyj3mT5jD9cHLRgriZDqr26rWwyPCvYcJQev IzAbFs2Sp7tGQieLV2f/1w+4wtyDLq05RycMkid1RlQBx64qn5LO9hSEjNHEznPnKtw1 +B7alZjSJv7Q/gGuWLjFmLu5Lr7yj4nswYEXPSZlrX+xbGpLdvOVem0Sfmue7v0+fzI5 2wcpJl3FDkvQcUjYlQLL+m4K5SNK3iRG8hqilBCK2ETPCSmZcIxXFveUEnyzBxOZVN4I AdoTcR3y7owr4zlUmcN8yeFpiyuelNxW9Bhy+rN7lRDInpbWj+r0LJYue2Bu5gyOx7gr I6SA== 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=mKPOC0fOeYpqUiRc5sGns6PP84o6igQlHCu6uYzzOvg=; b=r7qaqTXlZgoviWpk+qXySSX0Zjw4631DX4TOzkg1ujy3UXYkeFKhdlapqOO7OAwu4g P1vSN40xndPceIGQ3L9bWGjv1QaCs8T/BsyyQTMSu2HrILDeYEJ6dA41tXRA7QkhnhbR f7+x5eGIPSYbDl+W6AY5ybf6yhLun2c16/CwrfopjKKJ4EsbQt65Ma1KcujDjS/B0DvY yGEfsKlTCt1KDUFN2HKqBgODVpdgj9v0oL5MtnJ7lLdVtXwvHobUu5J2diC/SpS+nEvf q9M2Q0rO45ayr5H54/BV1FdLLkQNq00m8RBxjTMXoTu+TOppcZ5Jp/Ua17C9T65/voUa FwBw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=hZDbF8Cp; 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 l22si1000841ejr.379.2020.12.15.06.57.00; Tue, 15 Dec 2020 06:57:25 -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=hZDbF8Cp; 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 S1729785AbgLOOtV (ORCPT + 99 others); Tue, 15 Dec 2020 09:49:21 -0500 Received: from mail.kernel.org ([198.145.29.99]:51320 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729956AbgLOOsl (ORCPT ); Tue, 15 Dec 2020 09:48:41 -0500 Date: Tue, 15 Dec 2020 15:47:57 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1608043680; bh=3serOWbyduZ2yrQbYJh0/hEbtH+9UG4Dr9BcYAGBeqA=; h=From:To:Cc:Subject:References:In-Reply-To:From; b=hZDbF8Cp0tEi+xQnWRVpV2gn1IsachLysLi0EIJzxG8jZlb9h1ovM6KFaNQRSAg6o 22xVSm3cfy90+ASODJZiO3Ncxn9AJLR1swvS/W981PG5YHEc6cBoAcPUfe2iLFFvMY QVUykC9x7/wxjs9UcBB61d68YmVgY4ELJwdqf5N8f2Fl8v/v/OxPr8EHITvsvh81os EBO7dkVjNlKRmJoUKrUXBgyGDLzWSLknnFC7eyGcU5m6YV9H/V8cRY4xs9ZKAz18m1 pR36JbXG/nWBOVR8feySxf4n5u69WfpGwSRyxQpqKFKRHqpiuZ3gr5C1944GU/7CP/ pwFyY8CXW9nEQ== 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: <20201215144757.GA9391@lothringen> References: <2e194669-c074-069c-4fda-ad5bc313a611@huawei.com> 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 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. 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 >