From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932073Ab2BGImG (ORCPT ); Tue, 7 Feb 2012 03:42:06 -0500 Received: from mx3.mail.elte.hu ([157.181.1.138]:53125 "EHLO mx3.mail.elte.hu" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756572Ab2BGImE (ORCPT ); Tue, 7 Feb 2012 03:42:04 -0500 Date: Tue, 7 Feb 2012 09:41:56 +0100 From: Ingo Molnar To: Eric Dumazet Cc: Stephane Eranian , linux-kernel@vger.kernel.org, peterz@infradead.org, markus@trippelsdorf.de, paulus@samba.org Subject: Re: [PATCH] perf: fix assertion failure in x86_pmu_start() Message-ID: <20120207084156.GA15359@elte.hu> References: <20120206205354.GA31186@quad> <1328603689.2476.15.camel@edumazet-laptop> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1328603689.2476.15.camel@edumazet-laptop> User-Agent: Mutt/1.5.21 (2010-09-15) X-ELTE-SpamScore: -2.0 X-ELTE-SpamLevel: X-ELTE-SpamCheck: no X-ELTE-SpamVersion: ELTE 2.0 X-ELTE-SpamCheck-Details: score=-2.0 required=5.9 tests=BAYES_00 autolearn=no SpamAssassin version=3.3.1 -2.0 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org * Eric Dumazet wrote: > Le lundi 06 février 2012 à 21:53 +0100, Stephane Eranian a écrit : > > The following patch fixes an issue introduced by the following > > commit: > > e050e3f0a71b ("perf: Fix broken interrupt rate throttling") > > > > The patch caused the following warning to pop up depending on > > the sampling frequency adjustments: > > > > [89214.962603] ------------[ cut here ]------------ > > [89214.967441] WARNING: at arch/x86/kernel/cpu/perf_event.c:995 x86_pmu_start+0x79/0xd4() > > [89214.975825] Hardware name: X8DTN > > [89214.979268] Modules linked in: > > [89214.982560] Pid: 0, comm: swapper/6 Not tainted 3.3.0-rc2-tip+ #1 > > [89214.988865] Call Trace: > > [89214.991533] [] warn_slowpath_common+0x7e/0x97 > > [89214.998379] [] warn_slowpath_null+0x15/0x17 > > [89215.004428] [] x86_pmu_start+0x79/0xd4 > > [89215.010042] [] perf_adjust_freq_unthr_context.part.63+0xef/0x123 > > [89215.018123] [] perf_event_task_tick+0x87/0x1c1 > > [89215.024463] [] ? tick_nohz_handler+0xda/0xda > > [89215.030595] [] scheduler_tick+0xd1/0xf3 > > [89215.036296] [] update_process_times+0x5e/0x6f > > [89215.042512] [] tick_sched_timer+0x70/0x99 > > [89215.048387] [] __run_hrtimer+0x8c/0x148 > > [89215.054087] [] hrtimer_interrupt+0xc1/0x18c > > > > It was caused by the following call sequence: > > > > perf_adjust_freq_unthr_context.part() { > > stop() > > if (delta > 0) { > > perf_adjust_period() { > > if (period > 8*...) { > > stop() > > ... > > start() > > } > > } > > } > > start() > > } > > > > Which caused a double start and a double stop, thus triggering the assert > > in x86_pmu_start(). > > > > The patch fixes the problem by avoiding the double calls. We pass a new > > argument to perf_adjust_period() to indicate whether or not the event > > is already stopped. We can't just remove the start/stop from that function > > because it's called from __perf_event_overflow where the event needs to > > be reloaded via a stop/start back-toback call. > > > > The patch reintroduces the assertion in x86_pmu_start() which was removed > > by commit: > > 84f2b9b perf: Remove deprecated WARN_ON_ONCE() > > > > Signed-off-by: Stephane Eranian > > --- > > This indeed fix the WARNING for me > > Acked-by: Eric Dumazet > > But I still have these messages when doing a perf session. > > Machine seems to recover properly. > > Previous kernels were working without notice. > > [ 300.553017] Uhhuh. NMI received for unknown reason 31 on CPU 2. > [ 300.553071] Do you have a strange power saving mode enabled? Were these messages introduced by: e050e3f0a71b: perf: Fix broken interrupt rate throttling as well? In any case I'm holding off on applying the patch before this is resolved. Thanks, Ingo