On Fri, 20 Mar 2015 13:46:39 +0300 Stefan Strogin <s.strogin@xxxxxxxxxxxxxxxxxxx> wrote: > Ah, thanks, I see. So will this solve the described issue? > + TP_fast_assign( > + __entry->page = page; > + __entry->pfn = page_to_pfn(__entry->page) : 0; > /* or -1 as Ingo suggested */ > + __entry->count = count; > + ), > + > + TP_printk("page=%p pfn=%lu count=%u", > + __entry->page, > + __entry->pfn, > + __entry->count) > > Should we do the same in trace/events/kmem.h then? > > But really I'm not sure why page_to_pfn()/pfn_to_page() can return > different results... I thought that there can appear new 'struct page' > entries arrays throughout one boot due to memory hotplug or smth. But > how can existing 'struct page' entries associated with the same physical > pages change their physical addresses? Or how can one physical address > correspond to different physical page throughout one boot? I don't know if those mappings can change. I'm just warning you that if they can, then you can have an issue with it. If that's the case, then it would be best to do the work in the tracepoint instead of the print. One benefit for making this change is that it will let userspace tools such as perf and trace-cmd parse it better. -- Steve -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@xxxxxxxxx. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"dont@xxxxxxxxx"> email@xxxxxxxxx </a>