Received: by 10.223.185.116 with SMTP id b49csp3962474wrg; Tue, 13 Feb 2018 10:25:52 -0800 (PST) X-Google-Smtp-Source: AH8x2276cRSgJ/3ai5FSUapWc5BG7htlD/uD18f4bT8L5UREXmELCXiFbaoDBKgcCflJOUsAVk/B X-Received: by 2002:a17:902:b582:: with SMTP id a2-v6mr1974673pls.349.1518546352362; Tue, 13 Feb 2018 10:25:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518546352; cv=none; d=google.com; s=arc-20160816; b=iREaqCGvyQ7NnoQW+F5FerC/mVdORCOpvcvAQTb1HX2aRcIZAZwS0/UVt9gzM3DPQN 7Sh/MGY8IkyfS3OvT8JMi95omTpwo9JVMvrmqdsJJHiHAujIHC7nyaNhRJ98Sxiyj1Mx 61iZuJK/UuwMAOAMWt5blYd/U70Xnh6V4fdIfJ8CxkkuP9AWkmkFGyjDu9T37VqfS3o9 5doNzfnz8MDX9J0oFBk9zzw5KUs+nFn95PqXRFS5nQXPwFGxYvo7aq8IFRaYkRU2LzXG gj3ceeKJrpwGwLY2TYhY9tjO9ucZRekB2/2b3HiffI/J3UVknXRRcVj8OlK83qks0DGb DyJw== 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:arc-authentication-results; bh=wwd6XPh0kpM1Ib6gxytDxLuq9itiGwcbJmUPVJyoa/s=; b=PnyqDflPUFr0mUYigpKpMFllG8wo2w5cc+Pd8vt7Sgcpakl2SL0K4Mwtt57xZyWjkP F5KBjZbdO+rECaFDQ3sqM0XnYMMkbMsDyIqAhUpQYR8Qbo0TcMzGGj3HYXiF5/YeoAup r6bMn3SRk8o3WZB4gh/a2/OjwjpfO2c2ChucywRi4JpZxOb0jgmPKxmEpOAS/dL5Y++V hRrsuT78LAMmZYt4c/SjIKv58KkbW6RJj1WgUTQzbLX0MwhX8agoAwmzr5Gkt2rJ8vW3 OZ/qlwvHmocIsypSoXMVkq66kovclwmi5uQLzfv26aDhH1UH8mfjPco9WMmiuc+y+Qbu VejA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=w/nEheYK; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k3si4930569pgt.109.2018.02.13.10.25.37; Tue, 13 Feb 2018 10:25:52 -0800 (PST) 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=fail header.i=@infradead.org header.s=merlin.20170209 header.b=w/nEheYK; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965511AbeBMSYB (ORCPT + 99 others); Tue, 13 Feb 2018 13:24:01 -0500 Received: from merlin.infradead.org ([205.233.59.134]:35266 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965217AbeBMSYA (ORCPT ); Tue, 13 Feb 2018 13:24:00 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=wwd6XPh0kpM1Ib6gxytDxLuq9itiGwcbJmUPVJyoa/s=; b=w/nEheYKpvSwGxuEEj3L/ceQ9 YIGnGhLD1pglVa40Cvf0N2REXUmgdW9bazj41q0xAGDB80NgjF8zzQFPcagj7bO2a1WR28iOtW90y 0hFQl7muJqiMH8f2QuDaE5kuc25kM1ds2UwymhyTZLW4dmSwe6FrY1Yhj8IGxrtDq6ljF1zBGPaMI +43+7FCQVTf2Hu2xJC2QcZgfpry6kRIAaqsmEiIoXLJWFqcgnPSbt3ig/nBZujx7vGpPWsv+NHb4O 1O8uCMtopj3sG5Ie09AJgyObJpWRIBId5k+V4e2iTnr3Q9uEs0qACnXErqtmna4EGdru9xioto3VG WAUEvCZag==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=hirez.programming.kicks-ass.net) by merlin.infradead.org with esmtpsa (Exim 4.89 #1 (Red Hat Linux)) id 1elfFB-0006CJ-Gu; Tue, 13 Feb 2018 18:23:53 +0000 Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 18863201FB4E9; Tue, 13 Feb 2018 19:23:51 +0100 (CET) Date: Tue, 13 Feb 2018 19:23:51 +0100 From: Peter Zijlstra To: Raghavendra Rao Ananta Cc: mingo@redhat.com, acme@kernel.org, alexander.shishkin@linux.intel.com, jolsa@redhat.com, namhyung@kernel.org, linux-kernel@vger.kernel.org, psodagud@codeaurora.org, tsoni@codeaurora.org Subject: Re: [PATCH] perf: Add support for creating offline events Message-ID: <20180213182351.GQ25201@hirez.programming.kicks-ass.net> References: <1518217620-28458-1-git-send-email-rananta@codeaurora.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1518217620-28458-1-git-send-email-rananta@codeaurora.org> 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 On Fri, Feb 09, 2018 at 03:07:00PM -0800, Raghavendra Rao Ananta wrote: > Perf framework doesn't allow creation of hardware events if > the requested CPU is offline. However, creation of an event > is achievable if the event is attached to the PMU as soon > as the CPU is online again. > > So, introducing a feature that could allow to create events > even when the CPU is offline and return a success to the caller. > If, during the time of event creation, the CPU is found offline, > the event is moved to a new state (PERF_EVENT_STATE_DORMANT). As > and when the CPU is know to be woken up (through hotplug notifiers), > all the dormant events would be attached to the PMU (by > perf_install_in_context()). If during the life time of the event, > the CPU hasn't come online, the dormant event would just be freed. This is horrible.. and you seem to have forgotten to explain why you care about offline CPUs.