Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp2526304ybe; Sat, 14 Sep 2019 17:24:03 -0700 (PDT) X-Google-Smtp-Source: APXvYqwfqKUd/6eE0mkzwmwuiiGD3jIfdTz+Xh9Kn5nRmWO45IDfYcryZatKDxdF3QakTabvRdX+ X-Received: by 2002:a17:906:7ac6:: with SMTP id k6mr40727432ejo.243.1568507043300; Sat, 14 Sep 2019 17:24:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1568507043; cv=none; d=google.com; s=arc-20160816; b=XSaf1Hw1loLBYBUPef9UZkh8TFkUUgjpshOnYdCm33Z1t5dGF2dn/GlQnBoIjS7Rpl QwqPUjwnoyopf5yv3c7HUp9QEjWF60/zcTHVGBhW0ZRBkbxlmHzWyWvoH3LhIFG2fnv3 4d22WRgaqJlqblCAGaQigvOoaNgJkcx/lM614Mldn8b627ToY4Act87SAIg4EHnmwePj bnPtI66Qi8KxRsLh2oCaxyQN8Y8dvk2jwWl4ZAv7rdE52bhrLYLSbAi+jDiFgUZUmlbm yafBpawFei+tu48/cq0mAvT/prnvKZ6Iksvk7xLTV56cj6ZcVtdvX2Vi5fyQuBXXJsU9 Mjqw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=FILpjNL+RmY6Z8jojDq41S9B56t8mMa/fsPAusJZOio=; b=py7yY5E2u+17PnqM3aVftwV1aMwBF6+krfVJkmTFVedkPzp0mKn5pHFR/qfSivwl/L 5hePPcJMF/vyp9oTX/A7TPBcdGGzALwBFkOpQTJzlYSh5zDQ6X6DPub3GFRGTIoQ2UO5 V7N8PujHAx35ssm/+fORalzcUgzHWT4II0xXpVbO7hzOSBa3eHR+D0fPpazZdfIkaDVk t1CAaDp63rr7UBdC3rJtqWOIcXaWmcgVeDXdb7kX0IzbyvVWnaR6xfNXGhAerDuNn2+c Im/d/tWK6qF/9o/ZpsT/1ZD07wDEbQwnjmxG8g7TwtZjb9JXZjrRFSheUgwc7V7uXGXm SIiA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=SLWQXsiA; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x15si20467274eda.53.2019.09.14.17.23.31; Sat, 14 Sep 2019 17:24:03 -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=pass header.i=@gmail.com header.s=20161025 header.b=SLWQXsiA; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389092AbfINODD (ORCPT + 99 others); Sat, 14 Sep 2019 10:03:03 -0400 Received: from mail-qt1-f196.google.com ([209.85.160.196]:38609 "EHLO mail-qt1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388939AbfINODD (ORCPT ); Sat, 14 Sep 2019 10:03:03 -0400 Received: by mail-qt1-f196.google.com with SMTP id j31so10710587qta.5 for ; Sat, 14 Sep 2019 07:03:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=FILpjNL+RmY6Z8jojDq41S9B56t8mMa/fsPAusJZOio=; b=SLWQXsiAhmwj62UAX0GnvilBsNPnufvkJAh5HS7n6HTVmIdgJ+fHcCCPcvXxVaIqOp ZzgaKO4ZtzPlCH0RKHTyIFfDnR5KHLFhicEun4sViedpWlSdiw0zxM/WnzUsfI9ZXBbr pV7T0PZFp3oO5Zb5WzvWJgz7Rb7DU9JnmCxB7RKG1dHfXNSPCRm91ZPfEcsSPhyN6qty qA7ALNCtMfzdMne8tIdViX0cFnw4SR6fJ+S/SQGTHBvjXkgOXXtedpAQpyBbuj1zuweR pVh/66Q9713kEcl8N7RfWJu85sQVnifXvjQGBbGoOs4RgNS8+ko5Haw89/3WeQpl+uqF iwCA== 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=FILpjNL+RmY6Z8jojDq41S9B56t8mMa/fsPAusJZOio=; b=A45P8xBOJRfxCX4BQtW7hy8dVj+OX9LT1+3K8DSTbuH77+07Un3kO5cbbP1o2o09NB 9hRvSal2c0dAz/Q0EGdf4eQeek/bPDz8iPH+0+R8u9MsYxzIRMdY8aMLswJTeM7JbA09 GsEX8W6DIxRNZzZH88QRnUn+ZaZux9aPinjiIDAAuhOV0rcYA8nMuOvEp7K7U56SD4AG VTupJBAS70Id9/L1hpmuhJ9i8uzdnjV8DHf1A+oNe12j/koQm7+caKc/QflgbXO0vtQ0 gpLe6J8mbnQ6yLvMZoLg7wAGY93hqhJ6d+ZHxj4a6wycUGcjEYv3L1nv0slTobJyezue d1xw== X-Gm-Message-State: APjAAAVLEoBUF146ElBlF3nO9w5auQqZ9d0bPOpEu5pr8iBWW7+ttf7d JlSagB9pQid/mSREbvsi6hoQzL6qhdEDvCfIOq0= X-Received: by 2002:ac8:3021:: with SMTP id f30mr8450945qte.193.1568469782620; Sat, 14 Sep 2019 07:03:02 -0700 (PDT) MIME-Version: 1.0 References: <20190828073130.83800-1-namhyung@kernel.org> <20190828073130.83800-3-namhyung@kernel.org> <20190828144911.GR2263813@devbig004.ftw2.facebook.com> <20190831030321.GA93532@google.com> <20190831045815.GE2263813@devbig004.ftw2.facebook.com> In-Reply-To: <20190831045815.GE2263813@devbig004.ftw2.facebook.com> From: Song Liu Date: Sat, 14 Sep 2019 15:02:51 +0100 Message-ID: Subject: Re: [PATCH 2/9] perf/core: Add PERF_SAMPLE_CGROUP feature To: Tejun Heo Cc: Namhyung Kim , Ingo Molnar , Peter Zijlstra , Arnaldo Carvalho de Melo , LKML , Jiri Olsa , Alexander Shishkin , Stephane Eranian , Li Zefan , Johannes Weiner Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Tejun, On Sat, Aug 31, 2019 at 6:01 AM Tejun Heo wrote: > > Hello, > > On Sat, Aug 31, 2019 at 12:03:26PM +0900, Namhyung Kim wrote: > > Hmm.. it looks hard to use fhandle as the identifier since perf > > sampling is done in NMI context. AFAICS the encode_fh part seems ok > > but getting dentry/inode from a kernfs_node seems not. > > > > I assume kernfs_node_id's ino and gen are same to its inode's. Then > > we might use kernfs_node for encoding but not sure you like it ;-) > > Oh yeah, the whole cgroup id situation is kinda shitty and it's likely > that it needs to be cleaned up a bit for this to be used widely. The > issues are... Here are my 2 cents about this. I think we don't need a perfect identifier in this case. IIUC, the goal of this patchset is to map each sample with a cgroup name (or full path). To achieve this, we need 1. PERF_RECORD_CGROUP, that maps "64-bit number" => cgroup name/path 2. PERF_SAMPLE_CGROUP, that adds "64-bit number" to each sample. I call the id a "64-bit number" because it is not required to be a globally unique id. As long as it is consistent within the same perf-record session, we won't get any confusion. Since we add PERF_RECORD_CGROUP for each cgroup creation, we will map most of samples correctly even when the "64-bit number" is recycled within the same perf-record session. At the moment, I think ino is good enough for the "64-bit number" even for 32-bit systems. If we don't call it "ino" (just call it "cgroup_tag" or "cgroup_id", we can change it when kernfs provides a better 64-bit id. About full path name: The user names the full path here. If the user gives two different workloads the same name/path, we really cannot change that. Reasonable users would be able to make sense from the full path. Thanks, Song