From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932345AbcEKJlc (ORCPT ); Wed, 11 May 2016 05:41:32 -0400 Received: from mga11.intel.com ([192.55.52.93]:64980 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932131AbcEKJla (ORCPT ); Wed, 11 May 2016 05:41:30 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.24,608,1455004800"; d="scan'208";a="101132238" From: Alexander Shishkin To: Peter Zijlstra Cc: Thomas Gleixner , x86@kernel.org, Borislav Petkov , Ingo Molnar , linux-kernel@vger.kernel.org, vince@deater.net, eranian@google.com, Arnaldo Carvalho de Melo Subject: Re: [PATCH 2/2] perf: Disable the event on a truncated AUX record In-Reply-To: <20160511091333.GA3190@twins.programming.kicks-ass.net> References: <1462886313-13660-1-git-send-email-alexander.shishkin@linux.intel.com> <1462886313-13660-3-git-send-email-alexander.shishkin@linux.intel.com> <20160511091333.GA3190@twins.programming.kicks-ass.net> User-Agent: Notmuch/0.21 (http://notmuchmail.org) Emacs/24.5.1 (x86_64-pc-linux-gnu) Date: Wed, 11 May 2016 12:41:27 +0300 Message-ID: <874ma5ue2g.fsf@ashishki-desk.ger.corp.intel.com> MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Peter Zijlstra writes: > On Tue, May 10, 2016 at 04:18:33PM +0300, Alexander Shishkin wrote: >> When the PMU driver reports a truncated AUX record, it effectively means >> that there is no more usable room in the event's AUX buffer (even though >> there may still be some room, so that perf_aux_output_begin() doesn't take >> action). At this point the consumer still has to be woken up and the event >> has to be disabled, otherwise the event will just keep spinning between >> perf_aux_output_begin() and perf_aux_output_end() until its context gets >> unscheduled. >> >> Again, for cpu-wide events this means never, so once in this condition, >> they will be forever losing data. >> >> Fix this by disabling the event and waking up the consumer in case of a >> truncated AUX record. > >> + if (wakeup) { >> + if (truncated) >> + handle->event->pending_disable = 1; >> + perf_output_wakeup(handle); >> + } > > Does the userspace tool know how to deal with this and re-enable it? Yes, it knows to ioctl(EVENT_ENABLE). Also, we're already doing the disabling for the no-room-in-buffer condition in perf_aux_output_begin(). Regards, -- Alex