Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp165199pxu; Thu, 3 Dec 2020 23:32:15 -0800 (PST) X-Google-Smtp-Source: ABdhPJwyVMCurEa+ObQT2bwwKBPYLiBYLm1QqTxKugY/ECiUD3kROv8tuthHxYH+59Xh+Bg/7MDK X-Received: by 2002:a17:906:12cf:: with SMTP id l15mr5824365ejb.540.1607067135024; Thu, 03 Dec 2020 23:32:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607067135; cv=none; d=google.com; s=arc-20160816; b=TpPCL7r71K8eGza9zdEkfuT0c9w36kyNIPFS7POLp+kQ9zFJeC6bBZw91GFes+scxZ X2zKwPxKPyFlp88j7oDRMTUjBEaQ+F7GiWqI9pcpCewpKAFxUsHvCVS+LkbaKlAQ6YQ6 85jdW4QTfjpU0PmMpzD+Ro+9prgU4/QRxV2mvzLlVjoJ/0gqBQCcK5S7CEF/HAKDNBhn 1F4L+Pt/gg3FdrU/m3KcXIbzJo4KJEkUntm+gY+uh1TrO4kNY5Ho4Zs3ULxYGeLthNOr WLya9hBgfgLE2DiiD7M5ihyrjdMqr2AqkW3DTabn3Dgr0O8O5Z/fQaKKIBBXoRxh9Z5S aaGg== 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; bh=tQfkQmSVyPp3fW44lOuphZCCKmXnMCViP4LNaxirrKE=; b=alwQkFYOD2WaY1ycgegYZsTdPGF1hRpGnp04pmTwQQildsm3FsKGQrmDKi/n2SHhKk 5jhzgZzmME2mJXFC1wY8ej35LoW0qvhHtegfKysHRJgwVWijNpD3KCmn9npDn02KU3jQ LSqredpGJQR1V8buIyBa6yYA7wX+3I86JkZW9AcI8JUSo5g4n41eXO5CqJ8qEJBkWhtK AAR4dw9b0jKsdfz2dqDhK/jUou/BcMQwZfri5k2+voRwXUG0M7Rpdnk+SISLCHCpoWQ+ Nmjn9FGzn3p/9SfkSEXv4ifwMfOsLaO4+BF2XL9oK+fyU+F3g5cG2twqEdpfdM4zl/MZ OZhQ== ARC-Authentication-Results: i=1; mx.google.com; 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=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s13si888746eju.603.2020.12.03.23.31.52; Thu, 03 Dec 2020 23:32:15 -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; 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=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728619AbgLDH2l (ORCPT + 99 others); Fri, 4 Dec 2020 02:28:41 -0500 Received: from mail-lf1-f42.google.com ([209.85.167.42]:36031 "EHLO mail-lf1-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726826AbgLDH2l (ORCPT ); Fri, 4 Dec 2020 02:28:41 -0500 Received: by mail-lf1-f42.google.com with SMTP id v14so6363182lfo.3 for ; Thu, 03 Dec 2020 23:28:25 -0800 (PST) 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=tQfkQmSVyPp3fW44lOuphZCCKmXnMCViP4LNaxirrKE=; b=ZsSSBdmiG2J4gYlY2aO10f6WvgI/elIldC0TL7jFIPfaArTYHUC97GAq13VOoMfo83 wKfJtCS5kRSyKjyL8S0J9xYsk1jgEuWY9Zlz5VdDfM7/tJyZ8kd7GyPMp9X3DnkFAvr8 yr6OCjuf/oyr/YRXalf3IqQ2b250Xyk5O86i9GZAR6WHvaz854sxFUlKEkLqumw+X0qV Wg9ubBkUXayP2xSgQPbj0D5n0m2pn4MkRvawYNSvdJHAw4n7ymkEBAj2jD4ifZ26IrKO u21DkHlft4fbs4L0TMCMAoUnwDqiznQpL6hF7MlHmG2sZOhKeUU9snGzSCYQ5h9vFUqy i6RQ== X-Gm-Message-State: AOAM531vzmnftNFH37YsEQryDXRuYz03Su4Xwae2z0Sg5Ixn2fz7da0m Q2JtAyl5uQ1lXHwvpJubx3QeVjk2amSdqWIqOi8= X-Received: by 2002:a19:4154:: with SMTP id o81mr2654333lfa.540.1607066879301; Thu, 03 Dec 2020 23:27:59 -0800 (PST) MIME-Version: 1.0 References: <20201202150205.35750-1-namhyung@kernel.org> <20201202192828.GG1363814@tassilo.jf.intel.com> <20201203122040.GO3021@hirez.programming.kicks-ass.net> In-Reply-To: <20201203122040.GO3021@hirez.programming.kicks-ass.net> From: Namhyung Kim Date: Fri, 4 Dec 2020 16:27:47 +0900 Message-ID: Subject: Re: [RFC 1/2] perf core: Add PERF_COUNT_SW_CGROUP_SWITCHES event To: Peter Zijlstra Cc: Andi Kleen , Arnaldo Carvalho de Melo , Jiri Olsa , Ingo Molnar , Mark Rutland , Alexander Shishkin , LKML , Stephane Eranian , Ian Rogers Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Dec 3, 2020 at 9:20 PM Peter Zijlstra wrote: > > On Wed, Dec 02, 2020 at 11:28:28AM -0800, 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. > > With cgroup-v2 that's all the same, no? Right, but unfortunately it seems still cgroup v1 is used widely. Thanks, Namhyung