Re: [PATCH 2/9] perf/core: Add PERF_SAMPLE_CGROUP feature

2019-10-07 Thread Tejun Heo
Hello, On Wed, Oct 02, 2019 at 03:28:00PM +0900, Namhyung Kim wrote: > On Sat, Sep 21, 2019 at 6:04 AM Tejun Heo wrote: > > > > On Fri, Sep 20, 2019 at 05:47:45PM +0900, Namhyung Kim wrote: > > > Thanks for the sharing information! For 32-bit, while the ino itself is > > > not > > > monotonic,

Re: [PATCH 2/9] perf/core: Add PERF_SAMPLE_CGROUP feature

2019-10-02 Thread Namhyung Kim
Hi Tejun, Sorry for the late reply. On Sat, Sep 21, 2019 at 6:04 AM Tejun Heo wrote: > > On Fri, Sep 20, 2019 at 05:47:45PM +0900, Namhyung Kim wrote: > > Thanks for the sharing information! For 32-bit, while the ino itself is not > > monotonic, gen << 32 + ino is monotonic right? I think we

Re: [PATCH 2/9] perf/core: Add PERF_SAMPLE_CGROUP feature

2019-09-20 Thread Tejun Heo
On Fri, Sep 20, 2019 at 05:47:45PM +0900, Namhyung Kim wrote: > Thanks for the sharing information! For 32-bit, while the ino itself is not > monotonic, gen << 32 + ino is monotonic right? I think we can use the It's not. gen gets incremented on every allocation, so it has not high but still

Re: [PATCH 2/9] perf/core: Add PERF_SAMPLE_CGROUP feature

2019-09-20 Thread Song Liu
Hi Namhyung, On Fri, Sep 20, 2019 at 1:47 AM Namhyung Kim wrote: > > Hello Song, > > On Thu, Sep 19, 2019 at 3:43 PM Song Liu wrote: > > > Sharing some offline discussions with Tejun. > > > > ino in current kernfs is not a good unique ID for cgroup, because it doesn't > > increase

Re: [PATCH 2/9] perf/core: Add PERF_SAMPLE_CGROUP feature

2019-09-20 Thread Namhyung Kim
Hello Song, On Thu, Sep 19, 2019 at 3:43 PM Song Liu wrote: > Sharing some offline discussions with Tejun. > > ino in current kernfs is not a good unique ID for cgroup, because it doesn't > increase monotonically. So we need to improve kernfs. > > For 64-bit, we can make the ino monotonic, and

Re: [PATCH 2/9] perf/core: Add PERF_SAMPLE_CGROUP feature

2019-09-19 Thread Song Liu
On Mon, Sep 16, 2019 at 4:23 PM Tejun Heo wrote: > > Hello, Song. > > On Sat, Sep 14, 2019 at 03:02:51PM +0100, Song Liu wrote: > > I think we don't need a perfect identifier in this case. IIUC, the goal of > > I really don't want different versions of imperfect identifiers > proliferating. > > >

Re: [PATCH 2/9] perf/core: Add PERF_SAMPLE_CGROUP feature

2019-09-16 Thread Tejun Heo
Hello, Song. On Sat, Sep 14, 2019 at 03:02:51PM +0100, Song Liu wrote: > I think we don't need a perfect identifier in this case. IIUC, the goal of I really don't want different versions of imperfect identifiers proliferating. > this patchset is to map each sample with a cgroup name (or full

Re: [PATCH 2/9] perf/core: Add PERF_SAMPLE_CGROUP feature

2019-09-14 Thread Song Liu
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

Re: [PATCH 2/9] perf/core: Add PERF_SAMPLE_CGROUP feature

2019-09-08 Thread Namhyung Kim
Hi Tejun, On Thu, Sep 05, 2019 at 09:56:55AM -0700, Tejun Heo wrote: > Hello, Namhyung. > > On Tue, Sep 03, 2019 at 10:13:08AM +0800, Namhyung Kim wrote: > > So is my understanding below correct? > > > > * currently kernfs ino+gen is different than inode's ino+gen > > They're the same. It's

Re: [PATCH 2/9] perf/core: Add PERF_SAMPLE_CGROUP feature

2019-09-05 Thread Tejun Heo
Hello, Namhyung. On Tue, Sep 03, 2019 at 10:13:08AM +0800, Namhyung Kim wrote: > So is my understanding below correct? > > * currently kernfs ino+gen is different than inode's ino+gen They're the same. It's just that cgroup has other less useful IDs too. > * but it'd be better to make them

Re: [PATCH 2/9] perf/core: Add PERF_SAMPLE_CGROUP feature

2019-09-02 Thread Namhyung Kim
Hi Tejun, Sorry for the late reply. On Fri, Aug 30, 2019 at 09:58:15PM -0700, 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

Re: [PATCH 2/9] perf/core: Add PERF_SAMPLE_CGROUP feature

2019-08-30 Thread Tejun Heo
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

Re: [PATCH 2/9] perf/core: Add PERF_SAMPLE_CGROUP feature

2019-08-30 Thread Namhyung Kim
Hi Tejun, On Wed, Aug 28, 2019 at 07:49:11AM -0700, Tejun Heo wrote: > On Wed, Aug 28, 2019 at 04:31:23PM +0900, Namhyung Kim wrote: > > @@ -958,6 +958,7 @@ struct perf_sample_data { > > u64 stack_user_size; > > > > u64 phys_addr;

Re: [PATCH 2/9] perf/core: Add PERF_SAMPLE_CGROUP feature

2019-08-28 Thread Tejun Heo
On Wed, Aug 28, 2019 at 04:31:23PM +0900, Namhyung Kim wrote: > @@ -958,6 +958,7 @@ struct perf_sample_data { > u64 stack_user_size; > > u64 phys_addr; > + u64 cgroup; Ditto, please use fhandle

[PATCH 2/9] perf/core: Add PERF_SAMPLE_CGROUP feature

2019-08-28 Thread Namhyung Kim
The PERF_SAMPLE_CGROUP bit is to save (perf_event) cgroup information in the sample. It will add a 64-bit integer to identify current cgroup and it's the inode number in the cgroup file system. Userspace should use this information with PERF_RECORD_CGROUP event to match which cgroup it belongs.