Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp2302597yba; Mon, 15 Apr 2019 08:54:52 -0700 (PDT) X-Google-Smtp-Source: APXvYqxJgoTtmliI5Uj9a3hrbvtbmDqCrzZgfZQjjDgUnch6EjUf0UtE26WDxuEonUb7RokArm1f X-Received: by 2002:a62:a513:: with SMTP id v19mr75692976pfm.212.1555343692439; Mon, 15 Apr 2019 08:54:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555343692; cv=none; d=google.com; s=arc-20160816; b=s+w7dsmnbucIchmBgfr4wV+WeTjkXYsYBmfcSNcZHt9bHnkhqZrQt2NTHMw9ARYUnH 1oEmpXpXEa+aceP/nktQh/MBvwwGrpVWMm5eg1PxiAE8TbrJmTl/K7HZ1ATbdWt0PvpA eqkVxqSN7gWhFvTaFYwJqH+JmRZi6TvK5GmHbDT5sixFOLEyldUV3iGPf1qJC54e4Ar3 mEHVIDLeN7hX1WRnPJsDoCSugLNcSov2pwy3b0Hr30nfub1vEwrxnTA8WzTJ5o8IE0Uz GhWbW02YyuT5i4kMIQtezTFN9vNdk88yKvYjNN1mDENKkPyG/+umOOY2hkHmzTrYt4QD DGHA== 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=LO1RllZ/71tnHIfUtwFXLB6BFIjHkbH0y5hcmUBDVA8=; b=yG0V7gnqxMnSxWmpQZRwf5FX6s3Nz0CS1b/ny20vkAWBK/qOpuiu3f7UFkHQG+oG1G LjOlA0OZcYSFaPNmlQkFQMth+2iOohmYrcjCxaga6fTOKb3RXK+qjgf8GMmaABxN9t3H DPi7HAjIz4OsoZs0sJxQcUZRCrmE04S8/90OB3u7CwJxy2/7wHn3FBhUKWkKvHLQnM0Q 5qLrDQzZpkgpc4bA2jLV+Ba13OpcG2KlrvV82qGZG+0rCmNtLp4YnNTMM4vQGz7dZUxE 5gASxdahr108CcpkLcxXiSAlp62ZEc/x67dopbFNF1QjXXCU+ImfDdMlJ9KSydCuf6pb kdfg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b="dm/ieGao"; 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 l18si35758678pfi.117.2019.04.15.08.54.36; Mon, 15 Apr 2019 08:54:52 -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=fail header.i=@infradead.org header.s=merlin.20170209 header.b="dm/ieGao"; 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 S1727717AbfDOPxx (ORCPT + 99 others); Mon, 15 Apr 2019 11:53:53 -0400 Received: from merlin.infradead.org ([205.233.59.134]:34518 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727628AbfDOPxv (ORCPT ); Mon, 15 Apr 2019 11:53:51 -0400 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=LO1RllZ/71tnHIfUtwFXLB6BFIjHkbH0y5hcmUBDVA8=; b=dm/ieGaoYMyCpo9uwiKcCSrKz Kl7yOtT5AwGoz0eus3tki78ToFCaIFC5a914DlkrKYRao+XxO5iOrLi0CQIXhNSPsVPTXLACwUut4 JI9V3jJ9eWKjy7dEqO/IS+w/UkKfFFDlIzySRTa6ec2gTxbMIg/YTCGj3fgFt/uEMxTmMFDY6a25J 4QAs6ydsGRssBHHFChnZgwl+M6WZuAx7Bp24JhD3bjPpJuoTFbE/U/Mgbwy6Vfl0y0n5KpbAB/f1s axqSiz3anP9JaoBocQs77I7R+MN97vazixpW3GBgQQ2v8fgIRifK7EVTEhM2tcu764n2QsplDw/AC vbg2l2ugg==; 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.90_1 #2 (Red Hat Linux)) id 1hG3uv-0002d5-Tz; Mon, 15 Apr 2019 15:53:10 +0000 Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 88F812038C257; Mon, 15 Apr 2019 17:53:08 +0200 (CEST) Date: Mon, 15 Apr 2019 17:53:08 +0200 From: Peter Zijlstra To: Stephane Eranian Cc: linux-kernel@vger.kernel.org, tglx@linutronix.de, ak@linux.intel.com, kan.liang@intel.com, mingo@elte.hu, nelson.dsouza@intel.com, jolsa@redhat.com, tonyj@suse.com Subject: Re: [PATCH v2 1/2] perf/core: add perf_ctx_resched() as global function Message-ID: <20190415155308.GP14281@hirez.programming.kicks-ass.net> References: <20190408173252.37932-1-eranian@google.com> <20190408173252.37932-2-eranian@google.com> <20190415154537.GH12232@hirez.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190415154537.GH12232@hirez.programming.kicks-ass.net> 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 On Mon, Apr 15, 2019 at 05:45:37PM +0200, Peter Zijlstra wrote: > On Mon, Apr 08, 2019 at 10:32:51AM -0700, Stephane Eranian wrote: > > This patch add perf_ctx_resched() a global function that can be called > > to force rescheduling of events based on event types. The function locks > > both cpuctx and task_ctx internally. This will be used by a subsequent patch. > > I took out the task_ctx and event_type arguments. > +void perf_ctx_resched(struct perf_cpu_context *cpuctx) > +{ > + struct perf_event_context *task_ctx = cpuctx->task_ctx; > + > + perf_ctx_lock(cpuctx, task_ctx); > + ctx_resched(cpuctx, task_ctx, EVENT_ALL|EVENT_CPU); > + perf_ctx_unlock(cpuctx, task_ctx); > +} Hmm... I might just rework the thing to: perf_pmu_resched(struct pmu *pmu); As that is what we want; esp. in the light of that whole core context rewrite that i'm still sitting on :/