From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752054AbcDRJRw (ORCPT ); Mon, 18 Apr 2016 05:17:52 -0400 Received: from LGEAMRELO12.lge.com ([156.147.23.52]:38044 "EHLO lgeamrelo12.lge.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751394AbcDRJRw (ORCPT ); Mon, 18 Apr 2016 05:17:52 -0400 X-Original-SENDERIP: 156.147.1.121 X-Original-MAILFROM: byungchul.park@lge.com X-Original-SENDERIP: 10.177.222.33 X-Original-MAILFROM: byungchul.park@lge.com Date: Mon, 18 Apr 2016 18:17:21 +0900 From: Byungchul Park To: Frederic Weisbecker Cc: Peter Zijlstra , LKML , Chris Metcalf , Thomas Gleixner , Luiz Capitulino , Christoph Lameter , "Paul E . McKenney" , Mike Galbraith , Rik van Riel , Ingo Molnar Subject: Re: [PATCH 2/3] sched: Correctly handle nohz ticks cpu load accounting Message-ID: <20160418091721.GH2279@X58A-UD3R> References: <1460555812-25375-1-git-send-email-fweisbec@gmail.com> <1460555812-25375-3-git-send-email-fweisbec@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1460555812-25375-3-git-send-email-fweisbec@gmail.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Apr 13, 2016 at 03:56:51PM +0200, Frederic Weisbecker wrote: > @@ -4645,11 +4674,11 @@ void cpu_load_update_nohz(int active) > void cpu_load_update_active(struct rq *this_rq) > { > unsigned long load = weighted_cpuload(cpu_of(this_rq)); > - /* > - * See the mess around cpu_load_update_idle() / cpu_load_update_nohz(). > - */ > - this_rq->last_load_update_tick = jiffies; > - __cpu_load_update(this_rq, load, 1, 1); > + > + if (tick_nohz_tick_stopped()) > + cpu_load_update_nohz(this_rq, READ_ONCE(jiffies), load); > + else > + cpu_load_update_periodic(this_rq, load); Considering it further, I wonder if needing it. (Sorry if I missed something.) Case 1. tickless -> (scheduler_tick) -> tickless I am not sure for this case if the rq's load can be changed or not, especially, if the rq's load can be changed *at this point*. Please remind that the load[0] is set here. Case 2. tickless -> (scheduler_tick) -> restart tick Will be done by the tick restart routine when exiting irq. -> no problem. Case 3. tick -> (scheduler_tick) -> tickless Same as before. -> no problem. Case 4. tick -> (scheduler_tick) -> tick We can rely on regular schedule_tick(). -> no problem.