Received: by 2002:ac0:aa62:0:0:0:0:0 with SMTP id w31-v6csp812398ima; Wed, 24 Oct 2018 09:32:50 -0700 (PDT) X-Google-Smtp-Source: AJdET5cxO7CTwtcbsyQE3rKTMGjKn43gNQOEPcmoFCm27Rxwe/94/SVNzogDeY7vJ+qne87FmYWS X-Received: by 2002:a63:9c12:: with SMTP id f18-v6mr3274738pge.40.1540398770437; Wed, 24 Oct 2018 09:32:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1540398770; cv=none; d=google.com; s=arc-20160816; b=Bx3TuF1mlxW30DFTDjDoFB4wMAIqzNFd/FvLW1tH623UehNIHDuIuDHfZNjpGIqLjb XktuNz+DAg4cXnhlN9vydtE7EJlzfOC0hzF/Yo6auYlS4Tu1cnzJekX14gYKJbNwbD8v CRMrsyDYDSgMnDeGL60J/oZTQT4AYKVomgnmL3IJ9ZZymYq1k2adKskPRJ/aH91NGFDM MDuO+A6GyDr3NUF1S288ZTg07YQSMDM0FdvvIWSW40OfNyAwO4vw2DTW8O8aV2HL09s7 iY9h4si3ySfUh85l8T8Q6NeL7YKVD9UQ7Yz9TMi9z9I8XlZx7GLAh/OJiExdyqGuP0BZ 86nQ== 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:dkim-signature; bh=rvEt8aDCq3dnCRktVnIF+Lps4w+yusaK2UyDIRQ+ZbI=; b=NNPFUwpQ6QfiBEHDa0ZA4elnMo23TUjupmk8gzucjOu/DoHLkVg9+pvf6nEDNqVWCv 4QDKvSpv0DDp4jlKG+5UJWx68jUWxiOfys8p4W9Bfz7ABwrxJEIHwX9sWZeE7xeilp+z rqbo5TH2WCvk010n4b5UmWX5ykKQ5fO5PbJePrfgrepXRWzM2+oLrQMt4/G9Xf294gAR rM49u+6GHFrw5rB0//tE+iUnJ+R1jIXHMBbkIOpzcyG2naeCZWLeXJfgxag7faIinEBX DrPqrjHib0navT//nQUNQmR9EKIqH6sYmJGvSLT9HIRPWQKZt5HcCUkfVcZqe1k60NVZ tt3w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=WwMGVNsz; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n18-v6si4960102plp.294.2018.10.24.09.32.34; Wed, 24 Oct 2018 09:32:50 -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; dkim=pass header.i=@kernel.org header.s=default header.b=WwMGVNsz; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726633AbeJYBA5 (ORCPT + 99 others); Wed, 24 Oct 2018 21:00:57 -0400 Received: from mail.kernel.org ([198.145.29.99]:57618 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726433AbeJYBA5 (ORCPT ); Wed, 24 Oct 2018 21:00:57 -0400 Received: from jouet.infradead.org (unknown [190.15.121.82]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 61A1A2075D; Wed, 24 Oct 2018 16:32:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1540398732; bh=d+v2sUGIhz7Jz1PCr3QQ7WmJLL5CHnTj1xoKicde3fU=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=WwMGVNszACam9VrnuWaIJAHWLi1SGg+YovXzBS7u7Gjtcg0O8cMJo+kkMF9t/CMrP o6LMHotc+GRJcICs/Jh11h4GNrQRIbPJFUvCQyEIalcC1iufiR437qGedfKhuSGW7U rNnJPjHboH8MgkltWEkxULhOfvN3b3hVd/E6jqXY= Received: by jouet.infradead.org (Postfix, from userid 1000) id 830E7142C5E; Wed, 24 Oct 2018 13:32:08 -0300 (-03) Date: Wed, 24 Oct 2018 13:32:08 -0300 From: Arnaldo Carvalho de Melo To: Andi Kleen Cc: kan.liang@linux.intel.com, 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: <20181024163208.GC15106@kernel.org> References: <20181024151116.30935-1-kan.liang@linux.intel.com> <20181024162334.GG6218@tassilo.jf.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20181024162334.GG6218@tassilo.jf.intel.com> X-Url: http://acmel.wordpress.com User-Agent: Mutt/1.9.2 (2017-12-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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; } - Arnaldo