Received: by 2002:ac0:aa62:0:0:0:0:0 with SMTP id w31-v6csp936565ima; Wed, 24 Oct 2018 11:30:09 -0700 (PDT) X-Google-Smtp-Source: AJdET5dkv+TPcSfb8GGdq+jbfdYnUc4cQbv4333VZVTf/Jb9sbJheNrWbuHF78Urjyp/kJaAdHjg X-Received: by 2002:a63:2ad4:: with SMTP id q203-v6mr3448414pgq.356.1540405809306; Wed, 24 Oct 2018 11:30:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1540405809; cv=none; d=google.com; s=arc-20160816; b=aIiZVNpebNBrRWAdh1CoYWIgtRhjPO9U9uTVagOdGJPm7+n5c6iMRG62KXPoOVtSeo oTDXIagaNcLUWH7L79/7SS6Jgs3FMwnpbAUG42pqKkCd9mckuB+DHzub2qmgPj+2tXpK oRCekpo+C1W+5qIgE/+pXMuydpTEAdYRsEr9hJfFOjEs7Kz/le2XWVmTu8BbLGW7bL0F UPsYwbVNrGK8GXU2VPn75/+GdqkBzrukPJ4b+Vnm5ok4uXUu9thBrvQJY37hp21zfzYr M0wsrOC3rGpj9w4ZZAroSGIgkhKTMdb1QU+fFPEet5P3RKKTNXcJ6KJQOXA69EWzenIS qH+w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=vSiRiNk4aPDLILfn9wc3TG1SO6B94LaN1YqJhu+Xmo4=; b=ZQX+fl4EQvNuEJxiPyOBLBZSxJRDt+PW5vnVIT402QEB9hfJxkm/BO28VamJnsb7Mw qxCkNkmivOlkYXqZXvd2f0TS/jW0lZXuWM7vGc/2ntQ6G2pJtvPRiiFREyuN41EML2YT qNa+hrempeLJh4rkwaxHyqGBTwCVnl07op2oMfbsq5Ed3vnzs9ycO430ji6iwd/pV4ZA dPKQbagW24LoeEVWrmG0nSANhA2SVBjN4BhK6aybK9LG1tJ10gUdwpk6h2fUEXN2DFko QjGFv0z1MqQvWwp6M6pTvAcigoHhoWg4K/B/EuECKHpigbu8i8ADxKxO2ZqB73+CRNyE 3AAA== 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 h13-v6si4991726pgp.138.2018.10.24.11.29.53; Wed, 24 Oct 2018 11:30:09 -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 S1727399AbeJYC6C (ORCPT + 99 others); Wed, 24 Oct 2018 22:58:02 -0400 Received: from mga17.intel.com ([192.55.52.151]:13827 "EHLO mga17.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726747AbeJYC6C (ORCPT ); Wed, 24 Oct 2018 22:58:02 -0400 X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 24 Oct 2018 11:28:54 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.54,421,1534834800"; d="scan'208";a="100372709" Received: from tassilo.jf.intel.com (HELO tassilo.localdomain) ([10.7.201.126]) by fmsmga004.fm.intel.com with ESMTP; 24 Oct 2018 11:28:54 -0700 Received: by tassilo.localdomain (Postfix, from userid 1000) id 7CFC730137B; Wed, 24 Oct 2018 11:28:54 -0700 (PDT) Date: Wed, 24 Oct 2018 11:28:54 -0700 From: Andi Kleen To: "Liang, Kan" Cc: Arnaldo Carvalho de Melo , Peter Zijlstra , Thomas Gleixner , Ingo Molnar , linux-kernel@vger.kernel.org, bp@alien8.de, Stephane Eranian Subject: Re: [PATCH 1/2] perf: Add munmap callback Message-ID: <20181024182854.GH6218@tassilo.jf.intel.com> References: <20181024151116.30935-1-kan.liang@linux.intel.com> <20181024162334.GG6218@tassilo.jf.intel.com> <20181024163208.GC15106@kernel.org> <18d5fcf4-84b2-806c-eb2c-787b96e0fb90@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <18d5fcf4-84b2-806c-eb2c-787b96e0fb90@linux.intel.com> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > > 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. No, that's the wrong check here. The PEBS flush is independent of mmap events being requested. If anything would need to check for any PEBS events active, which would need a new counter. I think the easiest is to just check if this_cpu_ptr(&sched_cb_list) is empty, which should be good enough. -Andi