From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id B7656C433FE for ; Mon, 10 Oct 2022 10:15:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=Gzs+W8Tma4J2q3sqqhWmt5mkzazuRpBtCvgh+EwH90U=; b=haaMuZCKD7x9LH dOS05ULjoujgStQciy9wmj6s9MNofZISUI8d9OUK/RJGKZYjafvvOayXl3GvtMWF4Dnbk3b6k5Z2z q7zovs5uaHNRU88i4621eseqUIHvp0zJy+sY70Jy35+YB3+FOev0J5bJdmCyz6w83eYUXRAoQjI5m Uajjh+Hl1Kjky564R+qTnnblHfNnX7G6uZy1g+zaqj4Ekypm/PC68vHVGqxUJ/S90HJ5CTfmN7Pzg nzORTEHYeCkRudy36raUOkh+JuMuctMP582bOw86Ha53KpgTLjhU9T9sX9K5iizL15X04meFVsZN8 b7cJ27eOwavy5yzigJAw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1ohpnz-000KeW-Gs; Mon, 10 Oct 2022 10:14:39 +0000 Received: from casper.infradead.org ([2001:8b0:10b:1236::1]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1ohpnx-000Kds-8D for linux-arm-kernel@bombadil.infradead.org; Mon, 10 Oct 2022 10:14:37 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.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; bh=HPidJK9k0wDj5SKTPSWA/1fb2xWJmy1rprDVNz5gd7I=; b=gZPg5tHvpsY0bShNV9wsEEgKzL JRcE92EijJ+834KzNf4yHcapJ0hmZIzBsOs1iJJf2o8DPH+7tLJl7xpUpC4ILJ0EgFxvypPoxwPQS Ui0s3kNXhjHb5xf3YtykfLjUFUuIE3oI2vRyAWAGkmtMp/rUR9JlTu5XKrCj5lcXrvl1T/FTb9kF4 XpNxRKqVTksqhCKqSRBJ2I7jQLs42ALK7yx950VZ6Bno7tlRTEb6tCQLnZ8V2850A4JBeYzGwdxmz cB7sVWx5zACwknyQTBTKjYT01aJ58pvGMpg5bHg6113Xy0JDD9W6pchvv8I35x+bvrpMOAwIiJO9v 9GwnBM2w==; Received: from j130084.upc-j.chello.nl ([24.132.130.84] helo=noisy.programming.kicks-ass.net) by casper.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1ohpnq-0048Q4-3g; Mon, 10 Oct 2022 10:14:30 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id 8F80E300465; Mon, 10 Oct 2022 12:14:24 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 5EB4F2022F86C; Mon, 10 Oct 2022 12:14:24 +0200 (CEST) Date: Mon, 10 Oct 2022 12:14:24 +0200 From: Peter Zijlstra To: Ravi Bangoria Cc: acme@kernel.org, alexander.shishkin@linux.intel.com, jolsa@redhat.com, namhyung@kernel.org, songliubraving@fb.com, eranian@google.com, ak@linux.intel.com, mark.rutland@arm.com, frederic@kernel.org, maddy@linux.ibm.com, irogers@google.com, will@kernel.org, robh@kernel.org, mingo@redhat.com, catalin.marinas@arm.com, linux-arm-kernel@lists.infradead.org, linux-perf-users@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, linux-s390@vger.kernel.org, linux-kernel@vger.kernel.org, sandipan.das@amd.com, ananth.narayan@amd.com, kim.phillips@amd.com, santosh.shukla@amd.com Subject: Re: [PATCH] perf: Rewrite core context handling Message-ID: References: <20220829113347.295-1-ravi.bangoria@amd.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Wed, Sep 07, 2022 at 04:58:49PM +0530, Ravi Bangoria wrote: > > -static void > > -ctx_flexible_sched_in(struct perf_event_context *ctx, > > - struct perf_cpu_context *cpuctx) > > +/* XXX .busy thingy from Peter's patch */ > > +static void ctx_flexible_sched_in(struct perf_event_context *ctx, struct pmu *pmu) > > This one turned out to be very easy. Given that, we iterate over each > pmu, we can just return error if we fail to schedule any flexible event. > (It wouldn't be straight forward like this if we needed to implement > pmu=NULL optimization.) > > --- > diff --git a/kernel/events/core.c b/kernel/events/core.c > index e0232e0bb74e..923656af73fe 100644 > --- a/kernel/events/core.c > +++ b/kernel/events/core.c > @@ -3751,6 +3751,7 @@ static int merge_sched_in(struct perf_event *event, void *data) > cpc = this_cpu_ptr(event->pmu_ctx->pmu->cpu_pmu_context); > perf_mux_hrtimer_restart(cpc); > group_update_userpage(event); > + return -EBUSY; > } > } > I'm afraid this breaks things; consider: f79256532682 ("perf/core: fix userpage->time_enabled of inactive events") I totally hate this -- because it means we *HAVE* to iterate the inactive events, but alas. _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel