From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751435AbdA0VoC (ORCPT ); Fri, 27 Jan 2017 16:44:02 -0500 Received: from mail-yw0-f180.google.com ([209.85.161.180]:34302 "EHLO mail-yw0-f180.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751032AbdA0Vny (ORCPT ); Fri, 27 Jan 2017 16:43:54 -0500 MIME-Version: 1.0 In-Reply-To: <87efzobs6d.fsf@ashishki-desk.ger.corp.intel.com> References: <20170126094057.13805-1-alexander.shishkin@linux.intel.com> <20170126094057.13805-4-alexander.shishkin@linux.intel.com> <20170126213855.GC1991@linaro.org> <87efzobs6d.fsf@ashishki-desk.ger.corp.intel.com> From: Mathieu Poirier Date: Fri, 27 Jan 2017 10:38:01 -0700 Message-ID: Subject: Re: [PATCH 3/3] perf: Allow kernel filters on cpu events To: Alexander Shishkin Cc: Peter Zijlstra , Ingo Molnar , "linux-kernel@vger.kernel.org" , Vince Weaver , Stephane Eranian , Arnaldo Carvalho de Melo , Will Deacon , Mark Rutland Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 27 January 2017 at 05:31, Alexander Shishkin wrote: > Mathieu Poirier writes: > >> On Thu, Jan 26, 2017 at 11:40:57AM +0200, Alexander Shishkin wrote: >>> + if (!ifh->nr_file_filters) >>> + return; >> >> Is this mandatory or an optimisation to avoid circling through a list of filters >> that don't included user space files? > > It's both. It stems from the fact that the remainder of this function > relies on ctx::task not being NULL, which is not the case with cpu > contexts and now that we've enabled address filters for such contexts, > it's a problem. So checking for !task would have done the trick here, > but this way we'll also avoid going down this path for task contexts > in the absence of file-based filters. In particular, grabbing the mmap > semaphore and filters spinlock we can do without. Yes, I see it now. Do you have bigger plans for ->nr_file_filters? If the purpose is only to indicate the presence of user space files then it should be a 'bool' type (and probably changed to ->file_filters). Thanks, Mathieu > > Regards, > -- > Alex