From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932639AbdA0MmA (ORCPT ); Fri, 27 Jan 2017 07:42:00 -0500 Received: from mga02.intel.com ([134.134.136.20]:19354 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932415AbdA0MkV (ORCPT ); Fri, 27 Jan 2017 07:40:21 -0500 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.33,295,1477983600"; d="scan'208";a="1099675215" From: Alexander Shishkin To: Mathieu Poirier Cc: Peter Zijlstra , Ingo Molnar , linux-kernel@vger.kernel.org, vince@deater.net, eranian@google.com, Arnaldo Carvalho de Melo , Will Deacon , Mark Rutland Subject: Re: [PATCH 3/3] perf: Allow kernel filters on cpu events In-Reply-To: <20170126213855.GC1991@linaro.org> References: <20170126094057.13805-1-alexander.shishkin@linux.intel.com> <20170126094057.13805-4-alexander.shishkin@linux.intel.com> <20170126213855.GC1991@linaro.org> User-Agent: Notmuch/0.23.3 (http://notmuchmail.org) Emacs/24.5.1 (x86_64-pc-linux-gnu) Date: Fri, 27 Jan 2017 14:31:22 +0200 Message-ID: <87efzobs6d.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 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. Regards, -- Alex