Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp514785imm; Wed, 17 Oct 2018 04:07:56 -0700 (PDT) X-Google-Smtp-Source: ACcGV62NO+F+iOsxekP0pVrxFNYWEsTnoj9bNHm2d5ZWdC6HkcSn9enO9UD8mfM5CTop6aseTIF9 X-Received: by 2002:a17:902:76c3:: with SMTP id j3-v6mr25698995plt.339.1539774476511; Wed, 17 Oct 2018 04:07:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539774476; cv=none; d=google.com; s=arc-20160816; b=umklDFOmT56Jt3urUXNqJXRYO1gkb4YEvwFcL4IKAydrUhaTOwZJOWdfShVEjfH4Qw N83FrTPyhGiAL+HftE33wl5z0SSZ2gkpJTbFlsrs1Tpg4haO3+JcfqAPZeYvn8wDEsKS 5G3+PCh2lZeZpBJzsF6OGqCf5FP7wVlNWVOxkbpyq54SsU7b1fLKF3U1VYh2s5Qns/bX EBxLozb/axiMeCHI02OqsoHTpxq1+Y2wKJkS5RoGHJR2Srn+HiFeQ//4DfQJfqOCuMs6 Za44/QughKDSQpUplCMHrjQNyVW1eWQRDC8Hbu83ws4XsoK/kwQwPtE4peNBXWF886r/ EYOQ== 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-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=2uXTb0Wb29vDfEw3LjOk74sK6S3NB93y4fR3Dz/EytU=; b=ljBgmDPSjrMDRC7LY6sBKKVg/s6t2og3ZMsikUrOS7YwG4h22QOuuscClnpreBF/oR Z5z5GYXj9G8xSpptWdVubt081ldcREsJDcURxF5cF25A6JGWAes0aOT8rh239GMU2ILF mF3U+X4IIkp2GZDLYxZJswNG4j/0ZVo5ic4YGpg3FiiIqmoQ9i7M1/R7F5tz3AEZMFwu QyLgiW/Xsqs0kAu5fS/31UZuqqCudJle/g69ACmY7z2918sVl1L1MgWDLaN4M1Offn91 f3yfOw9zvdC2xxOP/puCT3LUHvYaFPnTPQ1Y7MAdwmDg3WZV1OC5nr+TOoUva700ItSj nzVg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=merlin.20170209 header.b=1HUqiXr9; 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 p13-v6si17515972pgj.399.2018.10.17.04.07.38; Wed, 17 Oct 2018 04:07:56 -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=1HUqiXr9; 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 S1727064AbeJQTCU (ORCPT + 99 others); Wed, 17 Oct 2018 15:02:20 -0400 Received: from merlin.infradead.org ([205.233.59.134]:48854 "EHLO merlin.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727000AbeJQTCU (ORCPT ); Wed, 17 Oct 2018 15:02:20 -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-Transfer-Encoding: Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date: Sender:Reply-To: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=2uXTb0Wb29vDfEw3LjOk74sK6S3NB93y4fR3Dz/EytU=; b=1HUqiXr9XFtux2FAzqC/FgyCNZ ZQCfkVNE/B1wWWvzxwQDKySj26bLkgqHsuhi+LhRm/opWuYgJD12iq/3AJ8lIsOvYEzWIClOVKI06 Wzu1PdApf2xC/jg1CKyGSZ+sEhQIB0t4m4esS0MCEhtB0Q14PCoVHt0HBpdF/oMtMbrDxkEoI/Ffd NBdMu3T0tpbga3cj7drTwG2FPB1wFtE5LZrOxivJqYx6EONcMRJVV1T8n5p19aenVovhee30NuD7Z cnNs6RGViB3/eXbNFRS4mx+6g0RvP0lTkkOcgbScqbQfNjrbZRgtq+cqqXlQjRTxbkFDGKUq83GVS GSwDeSyA==; 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 1gCjfB-0000p6-Nm; Wed, 17 Oct 2018 11:06:54 +0000 Received: by hirez.programming.kicks-ass.net (Postfix, from userid 1000) id 1B73520298568; Wed, 17 Oct 2018 13:06:51 +0200 (CEST) Date: Wed, 17 Oct 2018 13:06:51 +0200 From: Peter Zijlstra To: Song Liu Cc: Alexey Budankov , Ingo Molnar , lkml , "acme@kernel.org" , Alexander Shishkin , Jiri Olsa , Stephane Eranian , Thomas Gleixner , "mark.rutland@arm.com" , "megha.dey@intel.com" , "frederic@kernel.org" Subject: Re: [RFC][PATCH] perf: Rewrite core context handling Message-ID: <20181017110651.GI3121@hirez.programming.kicks-ass.net> References: <20181010104559.GO5728@hirez.programming.kicks-ass.net> <3a738a08-2295-a4e9-dce7-a3e2b2ad794e@linux.intel.com> <20181015083448.GN9867@hirez.programming.kicks-ass.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable In-Reply-To: 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 Tue, Oct 16, 2018 at 06:28:10PM +0000, Song Liu wrote: > > How about this:=20 > >=20 > > 1. Keep multiple perf_cpu_context per CPU, just like before this patch.= =20 > >=20 > > 2. For perf_event_context, add PMU as an order for the RB tree.=20 > >=20 > > 3. (hw) pmu->perf_cpu_context->ctx only has events for this PMU (and sw= =20 > > events moved to this context). > >=20 > > 4. task->perf_event_ctxp has events for all PMUs.=20 > >=20 > > With this path, we keep the existing perf_cpu_context/perf_event_context > > logic as-is, which I think is simp=10ler than the new logic (with extra > > *_pmu_context). And it should also solve the problem.=20 > >=20 > > Does this make sense? If this doesn't look too broken, I am happy to > > draft RFC for it.=20 > >=20 >=20 > I am not sure whether you missed this one, or found it totally insane.=20 > Could you please share your comments on it? My gut feeling is that this= =20 > would be a simpler patch to solve the problem (two hw PMUs). (It might=20 > be less efficient though).=20 Ah, sorry, somehow this email got lost. That makes task and cpu contexts wildly different, which will complicate matters I feel.