Received: by 2002:ac0:aa62:0:0:0:0:0 with SMTP id w31-v6csp918990ima; Wed, 24 Oct 2018 11:13:43 -0700 (PDT) X-Google-Smtp-Source: AJdET5eqz0I/jrPGwouSraNF462Tusc6z3qB8s+qHmkTugvAeTPzCXJuOogxN6s6jh5iGVWAMVb+ X-Received: by 2002:a63:907:: with SMTP id 7-v6mr3481540pgj.121.1540404823230; Wed, 24 Oct 2018 11:13:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1540404823; cv=none; d=google.com; s=arc-20160816; b=AbDmU9HtcZR/xQHUgacsQElskTg09OJ/KwwcARxXAfQPlWkndsrZ6GutcAQ66mvUJy ftQSN3oWd8423ksSjXtDGFhNQsR1VpdwNcFlEnfdD179tlMGPA3zYiym74l6K8B+QL2Z SI0C1Au9d8xxnzXyIFqJNNpPtLAuyD86btNMZqLBiyNqhEw3p+Ah5zyaxPtOn7ArNzAg ujwvBHSyIyTXz2/dH3MQ/sVXhvXOOTw7OuFEdDi56Bb0NmV2KwcR9H/FjBLnPaLZu6Bz XPkWAm6AD4Mqj0k3ZguQsesBMW5AHuju9rmMzKTOBcQnofjnYF5LCkMx7SaD8Qw1RE4U jp1Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=whVox/3dP0x3ktkttidXeNwp2phtkIWGLaO422w9xO4=; b=Uk+KNMxFL6W6uz1T3JtyEYn9C44DmIoUl48tGIXjLtcuYrlEJst4asI51cPhJJ3xUf 9e5Hpd2JBYMBWVJRJPjeblwGAlDDi0Z1KE54up4AwGK4g4UJQluNk2QgfZg91HkWpZ7B ao40V+Lu5bj2NmvLTaRjR8pz6AOfSqB1WXWkJNXjbAiFCxMtteNrXYlBuLvUOhk5mPxR qsmc+GjUdJTofJBuyADdNnpoxbnFGPJA9RqPRbwNWwamaSma47DiT+TrJnQzmM5FL0QN qved7RXuCwOZxiPW9KyIAiMKOsidCMWT3jLsmzFbavNtuaDelO1cbjsK5vldDnXIlw81 lQTQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k11-v6si5495831pgr.10.2018.10.24.11.13.27; Wed, 24 Oct 2018 11:13:43 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727228AbeJYCmB (ORCPT + 99 others); Wed, 24 Oct 2018 22:42:01 -0400 Received: from mga14.intel.com ([192.55.52.115]:50666 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726433AbeJYCmB (ORCPT ); Wed, 24 Oct 2018 22:42:01 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 24 Oct 2018 11:12:57 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.54,421,1534834800"; d="scan'208";a="83849842" Received: from linux.intel.com ([10.54.29.200]) by orsmga007.jf.intel.com with ESMTP; 24 Oct 2018 11:12:57 -0700 Received: from [10.254.75.130] (kliang2-mobl1.ccr.corp.intel.com [10.254.75.130]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by linux.intel.com (Postfix) with ESMTPS id 862A45803FA; Wed, 24 Oct 2018 11:12:56 -0700 (PDT) Subject: Re: [PATCH 1/2] perf: Add munmap callback To: Arnaldo Carvalho de Melo , Andi Kleen Cc: Peter Zijlstra , Thomas Gleixner , Ingo Molnar , linux-kernel@vger.kernel.org, bp@alien8.de, Stephane Eranian References: <20181024151116.30935-1-kan.liang@linux.intel.com> <20181024162334.GG6218@tassilo.jf.intel.com> <20181024163208.GC15106@kernel.org> From: "Liang, Kan" Message-ID: <18d5fcf4-84b2-806c-eb2c-787b96e0fb90@linux.intel.com> Date: Wed, 24 Oct 2018 14:12:54 -0400 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <20181024163208.GC15106@kernel.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 10/24/2018 12:32 PM, Arnaldo Carvalho de Melo wrote: > Em Wed, Oct 24, 2018 at 09:23:34AM -0700, Andi Kleen escreveu: >>> +void perf_event_munmap(void) >>> +{ >>> + struct perf_cpu_context *cpuctx; >>> + unsigned long flags; >>> + struct pmu *pmu; >>> + >>> + local_irq_save(flags); >>> + list_for_each_entry(cpuctx, this_cpu_ptr(&sched_cb_list), sched_cb_entry) { >> >> Would be good have a fast path here that checks for the list being empty >> without disabling the interrupts. munmap can be somewhat hot. I think >> it's ok to make it slower with perf running, but we shouldn't impact >> it without perf. > > Right, look at how its counterpart, perf_event_mmap() works: > > void perf_event_mmap(struct vm_area_struct *vma) > { > struct perf_mmap_event mmap_event; > > if (!atomic_read(&nr_mmap_events)) > return; > > } > Thanks. I'll add the nr_mmap_events check in V2. Thanks, Kan