From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757015AbbGQMVF (ORCPT ); Fri, 17 Jul 2015 08:21:05 -0400 Received: from e33.co.us.ibm.com ([32.97.110.151]:47860 "EHLO e33.co.us.ibm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753268AbbGQMVD (ORCPT ); Fri, 17 Jul 2015 08:21:03 -0400 X-Helo: d03dlp02.boulder.ibm.com X-MailFrom: aravinda@linux.vnet.ibm.com X-RcptTo: linux-kernel@vger.kernel.org Message-ID: <55A8F324.9090206@linux.vnet.ibm.com> Date: Fri, 17 Jul 2015 17:50:52 +0530 From: Aravinda Prasad User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130510 Thunderbird/17.0.6 MIME-Version: 1.0 To: Peter Zijlstra CC: linux-kernel@vger.kernel.org, rostedt@goodmis.org, mingo@redhat.com, paulus@samba.org, acme@kernel.org, hbathini@linux.vnet.ibm.com, ananth@in.ibm.com Subject: Re: [RFC PATCH] perf: Container-aware tracing support References: <20150715090836.16376.80760.stgit@aravindap> <20150715124741.GL2859@worktop.programming.kicks-ass.net> <55A688A0.7070507@linux.vnet.ibm.com> <20150717101950.GS3644@twins.programming.kicks-ass.net> In-Reply-To: <20150717101950.GS3644@twins.programming.kicks-ass.net> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 15071712-0009-0000-0000-00000C8BB035 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Friday 17 July 2015 03:49 PM, Peter Zijlstra wrote: > On Wed, Jul 15, 2015 at 09:51:52PM +0530, Aravinda Prasad wrote: >>>> + } else if (task_active_pid_ns(current) != &init_pid_ns) { >>> >>> Why the pid namespace? >> >> This comes from my understanding of container -- having at least a >> separate PID namespace with processes inside a container grouped into a >> single perf_event cgroups subsystem. >> >> I know there are other ways to define a container, however, I thought I >> start with the above one. > > Right, but you should at least mention this, preferably in a comment. Yes. I should have done that. > >>> >>>> + /* Don't set event->cgrp if task belongs to root cgroup */ >>>> + if (task_css_is_root(current, perf_event_cgrp_id)) >>>> + return ret; >>> >>> So if you have the root perf_cgroup inside your container you can >>> escape? >> >> If we have root perf_cgroup inside the container then even if we set >> event->cgrp we will be including all processes in the system. > > Yes, that's what I said. Why does that make sense? We assume that processes are grouped into a single perf_event subsystem. If we have root perf_cgroup, from our assumption, implies we are not invoked from a container context. However, not sure if this assumption is right. > -- Regards, Aravinda