From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753303AbcBAKFo (ORCPT ); Mon, 1 Feb 2016 05:05:44 -0500 Received: from LGEAMRELO13.lge.com ([156.147.23.53]:36727 "EHLO lgeamrelo13.lge.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753239AbcBAKFm (ORCPT ); Mon, 1 Feb 2016 05:05:42 -0500 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, 1 Feb 2016 19:05:13 +0900 From: Byungchul Park To: Peter Zijlstra Cc: Frederic Weisbecker , LKML , Chris Metcalf , Thomas Gleixner , Luiz Capitulino , Christoph Lameter , "Paul E . McKenney" , Mike Galbraith , Rik van Riel Subject: Re: [PATCH 1/4] sched: Don't account tickless CPU load on tick Message-ID: <20160201100513.GD29804@X58A-UD3R> References: <1452700891-21807-1-git-send-email-fweisbec@gmail.com> <1452700891-21807-2-git-send-email-fweisbec@gmail.com> <20160119130857.GC6344@twins.programming.kicks-ass.net> <20160119162210.GA5317@lerouge> <20160119185647.GA6357@twins.programming.kicks-ass.net> <20160119223320.GD5317@lerouge> <20160120054335.GE9882@X58A-UD3R> <20160120102614.GA5310@X58A-UD3R> <20160128160125.GB25866@lerouge> <20160129095016.GZ6356@twins.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160129095016.GZ6356@twins.programming.kicks-ass.net> 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 Fri, Jan 29, 2016 at 10:50:16AM +0100, Peter Zijlstra wrote: > On Thu, Jan 28, 2016 at 05:01:26PM +0100, Frederic Weisbecker wrote: > > So lets check all the things we call on scheduler_tick(): > > > > _ sched_clock_tick(): maybe it doesn't need to be called when idle. I'm not sure. > > Some code in idle (timers, irqs, ...) might need to call sched_clock(). > > Only needed if you've got a shady TSC. Yeh.. IMO, this can be done without the tick handling during nohz, with the patch I am attaching. Could you check the patch? Or we have to handle it remotely, too. (for a crazy TSC) > > > _ update_rq_clock(), task_tick(): task_tick is empty for idle class, so we probably > > don't need an updated rq either. > > Right, for regular NOHZ we'll be running the idle task, and the idle > tick handler is empty. So for NOHZ you can ignore this. > > For NOHZ_FULL you'll not be running the idle task and this gets > 'interesting'. > > The most important part would be tracking the task runtime, which is > used for a number of user visible things. This should be doable > remotely. Isn't there any way to show it to user at the time it's requested? > > > _ update_cpu_load_active(): I was about to fix the issue properly and make it account > > correctly on idle ticks but we might as well want to spare it. > > Right, we've gone over this one in detail in other emails I think. Doing it remotely... hm... > > > _ calc_global_load_tick(): no idea > > Can easily be done remote. However, this only records deltas of > nr_active (:= nr_running + nr_uninterruptible) and for NOHZ and > NOHZ_FULL this should not change, therefore the delta _should_ be 0 and > you can skip this. It sounds good. > > > _ perf_event_task_tick(): needed, some freq CPU events can trigger in idle and need > > adjustments > > Right, this is a tricky one. Maybe I should look into moving this into a > hrtimer, but that too has 'fun' problems IIRC. I'll put it on the TODO > list somewhere. Good luck. I'm sure you'll do well. > > > _ trigger_load_balance(): maybe needed, I see it triggers the softirq after some > > rebalance delay, regardless of the current CPU idleness. > > We already have NOHZ remote balancing, we could (and should) probably do I think so. > the same for NOHZ_FULL. Then again, I would expect the NOHZ_FULL cpus to > not actually be part of a balance domain, so we could probably detect Could not the NOHZ_FULL cpus be part of a balance domain? It sounds good. > and short-circuit this. > > > _ rq_last_tick_reset(): not needed in idle > > Right, part of the NOHZ_FULL 'hack', once you fix all the remote > accounting stuff this could go away entirely think. I'm sure it can be removed eventually!