From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1165537AbdD2QHr (ORCPT ); Sat, 29 Apr 2017 12:07:47 -0400 Received: from mout.gmx.net ([212.227.15.15]:58876 "EHLO mout.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1034017AbdD2QHi (ORCPT ); Sat, 29 Apr 2017 12:07:38 -0400 Message-ID: <1493482000.4547.6.camel@gmx.de> Subject: [patch] timer: Fix timers_update_migration(), and call it in tmigr_init() From: Mike Galbraith To: LKML Cc: Ingo Molnar , "Paul E. McKenney" , Ingo Molnar , Thomas Gleixner , PeterZijlstra , Frederic Weisbecker Date: Sat, 29 Apr 2017 18:06:40 +0200 In-Reply-To: <1493209836.21594.29.camel@gmx.de> References: <1493193739.4412.30.camel@gmx.de> <1493194602.21594.4.camel@gmx.de> <20170426082137.koj7q3ftfqw3o22u@gmail.com> <1493195514.21594.5.camel@gmx.de> <1493197062.21594.8.camel@gmx.de> <20170426102617.l62cdn4gs4h5i4fw@hirez.programming.kicks-ass.net> <1493206789.21594.25.camel@gmx.de> <1493209836.21594.29.camel@gmx.de> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.16.5 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K0:DXK7ttDoAUkPtRuSfjEQxxqS4rAYgKjcsGDH2Q61PNwj1aa6yR+ y4yMeGbiA0eh37Exnp0mG/lTol0C8e5DPFngcKI6PSS2r7o1qknlYVrLlOdMOCMH8Tw5O3C uHIP1ZnxDanJdNt0zAxepWiBz7245/Jz9j3LS0AsZ1zcv9fIwqrUyIsb39vngs8MHWDq2eX M0zlguP3D17jVmAQlOiEQ== X-UI-Out-Filterresults: notjunk:1;V01:K0:W+jcDZTvTIs=:aTypc2T94BnbBjgzMCrt7B LQzRd2nWBB5WSXKKLDqHf+fnBraAxiphghbi+p9fglz90b+XDD1OtTQZ5DxAprE3YN55yh899 dYG7bBSFLl+68MP8m43zOr/ZPbrpfkfA2hNbzRYr/P2LOYYB7r4ulZiielAVczZT0e4dZLdI9 aXjCGFrWtSzs1uou9uyHGIANvhRD2JwbD5GjpEsiZIbn7wVCWfQy3hLzlVa2mz6MVz+J5mFrc ihuGEOlgQdyawElO69l+WLhcJm6Q+2wE/iiJhtU5VzRBLLYokHRNEx9EbUBq9xPh80YqbK32O prCyfYenV0XN50c0aIa7hCkoSlWmhFUUNXq21Ju5xWXCUtbHv/qPJLlc8XEQWrwHKoHtL+ZJW avIweKtRGMmPL4DALciqifFGAd71CQ6HBkBJ9ZXnO3o8p6U/Qf39wPnju/EmL2+l9CkTNpmdl 81PZnMrn9jWDz2w+9NLuIMcSIwnblCe1L3BUNkHkFivT1lCHO5dUnHG/ZPK0tFS3BoLK3CyAK gayNAoDc0mgUPFMkgtlPWigdOXwUJ2OCeiG65+f6WxY8aS0vMAdRgJhNwBHe3NcTTdFskudLv 5uvteDcRf7yizkH3T5Eu+FhB5C0HZ/LY54DPN8wHKO29LXzrqBYi9zezeJfpWMiiVIljdFkoQ uLnBncYqkqE44FN/kYbRvPlXetrdmWp+UA6+ckTDtJSSIIkDM+zUvOK5gNQM4Jqw8ypLZAMYP C3LLWg7G755Tr4+pp4tAlPcmY6DWRoMmr02Mk9a77Q1t0pAFYSnVEWGrHgGDXcK0jxsR62dHz fXBIqCx Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Note: there is more. With this applied, my desktop box will no longer reproduce when booted to init 3 with nowatchdog on the command line. My 8 socket DL980 OTOH still will, though it takes longer, and is seemingly no longer interested in following up with a permanent RCU stall after the tsc clocksource is killed, as it does in virgin source. --- timers_update_migration() is called by tick_nohz_activate() before the late initcall tmigr_init() sets tmigr_enabled to true, resulting in it updating neither timer_base.nohz_active nor .migration_enabled, meaning we'll not kick an idling cpu in add_timer_on(). Remove redundant loop avoidance such that tick_nohz_activate() updates timer_bases[].nohz_active as intended, and call it in tmigr_init() to update timer_bases[].migration_enabled. Signed-off-by: Mike Galbraith Fixes: ec2206b91d43 timer: Implement the hierarchical pull model --- kernel/time/timer.c | 4 ---- kernel/time/timer_migration.c | 1 + 2 files changed, 1 insertion(+), 4 deletions(-) --- a/kernel/time/timer.c +++ b/kernel/time/timer.c @@ -224,10 +224,6 @@ void timers_update_migration(bool update bool on = sysctl_timer_migration && tick_nohz_active && tmigr_enabled; unsigned int cpu; - /* Avoid the loop, if nothing to update */ - if (this_cpu_read(timer_bases[BASE_GLOBAL].migration_enabled) == on) - return; - for_each_possible_cpu(cpu) { per_cpu(timer_bases[BASE_LOCAL].migration_enabled, cpu) = on; per_cpu(timer_bases[BASE_GLOBAL].migration_enabled, cpu) = on; --- a/kernel/time/timer_migration.c +++ b/kernel/time/timer_migration.c @@ -649,6 +649,7 @@ static int __init tmigr_init(void) goto hp_err; tmigr_enabled = true; + timers_update_migration(false); pr_info("Timer migration: %d hierarchy levels\n", tmigr_hierarchy_levels); return 0;