Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp301591rwe; Wed, 24 Aug 2022 00:54:45 -0700 (PDT) X-Google-Smtp-Source: AA6agR79PNbrdO1FAN36XYQt2FYxmebVmBna2r51TKfOgP5XEp4iKnviPGtw0DtxcxJqCy8b2SAM X-Received: by 2002:a17:907:6e89:b0:73d:a846:c29e with SMTP id sh9-20020a1709076e8900b0073da846c29emr2051261ejc.577.1661327685093; Wed, 24 Aug 2022 00:54:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661327685; cv=none; d=google.com; s=arc-20160816; b=WQoC2zUTuaVsoIquaJ+DW/Xmc3l+2UyFUq7qV5SFJY0bB7e0p8+dxjAdWoSxnLF9Z4 wVOUPYtK8vUVpeSYUQ7vvMnu48e3IGy9H1hvhG3pHohdrD3taB8IawnXsIVSLjIfgctz yhhnNy6X1YLY0+1LKkhu1O9VoKKVx1xHmiYvrpKGdpUD0+BeemjEw9FdAgFgVA+zOAol OtVeFrmL4dRyJHgQQmf36Tle3NguYIh7nzkMCDJ9owah+XJqAjCpMhqpOsCHGwfu5ItD 8FQMxtPjR/8jbg4lUMJDRuE5JCksy1jE2dub1sV5AOxLctJwJb8s76VPACDHGWOGD/3/ +IKA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=dLscxFkI37Iy2zsCWkiigExtiRT/8vYmPbsCuER+yws=; b=mUuTOqIRKpTxzPz++QKERWkJmEcZGreMI1BkWDWlxjizZJA6+T0C30Dup0bDJ0R+k8 zC7nYvJlocb5xK5wRcepcAfEwphbeWsqNSyxCwd43rUWy1/TapBNVCD65VWEzNksH5Wh 4slnRFW22hjrpA3edw2nrULRNIoZ58SdueEa0WKcZnor2NL8eQauhEj0DNIr3b4t46pW fguRuJQpEt1ndm/6nGuLMXza8HuD64osiTDbSrNGL9ucF4ZG1FsP7Csj2J2Y55xB08NX +m9bep9DY8SODnXYi42ZAP0ZsV4YZ7OKz9ITpvVivwHR5Fk7k0a1MOtg7XDrKeN+ncHY wRgA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=lWJi5kIS; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hq33-20020a1709073f2100b0073d8837547bsi1793630ejc.729.2022.08.24.00.54.19; Wed, 24 Aug 2022 00:54:45 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=lWJi5kIS; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235475AbiHXH1u (ORCPT + 99 others); Wed, 24 Aug 2022 03:27:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42444 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235506AbiHXH1f (ORCPT ); Wed, 24 Aug 2022 03:27:35 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1CF4669F4D for ; Wed, 24 Aug 2022 00:27:31 -0700 (PDT) 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=dLscxFkI37Iy2zsCWkiigExtiRT/8vYmPbsCuER+yws=; b=lWJi5kISStz8pom5XpN7Y99kQf xjZ3BIuJNHYDwQhNzT7Nzg5/J9ee1QK6lvhOurYFr0AY2HErOL/4ZfFint4K2zxGhWpw8SttXbzN3 G3Rr9a1hwkk7yzEzheuczdn4vtdlfvXGkLzFk4ftrPqSF0Uhk3R8qn/oXoTFCVwmHztOHLJsVxOh7 iDQb0dORUKJ4orGHAatefZRrP6TSh7wUNZDZrYol1lERAZnMmAMHbq1j76NYQOAC+vViNiI8kYieg Wna7g1YDY6VA3w/tTbUodJwF6iPzfBwtvdcc+mW50GTawuAd2XysdcbR1cs3yVYQPmHOpFb5VSSJM pcmq8GIA==; Received: from j130084.upc-j.chello.nl ([24.132.130.84] helo=worktop.programming.kicks-ass.net) by casper.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1oQkn4-00G6xD-KH; Wed, 24 Aug 2022 07:27:06 +0000 Received: by worktop.programming.kicks-ass.net (Postfix, from userid 1000) id 1F822980403; Wed, 24 Aug 2022 09:27:05 +0200 (CEST) Date: Wed, 24 Aug 2022 09:27:05 +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, alexey.budankov@linux.intel.com, ak@linux.intel.com, mark.rutland@arm.com, megha.dey@intel.com, frederic@kernel.org, maddy@linux.ibm.com, irogers@google.com, kim.phillips@amd.com, linux-kernel@vger.kernel.org, santosh.shukla@amd.com Subject: Re: [RFC v2] perf: Rewrite core context handling Message-ID: References: <20220113134743.1292-1-ravi.bangoria@amd.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Aug 24, 2022 at 10:37:36AM +0530, Ravi Bangoria wrote: > > Now, I suppose making that: > > > > {-1, NULL, NULL}, {cpu, NULL, NULL} > > > > could work, but wouldn't iterating the the tree be more expensive than > > just finding the sub-trees as we do now? > > pmu=NULL can be used while scheduling entire context. We can just traverse > through all pmu events of both cpu subtrees. But imagine the case where we have 50 event for a PMU that can only schedule 8. Then we have to iterate 42 events for naught instead of directly jumping to the next PMU.