linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: ebiederm@xmission.com (Eric W. Biederman)
To: Hari Bathini <hbathini@linux.vnet.ibm.com>
Cc: ast@fb.com, peterz@infradead.org,
	lkml <linux-kernel@vger.kernel.org>,
	acme@kernel.org, alexander.shishkin@linux.intel.com,
	mingo@redhat.com, daniel@iogearbox.net, rostedt@goodmis.org,
	Ananth N Mavinakayanahalli <ananth@linux.vnet.ibm.com>,
	sargun@sargun.me, Aravinda Prasad <aravinda@linux.vnet.ibm.com>,
	brendan.d.gregg@gmail.com
Subject: Re: [PATCH v3 3/3] perf tool: add cgroup identifier entry in perf report
Date: Wed, 14 Dec 2016 08:56:43 +1300	[thread overview]
Message-ID: <87inqnfvr8.fsf@xmission.com> (raw)
In-Reply-To: <4c6c4754-6a87-56bc-3351-fef699cc57e1@linux.vnet.ibm.com> (Hari Bathini's message of "Wed, 14 Dec 2016 00:37:52 +0530")

Hari Bathini <hbathini@linux.vnet.ibm.com> writes:

> Hi Eric,
>
>
> On Tuesday 13 December 2016 03:36 AM, Eric W. Biederman wrote:
>> Hari Bathini <hbathini@linux.vnet.ibm.com> writes:
>>
>>> This patch introduces a cgroup identifier entry field in perf report to
>>> identify or distinguish data of different cgroups. It uses the unique
>>> inode number of cgroup namespace, included in perf data with the new
>>> PERF_RECORD_NAMESPACES event, as cgroup identifier. With the assumption
>>> that each container is created with it's own cgroup namespace, this
>>> allows assessment/analysis of multiple containers at once.
>> In the large this sounds reasonable.
>>
>> The details are wrong.  The cgroup id needs to be device
>> number + inode number, not just inode number.
>>
>
> As the assumption that device number is going to be the same for
> all namespaces may not stand the test of time, the inode number is
> not going to be unique, to use as an identifier..
>
> I am thinking of an identifier like the below. This may be OK for now
> as dev_num & inode_num are 32bit each.
>
>     identifier = (dev_num << 32 | inode_num)
>
> But this may leave us with identifiers that are not unique if dev_num
> & inode_num are changed to 64bit. Should that be of concern? Do
> you have any alternate suggestions to come up with unique identifier
> in such scenario too..?

Inode numbers in general are 64bit.  The namespace inodes admittedly are
currently implemented as 32bit quantities but that is not something we
want to hard code into the userspace interface.

I would just make the identifier a structure containing the
device number and the inode number.  It didn't look like perf required
the identifier to be a simple integer.

Eric

  reply	other threads:[~2016-12-13 20:00 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-12 18:19 [PATCH v3 0/3] perf: add support for analyzing events for containers Hari Bathini
2016-12-12 18:19 ` [PATCH v3 1/3] perf: add PERF_RECORD_NAMESPACES to include namespaces related info Hari Bathini
2016-12-12 18:27   ` Eric W. Biederman
2016-12-13 18:47     ` Hari Bathini
2016-12-13 19:58       ` Eric W. Biederman
2016-12-12 18:19 ` [PATCH v3 2/3] perf tool: " Hari Bathini
2016-12-12 21:51   ` Eric W. Biederman
2016-12-12 18:20 ` [PATCH v3 3/3] perf tool: add cgroup identifier entry in perf report Hari Bathini
2016-12-12 22:06   ` Eric W. Biederman
2016-12-13 19:07     ` Hari Bathini
2016-12-13 19:56       ` Eric W. Biederman [this message]
2016-12-14  8:24         ` Peter Zijlstra
2016-12-14 15:52           ` Eric W. Biederman
2016-12-14 17:03             ` Hari Bathini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87inqnfvr8.fsf@xmission.com \
    --to=ebiederm@xmission.com \
    --cc=acme@kernel.org \
    --cc=alexander.shishkin@linux.intel.com \
    --cc=ananth@linux.vnet.ibm.com \
    --cc=aravinda@linux.vnet.ibm.com \
    --cc=ast@fb.com \
    --cc=brendan.d.gregg@gmail.com \
    --cc=daniel@iogearbox.net \
    --cc=hbathini@linux.vnet.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=rostedt@goodmis.org \
    --cc=sargun@sargun.me \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).