Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1724979

Re: [PATCH 1/5] tracing, mm: Record pfn instead of pointer to struct page

From Steven Rostedt <rostedt@goodmis.org>
Newsgroups linux.kernel
Subject Re: [PATCH 1/5] tracing, mm: Record pfn instead of pointer to struct page
Date 2017-09-01 13:20 +0200
Message-ID <ukS9s-3q0-15@gated-at.bofh.it> (permalink)
References (2 earlier) <u9dCG-3sb-17@gated-at.bofh.it> <uky14-6he-11@gated-at.bofh.it> <ukyNs-6MQ-23@gated-at.bofh.it> <ukyX8-6Qc-25@gated-at.bofh.it> <ukPlf-1gx-5@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Fri, 1 Sep 2017 10:16:21 +0200
Vlastimil Babka <vbabka@suse.cz> wrote:
 
> > Right, but that should work with the latest trace-cmd. Does it?  
> 
> Hmm, by "sparse memory model without vmemmap" I don't mean there's a
> number instead of "vmemmap_base". I mean CONFIG_SPARSEMEM=y
> 
> Then __pfn_to_page() looks like this:
> 
> #define __page_to_pfn(pg)                                       \
> ({      const struct page *__pg = (pg);                         \
>         int __sec = page_to_section(__pg);                      \
>         (unsigned long)(__pg - __section_mem_map_addr(__nr_to_section(__sec))); \
> })
> 
> Then the part of format file looks like this:
> 
> REC->pfn != -1UL ? ({ unsigned long __pfn = (REC->pfn); struct mem_section *__sec = __pfn_to_section(__pfn); __section_mem_map_addr(__sec) + __pfn; }) : ((void *)0)

Ouch.

> 
> The section things involve some array lookups, so I don't see how we
> could pass it to tracing userspace. Would we want to special-case
> this config to store both pfn and struct page in the trace frame? And
> make sure the simpler ones work despite all the exsisting gotchas?
> I'd rather say we should either store both pfn and page pointer, or
> just throw away the page pointer as the pfn is enough to e.g. match
> alloc and free, and also much more deterministic.

Write up a patch and we'll take a look.

-- Steve

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

Re: [PATCH 1/5] tracing, mm: Record pfn instead of pointer to  struct page Steven Rostedt <rostedt@goodmis.org> - 2017-08-31 15:50 +0200
  Re: [PATCH 1/5] tracing, mm: Record pfn instead of pointer to struct  page Vlastimil Babka <vbabka@suse.cz> - 2017-08-31 16:40 +0200
    Re: [PATCH 1/5] tracing, mm: Record pfn instead of pointer to  struct page Steven Rostedt <rostedt@goodmis.org> - 2017-08-31 16:50 +0200
      Re: [PATCH 1/5] tracing, mm: Record pfn instead of pointer to struct  page Vlastimil Babka <vbabka@suse.cz> - 2017-09-01 10:20 +0200
        Re: [PATCH 1/5] tracing, mm: Record pfn instead of pointer to  struct page Steven Rostedt <rostedt@goodmis.org> - 2017-09-01 13:20 +0200

csiph-web