From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1424512AbdD1HhY (ORCPT ); Fri, 28 Apr 2017 03:37:24 -0400 Received: from mout.gmx.net ([212.227.17.20]:56102 "EHLO mout.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1424431AbdD1Hga (ORCPT ); Fri, 28 Apr 2017 03:36:30 -0400 Message-ID: <1493364946.4293.26.camel@gmx.de> Subject: [patch] Re: x86-tip tsc/tick gripage From: Mike Galbraith To: Peter Zijlstra Cc: Ingo Molnar , "Paul E. McKenney" , LKML , Ingo Molnar , Thomas Gleixner , Frederic Weisbecker Date: Fri, 28 Apr 2017 09:35:46 +0200 In-Reply-To: <1493206789.21594.25.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> 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:qY5YgRTZIZYHXvr++CcZ5Xwpjx5PTuMOmxboBKUwh9kLOzFUNvi iKQBF/xAuVp2DHPDv+90HmJRGe0TPGNBRppDqJRcLCSvXUK/1PyU9LyNl4odH0yVVobDkWY ekitNmjrxtAN43z5Hbbyh5HmCoU+Ni7CtUVPBRMqksq/1O7fX+GqxIslaZEwVDe8L2loo7F lKaig5P4XyvTrR8tC7dWA== X-UI-Out-Filterresults: notjunk:1;V01:K0:C5w8gAVfKAg=:T+Oae9UmsMHO12JEB3TedU XsfUuqSAwqjtNyhQXllJad6/rBNg/+szEH8De4ud7Pfvq/9XUl/LrPwTqFotLb9rMUisvb6pv JF9hsibJcBtf9iScoXbDjhGnkdbFUDgNEJtbg2iYMvTwmIntOtSqPk8u9peKYf0AHL7ir6IN2 8owpxzgGOAvw9IAYa6zi2s6G6dAzPc0vY4VODyIKk/rgLIkfWNFD4eo54RDUzhSkPtsbbE5Na 9wQbOvwh8KDqNcfTChrVav2UaM+Hrwt/TJCPqBNzdD2+LLNEbbWQi00xk0ka+1GhwJLGgcz5P YZkzuCAVROhL7CCQO9ebQFCNERF+UKCeARpjWdbin34rFldMFOERIG5R4mcWMmnBzse3nxyXr MJ/VxjO2a0+HYZLa09DLK/pOJp2niUijr0I7STIvGRq0h/IxoyFWgG9FKy2303Oft8EIC5sM3 cdqnyRBrvt1iQP76qFXhhAT19Rq1XDn9pXEb3BQbrh9vNq+YRITi+FNjybTVHScUBHfIflmjb LqsQOPLjeEKGrAlxbKHTEw1n0GgeaHgLsWfhCZE8zhzX4D8nJPYNVKo+M4WAL3vXwcD9x8HL4 zj0Mi8PBbIP9KSxK9Gqe2snSIPwILLOU2cBBc4w2aza059TDjcwBahKpPROtGWj3KZmSUvfA4 ccnMkcGvTlC4cfcZUXipRKp7rpREWhV/YdahdEJh+mFk+UXreW+M3wIsudCHBiuzwkC2PAhfD L2/P//XhcZLokFEpcJUpNJCqbPhDttiwytlEbFidAfYHBYu22A3BxSOlLnQ6eDB27mRZzOa0O dDSasv2 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 2017-04-26 at 13:39 +0200, Mike Galbraith wrote: > On Wed, 2017-04-26 at 12:26 +0200, Peter Zijlstra wrote: > > On Wed, Apr 26, 2017 at 10:57:42AM +0200, Mike Galbraith wrote: > > > > > Both still lose their TSC. > > > > > > [ 11.982468] tsc: Refined TSC clocksource calibration: 2260.999 MHz > > > [ 11.994275] clocksource: tsc: mask: 0xffffffffffffffff max_cycles: 0x20974a4d8bb, max_idle_ns: 440795246623 ns > > > [ 13.064172] clocksource: Switched to clocksource tsc > > > [ 240.247851] clocksource: timekeeping watchdog on CPU23: Marking clocksource 'tsc' as unstable because the skew is too large: > > > [ 240.462501] clocksource: 'tsc' cs_now: 108fe5be09f cs_last: b90a6a0676 mask: ffffffffffffffff > > > [ 240.675057] tsc: Marking TSC unstable due to clocksource watchdog > > > > > > And they didn't use to? We don't typically write to TSC or TSC_ADJUST > > and thus would not cause such behaviour. > > Nope. The DL980 is my RT jitter test box, which I use all the time. I found evidence of lysdexia at play (hunk 2), below is an RFFS (frozen shark) which makes my DL980 a happy camper with tip. timer/nohz: Call tick_tmigr_idle() with proper parameter order Extremely late timer expiration soon leads to the clocksource watchdog killing the TSC clocksource on multisocket boxen. Call tmigr_cpu_idle( ) with proper parameter order, and pass next_local to tmigr_cpu_idle() so it can return what it says it returns. Signed-off-by: Mike Galbraith Fixes: ec2206b91d43 timer: Implement the hierarchical pull model --- kernel/time/tick-sched.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- a/kernel/time/tick-sched.c +++ b/kernel/time/tick-sched.c @@ -695,7 +695,7 @@ tick_tmigr_idle(struct tick_sched *ts, u if (next_global >= next_local) next_global = KTIME_MAX; - next_global = tmigr_cpu_idle(next_global); + next_local = tmigr_cpu_idle(next_local); return min_t(u64, next_local, next_global); } @@ -768,7 +768,7 @@ static ktime_t tick_nohz_stop_sched_tick */ delta = next_local - basemono; if (delta > (u64)TICK_NSEC) - next_local = tick_tmigr_idle(ts, next_local, next_global); + next_local = tick_tmigr_idle(ts, next_global, next_local); ts->next_timer = next_local;