Received: by 10.223.176.5 with SMTP id f5csp3146943wra; Thu, 1 Feb 2018 11:31:24 -0800 (PST) X-Google-Smtp-Source: AH8x227y81eNwds40HpzTvkJu+mzR5f4FmgHnQk9PifXfDGYGvquZix3FqlWlwZmCGhsUvzmP9EZ X-Received: by 10.99.178.85 with SMTP id t21mr28572469pgo.296.1517513484840; Thu, 01 Feb 2018 11:31:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517513484; cv=none; d=google.com; s=arc-20160816; b=ufsR7UYd6YwY/Bd2Tz3BpgBDRQnTJHMsS0+s9MAfjVggQAxeW1CkSSJP+le/KpQ8Dx ZEQHSRwGXgEbQvp875odGRVAs5g07dJYGZX1WKTlKfWyVSImDC0q4ML8OojRLtScyltl rytWHrBm54CWXXX1t3spEhUb0LD6IlYGJR5iUHTjrCv3HcYATqkqrH1CG+ZWZfz3uBMw Q8gC+a2wu00Jys2h7/fdieuzepBz6dHSr0zbdYfudcrKdf3kpinHf6ZYqrRynkEJ/9iG 4EzP38WeYzz+GwYrsdqCjVM535OumEySWvInYAlpHke+8asX7OnpfosLe0So2F0C4x0E 1EIQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=pdTgexM07RGyXDbRmzsQkBRYjE+PqTKTL90u9HiBUx0=; b=fsuecDHdaZU5UNSZPLf5+xsetY7s0/jnBWXjw/B28u+lhLQO+erLSxtQKG6XOBWUZE y9i6qHABnaZ7P+jBYvD5mEop4xVhsCz2pFwF0KYJiuJ3XsyB3OeRlIpnSe04QUXcl2cC e0EjQg6Q53tUnb6C4/Q+Y3fLMPEQudX9XBY7j60M2QSfh6Kf2cXIU8SZfLDwuXwjnFhs FV7g5NBjgvjTkehLx+zYeP8iXKjGDNz3YuVuXo54MKowFNoaevjA9aMZTvk7CLrwu+HM p6N9WifcDYznNcFLRAK7LmNC2SNVPR3DgGB96T3a4P6eNDf+jFVc4MsOTpv9WvZBi6gJ BYoQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=UqleLyPp; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a22-v6si245520pls.119.2018.02.01.11.31.09; Thu, 01 Feb 2018 11:31:24 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=UqleLyPp; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754647AbeBATLg (ORCPT + 99 others); Thu, 1 Feb 2018 14:11:36 -0500 Received: from mail-it0-f66.google.com ([209.85.214.66]:51108 "EHLO mail-it0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752973AbeBATLa (ORCPT ); Thu, 1 Feb 2018 14:11:30 -0500 Received: by mail-it0-f66.google.com with SMTP id x128so5569631ite.0 for ; Thu, 01 Feb 2018 11:11:30 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=pdTgexM07RGyXDbRmzsQkBRYjE+PqTKTL90u9HiBUx0=; b=UqleLyPpWYFSIcT5Rrofzb0grfH/qJEsHz7io/zWrSlx64WpgY+pd0LonRzkEq76p/ xZDPOjjdXyM2ixNjdyGIw2k7jKXqZt/R62fgK+nYQwj8WPXMxZS//KQWDCZiyJWjre1C 9atIiZkSoHqvoeI7+fD3q5Igrumzugvutg9Dg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=pdTgexM07RGyXDbRmzsQkBRYjE+PqTKTL90u9HiBUx0=; b=GScNKer3MYj7H6xRMlJ+wuoHDRheF/8HMco9Y14Cm8X9spc5un3u9T+LHoQt7fOXaj v7g/AbBqTHZYNi5CQuWdSVgC227j8pwFQyonr3VnlQVaG96HSIMZ/G4mWKNJzcQT9F1C yJtcLxdxWdUrL6C8efKARGvHF7DT+/3FwoGGzMp4FmkeQYiNq2ZtKp03dTp6r1ZklhYM yem+nA+mXqxfCxuOVfIBotMauZWMkEMp95qs0qT23qhgt3YzFZJQ/mjusAntS4LjVfZa 3AS3wbrh0+mqdAUv9U/4FKQJVSC/eBBsRhwmVN5a7StknsPJz3pMw8AnzSviaG8doB7S 54qw== X-Gm-Message-State: AKwxyteFlMz6rnVT3Y2+BgzFPVpGy+vzseAzJEeY3RhpXnFTZSkjtsxW mviS+/jBhz0TGBzBLvhh27HmYcD5b3tRjQmvkuVDUQ== X-Received: by 10.36.241.65 with SMTP id q1mr39196509iti.4.1517512289550; Thu, 01 Feb 2018 11:11:29 -0800 (PST) MIME-Version: 1.0 Received: by 10.107.50.198 with HTTP; Thu, 1 Feb 2018 11:11:08 -0800 (PST) In-Reply-To: <20180201181041.GF2269@hirez.programming.kicks-ass.net> References: <20171222082915.4lcb7xyyooqyjpia@hirez.programming.kicks-ass.net> <20171222091221.ow5vn3ydx3hj4nht@hirez.programming.kicks-ass.net> <20171222185629.lysjebfifgdwvvhu@hirez.programming.kicks-ass.net> <20171222204247.kyc6ugyyu3ei7zhs@hirez.programming.kicks-ass.net> <20180115082609.GA6320@linaro.org> <20180118103807.GD28799@e105550-lin.cambridge.arm.com> <20180124082536.GA32318@linaro.org> <20180201181041.GF2269@hirez.programming.kicks-ass.net> From: Vincent Guittot Date: Thu, 1 Feb 2018 20:11:08 +0100 Message-ID: Subject: Re: [RFC PATCH 2/5] sched: Add NOHZ_STATS_KICK To: Peter Zijlstra Cc: Morten Rasmussen , Ingo Molnar , linux-kernel , Brendan Jackman , Dietmar Eggemann , Morten Rasmussen Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 1 February 2018 at 19:10, Peter Zijlstra wrote: > On Wed, Jan 24, 2018 at 09:25:36AM +0100, Vincent Guittot wrote: >> @@ -8861,7 +8875,14 @@ static int idle_balance(struct rq *this_rq, struct rq_flags *rf) >> update_next_balance(sd, &next_balance); >> rcu_read_unlock(); >> >> - if (time_after(jiffies, next) && atomic_read(&nohz.stats_state)) >> + /* >> + * Update blocked idle load if it has not been done for a >> + * while. Try to do it locally before entering idle but kick a >> + * ilb if it takes too much time and might delay next local >> + * wake up >> + */ >> + if (time_after(jiffies, next) && atomic_read(&nohz.stats_state) && >> + !_nohz_idle_balance(this_rq, NOHZ_STATS_KICK, CPU_NEWLY_IDLE)) >> kick_ilb(NOHZ_STATS_KICK); >> >> goto out; > > This I really dislike. We're here because avg_idle is _really_ low, we > really should not then call _nohz_idle_balance(). Yes. In fact I was targeting the case were (this_rq->avg_idle >= sysctl_sched_migration_cost) and the system is not overloaded