From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932279AbbDOOUU (ORCPT ); Wed, 15 Apr 2015 10:20:20 -0400 Received: from bombadil.infradead.org ([198.137.202.9]:37919 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754435AbbDOOUP (ORCPT ); Wed, 15 Apr 2015 10:20:15 -0400 Date: Wed, 15 Apr 2015 16:20:02 +0200 From: Peter Zijlstra To: David Ahern Cc: tglx@linutronix.de, mingo@kernel.org, linux-kernel@vger.kernel.org, Stephane Eranian Subject: Re: [PATCH 3/3] perf: Fix mux_interval hrtimer wreckage Message-ID: <20150415142002.GR23123@twins.programming.kicks-ass.net> References: <20150415094155.601987867@infradead.org> <20150415095011.863052571@infradead.org> <552E6C12.8010702@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <552E6C12.8010702@gmail.com> User-Agent: Mutt/1.5.21 (2012-12-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Apr 15, 2015 at 07:48:02AM -0600, David Ahern wrote: > Hi Peter: > > On 4/15/15 3:41 AM, Peter Zijlstra wrote: > >Thomas stumbled over the hrtimer_forward_now() in > >perf_event_mux_interval_ms_store() and noticed its broken-ness. > > > >You cannot just change the expiry time of an active timer, it will > >destroy the red-black tree order and cause havoc. > > > >Change it to (re)start the timer instead, (re)starting a timer will > >dequeue and enqueue a timer and therefore preserve rb-tree order. > > Should this be fixed in stable trees as well? Hmm, I was going to write how this all relies on the hrtimer rework, but I think we might just be fine because all this is strictly cpu local and serialized through irq-disable. But yes, its can't be worse than it is now.