From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757185AbcH3Gri (ORCPT ); Tue, 30 Aug 2016 02:47:38 -0400 Received: from merlin.infradead.org ([205.233.59.134]:42038 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752015AbcH3Grg (ORCPT ); Tue, 30 Aug 2016 02:47:36 -0400 Date: Tue, 30 Aug 2016 08:47:24 +0200 From: Peter Zijlstra To: Jiri Olsa Cc: Vegard Nossum , Thomas Gleixner , Stephane Eranian , Vince Weaver , Ingo Molnar , David Carrillo-Cisneros , "H. Peter Anvin" , Kan Liang , Arnaldo Carvalho de Melo , Paul Turner , Linus Torvalds , LKML , Alexander Shishkin , linux-tip-commits@vger.kernel.org Subject: Re: [tip:perf/core] perf/core: Check return value of the perf_event_read() IPI Message-ID: <20160830064724.GX10153@twins.programming.kicks-ass.net> References: <1471467307-61171-2-git-send-email-davidcc@google.com> <20160822071737.GF4349@krava> <20160822082932.GA13171@krava> <20160822103823.GA2271@krava> <20160829100309.GS10121@twins.programming.kicks-ass.net> <20160829130213.GF10168@twins.programming.kicks-ass.net> <20160829185841.GA27077@krava> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160829185841.GA27077@krava> 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 Mon, Aug 29, 2016 at 08:58:41PM +0200, Jiri Olsa wrote: > couldn't we just call smp_call_function_single(cpu_to_read, __perf_event_read, ... > once we read oncpu != -1 ? > Yes, and at that point we can simply revert this WARN, because that is exactly the same. Which I think is what I'm going to do. If oncpu is not valid, the sched_out that made it invalid will have updated the event count and we're good. All I'll leave is an explicit comment that we've ignored the smp_call_function_single() return value on purpose.