From: Namhyung Kim <namhyung@kernel.org>
To: Ingo Molnar <mingo@kernel.org>
Cc: Joonsoo Kim <js1304@gmail.com>,
Arnaldo Carvalho de Melo <acme@kernel.org>,
Peter Zijlstra <a.p.zijlstra@chello.nl>,
Jiri Olsa <jolsa@redhat.com>, LKML <linux-kernel@vger.kernel.org>,
David Ahern <dsahern@gmail.com>, Minchan Kim <minchan@kernel.org>
Subject: Re: [PATCH 2/5] perf kmem: Analyze page allocator events also
Date: Tue, 24 Mar 2015 22:17:08 +0900 [thread overview]
Message-ID: <20150324131708.GB14900@danjae.kornet> (raw)
In-Reply-To: <20150324070802.GB28190@gmail.com>
Hi Ingo,
On Tue, Mar 24, 2015 at 08:08:03AM +0100, Ingo Molnar wrote:
> * Joonsoo Kim <js1304@gmail.com> wrote:
> > How about following change and making 'perf kmem' print pfn?
> > If we store pfn on the trace buffer, we can print $debugfs/tracing/trace
> > as is and 'perf kmem' can also print pfn.
> >
> > Thanks.
> >
> > diff --git a/include/trace/events/kmem.h b/include/trace/events/kmem.h
> > index 4ad10ba..9dcfd0b 100644
> > --- a/include/trace/events/kmem.h
> > +++ b/include/trace/events/kmem.h
> > @@ -199,22 +199,22 @@ TRACE_EVENT(mm_page_alloc,
> > TP_ARGS(page, order, gfp_flags, migratetype),
> >
> > TP_STRUCT__entry(
> > - __field( struct page *, page )
> > + __field( unsigned long, pfn )
> > __field( unsigned int, order )
> > __field( gfp_t, gfp_flags )
> > __field( int, migratetype )
> > ),
> >
> > TP_fast_assign(
> > - __entry->page = page;
> > + __entry->pfn = page ? page_to_pfn(page) : -1;
> > __entry->order = order;
> > __entry->gfp_flags = gfp_flags;
> > __entry->migratetype = migratetype;
> > ),
> >
> > TP_printk("page=%p pfn=%lu order=%d migratetype=%d gfp_flags=%s",
> > - __entry->page,
> > - __entry->page ? page_to_pfn(__entry->page) : 0,
> > + __entry->pfn != -1 ? pfn_to_page(__entry->pfn) : NULL,
> > + __entry->pfn != -1 ? __entry->pfn : 0,
> > __entry->order,
> > __entry->migratetype,
> > show_gfp_flags(__entry->gfp_flags))
>
> Acked-by: Ingo Molnar <mingo@kernel.org>
>
> It would be very nice to make all the other page granular tracepoints
> output pfn (which is a physical address that can be resolved to 'node'
> and other properties), not 'struct page *' (which is a kernel resource
> with little meaning to user-space tooling).
>
> I.e. the following tracepoints:
>
> triton:~/tip> git grep -E '__field.*struct page *' include/trace/
> include/trace/events/filemap.h: __field(struct page *, page)
> include/trace/events/kmem.h: __field( struct page *, page )
> include/trace/events/kmem.h: __field( struct page *, page )
> include/trace/events/kmem.h: __field( struct page *, page )
> include/trace/events/kmem.h: __field( struct page *, page )
> include/trace/events/kmem.h: __field( struct page *, page )
> include/trace/events/pagemap.h: __field(struct page *, page )
> include/trace/events/pagemap.h: __field(struct page *, page )
> include/trace/events/vmscan.h: __field(struct page *, page)
Okay, will do.
>
> there's very little breakage I can imagine: they have traced pointers
> to 'struct page', which is a pretty opaque page identifier to
> user-space, and they'll trace pfn's in the future, which still serves
> as a page identifier.
Agreed.
>
> One thing would be important: to do all these changes at once, to make
> sure that the various page identifiers can be compared.
OK
>
> Also, we might keep the 'page' field name if anything relies on that -
> but 'pfn' is even better.
Another option is to keep page field and add new pfn field. The
events in pagemap.h already do this way. This will minimize the
possible breakage but increase the trace size somewhat.
Thanks,
Namhyung
next prev parent reply other threads:[~2015-03-24 13:18 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-03-23 6:30 [PATCHSET 0/5] perf kmem: Implement page allocation analysis (v3) Namhyung Kim
2015-03-23 6:30 ` [PATCH 1/5] perf kmem: Print big numbers using thousands' group Namhyung Kim
2015-03-23 14:08 ` Arnaldo Carvalho de Melo
2015-03-23 23:35 ` Namhyung Kim
2015-03-24 16:31 ` [tip:perf/core] " tip-bot for Namhyung Kim
2015-03-23 6:30 ` [PATCH 2/5] perf kmem: Analyze page allocator events also Namhyung Kim
2015-03-23 17:32 ` Joonsoo Kim
2015-03-24 0:18 ` Namhyung Kim
2015-03-24 5:26 ` Joonsoo Kim
2015-03-24 6:05 ` Namhyung Kim
2015-03-24 7:08 ` Ingo Molnar
2015-03-24 13:17 ` Namhyung Kim [this message]
2015-03-23 6:30 ` [PATCH 3/5] perf kmem: Implement stat --page --caller Namhyung Kim
2015-03-23 6:30 ` [PATCH 4/5] perf kmem: Support sort keys on page analysis Namhyung Kim
2015-03-23 17:27 ` Joonsoo Kim
2015-03-24 0:20 ` Namhyung Kim
2015-03-23 6:30 ` [PATCH 5/5] perf kmem: Add --live option for current allocation stat Namhyung Kim
2015-03-23 17:23 ` [PATCHSET 0/5] perf kmem: Implement page allocation analysis (v3) Joonsoo Kim
2015-03-23 23:57 ` Namhyung Kim
2015-04-13 22:14 [GIT PULL 0/5] perf/core improvements and fixes Arnaldo Carvalho de Melo
2015-04-13 22:14 ` [PATCH 2/5] perf kmem: Analyze page allocator events also Arnaldo Carvalho de Melo
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=20150324131708.GB14900@danjae.kornet \
--to=namhyung@kernel.org \
--cc=a.p.zijlstra@chello.nl \
--cc=acme@kernel.org \
--cc=dsahern@gmail.com \
--cc=jolsa@redhat.com \
--cc=js1304@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=minchan@kernel.org \
--cc=mingo@kernel.org \
/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
all inboxes | Powered by JetHome®