Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp128107pxu; Wed, 2 Dec 2020 17:08:27 -0800 (PST) X-Google-Smtp-Source: ABdhPJyIJPyZ1cOb/2AcnxGt+aEXaq7Cewrpaw1lYVOAtXjuqVcPbHAkYN1H/2yTHjCPb1Q21S9R X-Received: by 2002:a17:906:3b5b:: with SMTP id h27mr436650ejf.450.1606957707423; Wed, 02 Dec 2020 17:08:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606957707; cv=none; d=google.com; s=arc-20160816; b=MBj4jg8BZZBy4INAFqkA+viqLMTlKZghF/3AE2z41FpKDFscvdYgp1xmBomdQ7pr3A pUEJmf0AImxPrb0eXAshIeOmffksutUk+oRqFFmlKw1e4ox/nQjOup94v/fU48Fwomzm pvdZa6rt/nszVOzEkakIaeywS0cKYWJJvvMu504rCNjZ5/vuhibzIpQl6n+deeAQEfez 6bcCzLZ5+mbNL9Yy8BLbKF94iY4Ubho4YWSxJyGAHp6WrJk8RmV1AAbCaMDszZrk8Obd wt2luU/DBU9F+yfZ4Mu/6zS+UHuGnLBCvGZS0yEcqzstuKTi1aMmCH1tdOHouTBWBaXo XvIQ== 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=FqBDFILtKC1/XhSHgxkhsjETw7FLnQmSQ+/jvyeh0Wg=; b=HS8fLH3Raf8x0YLL36AdWGxT+tWoa7Fd3P6Lq1dzpGVoe7UaG8g/jnoV+F76qpYqf5 3glRup9MtrFY2fgk05SDi93qH/fYj2mr0xVtNgB3fW1zA27dyzXrpIBGF7mpNuRocvob RRflTsZWV6qOPx1NEz8dYii99B/f5IjecM3MqoxNHFhsiiCI3w38w5Oo0+YPR7cOLK1G 3pbp69IPPDkJCamavbyQq4BYlJhFLNiOzVfOv46/jdV8CSx2l5+Dor7VWypV8LMoWDBC G+UrJKzyG/K8fuoTBQgWMg2db3KlkS3KMDkksNcmb91vF1gQuCWpzXf1mizDWk8gY29e Adyw== 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 gw26si163488ejb.537.2020.12.02.17.08.01; Wed, 02 Dec 2020 17:08:27 -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 S1728751AbgLCBEv (ORCPT + 99 others); Wed, 2 Dec 2020 20:04:51 -0500 Received: from mail-lf1-f44.google.com ([209.85.167.44]:36282 "EHLO mail-lf1-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726851AbgLCBEv (ORCPT ); Wed, 2 Dec 2020 20:04:51 -0500 Received: by mail-lf1-f44.google.com with SMTP id v14so273061lfo.3 for ; Wed, 02 Dec 2020 17:04:29 -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=FqBDFILtKC1/XhSHgxkhsjETw7FLnQmSQ+/jvyeh0Wg=; b=XdkMLUil0v5UTEWEv5xIPl35soqTEjjbATxpaSjLk1uaiZTjdmsE+WVLc6Z+oQ2oWG nxXcrxCaniW4F8YMcg6ZjRvebyMZu/OZY1moNy267+CV/B4lMSUC94eE0zk4xUtetVMA DE8c11gos/59x8gtKU0VZgcbkVFQqUzASHV1tDlxWLMiTGpZDLS8RtCfaT4IFoo3lhtr 7K/hq0Oeu8kpXGMieXTo6UHKi7i8J+9qRWNQjxrirPlxWAJnqW4PbOYEGS3OsJIw+V8G Ieim7SaoYaJvU86QdZEH/AoEbL+7P5S8PgXqXCJsfZOCJPfZeeHuvICs9qfxO0cf9SGp nBgA== X-Gm-Message-State: AOAM532lVXRJxUjB+035YlN5x45Kyid3hytYHSfHvjiFBfM7hiXY19UW Cl2yOv2jyfiF+nDH2sidiRHotLKUjfVfRPuu5eU= X-Received: by 2002:a19:38e:: with SMTP id 136mr287491lfd.593.1606957443379; Wed, 02 Dec 2020 17:04:03 -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: From: Namhyung Kim Date: Thu, 3 Dec 2020 10:03:52 +0900 Message-ID: Subject: Re: [RFC 1/2] perf core: Add PERF_COUNT_SW_CGROUP_SWITCHES event To: Stephane Eranian Cc: Andi Kleen , 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 Hi Stephane and Andi, On Thu, Dec 3, 2020 at 8:40 AM Stephane Eranian wrote: > > 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 ;-( If we want to count any cgroup changes, I think we can compare task->cgroups (css_set) here instead. Thanks, Namyung