Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp82812pxu; Wed, 2 Dec 2020 15:44:28 -0800 (PST) X-Google-Smtp-Source: ABdhPJz5e3MBk5xqluZpo/g6+xdtHveR0NlU/5/zHDsmFffihK1ziO2cNEWb1cOX6ROq6FRo1Rxh X-Received: by 2002:a17:906:4982:: with SMTP id p2mr191431eju.416.1606952668597; Wed, 02 Dec 2020 15:44:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606952668; cv=none; d=google.com; s=arc-20160816; b=V6meBulZ+GLVxP0tkWLp4ScL9/RPp2Vl/qsgIVPTrHQwztR4z8EOYncME+JEhTUffV kQfAwpRggSJ57Z0fbaplNnz88tduyUjpBiAG4VW9n4OHdcpAuxB1rhPmBtrbWIA2qcOt CeQMk9Sj0ZKrEu96/3EV9Qd26DhVFMuPuqth5VjQQC80pkKllt+Mp1ZUYQ1egtmFz0V5 LO2W1jbs446ZsmB38DS1eeh7384jlXFuc04/jrE/oV8ol3d+62tN+a7Ri1H9qWYxsHu6 CEEyc5lwx2akN3a5GAGUFESTRt5omvC/1r6APDAkkTzIhqJkJQhQ/HNzIPiC2BYwa/Gp Bx9A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=xQR0dYvXVVGwuf8cwqhcQDfB3WAV48KDjEpeGO4rQDg=; b=KSGKOn5wcPBonrdHZ67/SEWXKRO3ava2gTUDpO3tacnIkYFkiUsRIdmpCdXQRMw9MJ qORd7iCYUGUkOjt57mKLZjphuX2ryL7Np6TcCz9wtCm+NB0JxGsmaC8D3o1Lu/THy994 n7C2iV6AbZnxqfG1Po2te/VdGivXBc6zr8OGvCiIKG6/217zox2x4epmGPLeqlPUPZ2I +pYuYSzhOeuAMjXnVTY0UlsTa9x4sslbmuPeuFP9XHk1XPjrAcWy41R0g5gc+kzjEJXE BhF3nHsuxyIC0vfCZkDv3pZ/Um4WVE7CxIBklf9JjS0z1dGjSDS9S7FpN/MljWKndtP5 Eg/A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=fsgNr5p2; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a3si106930ejx.101.2020.12.02.15.44.04; Wed, 02 Dec 2020 15:44:28 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=fsgNr5p2; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727072AbgLBXlf (ORCPT + 99 others); Wed, 2 Dec 2020 18:41:35 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43896 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725899AbgLBXle (ORCPT ); Wed, 2 Dec 2020 18:41:34 -0500 Received: from mail-yb1-xb2a.google.com (mail-yb1-xb2a.google.com [IPv6:2607:f8b0:4864:20::b2a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 87B9DC0613D6 for ; Wed, 2 Dec 2020 15:40:54 -0800 (PST) Received: by mail-yb1-xb2a.google.com with SMTP id v92so325701ybi.4 for ; Wed, 02 Dec 2020 15:40:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=xQR0dYvXVVGwuf8cwqhcQDfB3WAV48KDjEpeGO4rQDg=; b=fsgNr5p20rJll8RVZi04Pinsq2mLl5Gxq0js9O8A/+nGsntq8WKJjZzEMvF551ifYn faKKI8qUOosRn65yaqMenGJbWkdlROgMkFyqttdKFW1k582DWUzi0jjuYuK+lBITDtgT SlP54tHrtSc4Eaw1qufSC0v2fwzl8SkRLYTW3aERtN2DxbNswyh29SwBaVpOCvFbOvo+ /Kit/WxfB7F2CT63JkmXlA5gTPl4jCntkUpWxkVRebrIDw47y1eSpbBWiVGcFs7TpRjL GEtP4oLKRmkKwCCyAbNl7UZwKQg/vOqhE/B0q/uniKWuo2Hch2k/Fu+62byTNH018ept 5YBw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=xQR0dYvXVVGwuf8cwqhcQDfB3WAV48KDjEpeGO4rQDg=; b=pXMwk0goEQUczpLRPGesSYc77b4AbdgTc5vdMi6M/4FjyeEGK4wZ3ENCRq3d6limra 6uiVCWzJemnXTcUc5RNT8XKSWS4ApOtScxcLK6t5wuzC81LR0FKDoYnfPIvCzhlm+gji C0ee6ucy31WCvJF5Y7IuwkvF9IARFLBuwi/CFn3O+1gbej0z3dAdt1SsNunZOSvIjXee fZ+XyPW3MHixr4WjikvCHvDVNm7HsvktrJ57r1Bt0CXZR0UoOvutpDeCkdjMjmZBHEBO LBykyXuCTEytEJJCoyrHWfzqpz7F0Jm+1vh27QnADhMnDLx81vEYYzw6UyuA4c9IeyrI erqg== X-Gm-Message-State: AOAM530GIMK3mTI5YeexxfjZ2ds22CAGQ4IhxGPsycS0AobWlm6NKGGA sNqeeF0ntGPi2m8pgyLwvn42GAxEg1Rp1mzbaFfRKw== X-Received: by 2002:a25:32c9:: with SMTP id y192mr805732yby.211.1606952453178; Wed, 02 Dec 2020 15:40:53 -0800 (PST) MIME-Version: 1.0 References: <20201202150205.35750-1-namhyung@kernel.org> <20201202192828.GG1363814@tassilo.jf.intel.com> <20201202224239.GJ1363814@tassilo.jf.intel.com> In-Reply-To: <20201202224239.GJ1363814@tassilo.jf.intel.com> From: Stephane Eranian Date: Wed, 2 Dec 2020 15:40:42 -0800 Message-ID: Subject: Re: [RFC 1/2] perf core: Add PERF_COUNT_SW_CGROUP_SWITCHES event To: Andi Kleen Cc: Namhyung Kim , Arnaldo Carvalho de Melo , Jiri Olsa , Ingo Molnar , Peter Zijlstra , Mark Rutland , Alexander Shishkin , LKML , Ian Rogers Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Dec 2, 2020 at 2:42 PM Andi Kleen wrote: > > On Wed, Dec 02, 2020 at 11:47:25AM -0800, Stephane Eranian wrote: > > On Wed, Dec 2, 2020 at 11:28 AM Andi Kleen wrote: > > > > > > > + prev_cgrp = task_css_check(prev, perf_event_cgrp_id, 1)->cgroup; > > > > + next_cgrp = task_css_check(next, perf_event_cgrp_id, 1)->cgroup; > > > > + > > > > + if (prev_cgrp != next_cgrp) > > > > + perf_sw_event_sched(PERF_COUNT_SW_CGROUP_SWITCHES, 1, 0); > > > > > > Seems to be the perf cgroup only, not all cgroups. > > > That's a big difference and needs to be documented properly. > > > > > We care about the all-cgroup case. > > Then it's not correct I think. You need a different hook point. > I realize that ;-(