From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933213AbcLMNoU (ORCPT ); Tue, 13 Dec 2016 08:44:20 -0500 Received: from bombadil.infradead.org ([198.137.202.9]:60883 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932532AbcLMNoS (ORCPT ); Tue, 13 Dec 2016 08:44:18 -0500 Date: Tue, 13 Dec 2016 14:43:58 +0100 From: Peter Zijlstra To: Thomas Gleixner Cc: LKML , x86@kernel.org, Borislav Petkov , Bruce Schlobohm , Roland Scheidegger , Kevin Stanton , Allen Hung Subject: Re: [patch 2/2] x86/tsc: Force TSC_ADJUST register to value >= zero Message-ID: <20161213134358.GV3207@twins.programming.kicks-ass.net> References: <20161213131115.764824574@linutronix.de> <20161213131211.397588033@linutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20161213131211.397588033@linutronix.de> User-Agent: Mutt/1.5.23.1 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Dec 13, 2016 at 01:14:17PM -0000, Thomas Gleixner wrote: > @@ -429,8 +447,13 @@ void check_tsc_sync_target(void) > * that the warp is not longer detectable when the observed warp > * value is used. In the worst case the adjustment needs to go > * through a 3rd run for fine tuning. > + * > + * But we must make sure that the value doesn't become negative > + * otherwise TSC deadline timer will create an interrupt storm. > */ > cur->adjusted += cur_max_warp; > + if (cur->adjusted < 0) > + cur->adjusted = 0; > So depending on how horrid we want to make this we could work around this by increasing the ADJUST of the other CPUs by the amount we're negative. But yes, yuck.