Re: [PATCH V4] mm: fix kernel crash in khugepaged thread

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 11/16/2015 02:35 AM, yalin wang wrote:

On Nov 13, 2015, at 22:01, Steven Rostedt <rostedt@xxxxxxxxxxx> wrote:

On Fri, 13 Nov 2015 19:54:11 +0800
yalin wang <yalin.wang2010@xxxxxxxxx> wrote:

	TP_fast_assign(
		__entry->mm = mm;
-		__entry->pfn = pfn;
+		__entry->pfn = page_to_pfn(page);

Instead of the condition, we could have:

	__entry->pfn = page ? page_to_pfn(page) : -1;

I agree. Please do it like this.

hmm, pfn is defined as an unsigned long, would -1 be the best.
Or should it be (-1UL).

Then we could also have:

        TP_printk("mm=%p, scan_pfn=0x%lx%s, writable=%d, referenced=%d, none_or_zero=%d, status=%s, unmapped=%d",
                __entry->mm,
                __entry->pfn == (-1UL) ? 0 : __entry->pfn,
		__entry->pfn == (-1UL) ? "(null)" : "",

Note the added %s after %lx I have in the print format.

-- Steve
it is not easy to print for perf tools in userspace ,
if you use this format ,
for user space perf tool, it print the entry by look up the member in entry struct by offset ,
you print a dynamic string which user space perf tool don’t know how to print this string .

Does it work through trace-cmd?

Thanks


--
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>



[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]