All of lore.kernel.org
 help / color / mirror / Atom feed
From: Vlastimil Babka <vbabka@suse.cz>
To: yalin wang <yalin.wang2010@gmail.com>,
	Steven Rostedt <rostedt@goodmis.org>
Cc: Ingo Molnar <mingo@redhat.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Ebru Akagunduz <ebru.akagunduz@gmail.com>,
	Rik van Riel <riel@redhat.com>,
	"Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>,
	jmarchan@redhat.com, mgorman@techsingularity.net,
	willy@linux.intel.com,
	linux-kernel <linux-kernel@vger.kernel.org>,
	linux-mm@kvack.org
Subject: Re: [PATCH V4] mm: fix kernel crash in khugepaged thread
Date: Tue, 17 Nov 2015 08:43:45 +0100	[thread overview]
Message-ID: <564ADAB1.9030500@suse.cz> (raw)
In-Reply-To: <8582F660-B54A-474B-960E-CD5D0FF6428F@gmail.com>

On 17.11.2015 4:58, yalin wang wrote:
> 
>> On Nov 17, 2015, at 10:43, Steven Rostedt <rostedt@goodmis.org> wrote:
>>
>> On Tue, 17 Nov 2015 10:21:47 +0800
>> yalin wang <yalin.wang2010@gmail.com> wrote:
>>
>>
>>
>> Because the print_fmt has nothing to do with the fields. You can have
>> as your print_fmt as:
>>
>> 	TP_printk("Message = %s", "hello dolly!")
>>
>> And both userspace and the kernel with process that correctly (if I got
>> string processing working in userspace, which I believe I do). The
>> string is processed, it's not dependent on TP_STRUCT__entry() unless it
>> references a field there. Which can also be used too:
>>
>> 	TP_printk("Message = %s", __entry->musical ? "Hello dolly!" :
>> 			"Death Trap!")
>>
>> userspace will see in the entry:
>>
>> print_fmt: "Message = %s", REC->musical ? "Hello dolly!" : "Death Trap!"
>>
>> as long as the field "musical" exists, all is well.
>>
>> -- Steve
> Aha,  i see.
> Thanks very much for your explanation.
> Better print fat is :   
> TP_printk("mm=%p, scan_pfn=%s, writable=%d, referenced=%d, none_or_zero=%d, status=%s, unmapped=%d",
>                __entry->mm,
> 		__entry->pfn == (-1UL) ? "(null)" :  itoa(buff,  __entry->pin, 10), …..)
> 
> is this possible ?

I doubt so.

Why don't we just do (with %lx):
 __entry->pfn != -1UL ? __entry->pfn : 0,

Status already tells us that it's not a real pfn 0 (which I doubt would be
userspace-mapped and thus reachable by khugepaged anyway?).
Also it's what some other tracepoints do, see e.g. mm_page class in
include/trace/events/kmem.h.

> Thanks
> 
> 
> 
> 
> 
> 
> 
> 


WARNING: multiple messages have this Message-ID (diff)
From: Vlastimil Babka <vbabka@suse.cz>
To: yalin wang <yalin.wang2010@gmail.com>,
	Steven Rostedt <rostedt@goodmis.org>
Cc: Ingo Molnar <mingo@redhat.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Ebru Akagunduz <ebru.akagunduz@gmail.com>,
	Rik van Riel <riel@redhat.com>,
	"Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>,
	jmarchan@redhat.com, mgorman@techsingularity.net,
	willy@linux.intel.com,
	linux-kernel <linux-kernel@vger.kernel.org>,
	linux-mm@kvack.org
Subject: Re: [PATCH V4] mm: fix kernel crash in khugepaged thread
Date: Tue, 17 Nov 2015 08:43:45 +0100	[thread overview]
Message-ID: <564ADAB1.9030500@suse.cz> (raw)
In-Reply-To: <8582F660-B54A-474B-960E-CD5D0FF6428F@gmail.com>

On 17.11.2015 4:58, yalin wang wrote:
> 
>> On Nov 17, 2015, at 10:43, Steven Rostedt <rostedt@goodmis.org> wrote:
>>
>> On Tue, 17 Nov 2015 10:21:47 +0800
>> yalin wang <yalin.wang2010@gmail.com> wrote:
>>
>>
>>
>> Because the print_fmt has nothing to do with the fields. You can have
>> as your print_fmt as:
>>
>> 	TP_printk("Message = %s", "hello dolly!")
>>
>> And both userspace and the kernel with process that correctly (if I got
>> string processing working in userspace, which I believe I do). The
>> string is processed, it's not dependent on TP_STRUCT__entry() unless it
>> references a field there. Which can also be used too:
>>
>> 	TP_printk("Message = %s", __entry->musical ? "Hello dolly!" :
>> 			"Death Trap!")
>>
>> userspace will see in the entry:
>>
>> print_fmt: "Message = %s", REC->musical ? "Hello dolly!" : "Death Trap!"
>>
>> as long as the field "musical" exists, all is well.
>>
>> -- Steve
> Aha,  i see.
> Thanks very much for your explanation.
> Better print fat is :   
> TP_printk("mm=%p, scan_pfn=%s, writable=%d, referenced=%d, none_or_zero=%d, status=%s, unmapped=%d",
>                __entry->mm,
> 		__entry->pfn == (-1UL) ? "(null)" :  itoa(buff,  __entry->pin, 10), a?|..)
> 
> is this possible ?

I doubt so.

Why don't we just do (with %lx):
 __entry->pfn != -1UL ? __entry->pfn : 0,

Status already tells us that it's not a real pfn 0 (which I doubt would be
userspace-mapped and thus reachable by khugepaged anyway?).
Also it's what some other tracepoints do, see e.g. mm_page class in
include/trace/events/kmem.h.

> Thanks
> 
> 
> 
> 
> 
> 
> 
> 

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

  reply	other threads:[~2015-11-17  7:43 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-12  8:21 [PATCH V4] mm: fix kernel crash in khugepaged thread yalin wang
2015-11-12  8:21 ` yalin wang
2015-11-12 14:29 ` Steven Rostedt
2015-11-12 14:29   ` Steven Rostedt
2015-11-13 10:47   ` Vlastimil Babka
2015-11-13 10:47     ` Vlastimil Babka
2015-11-13 11:54     ` yalin wang
2015-11-13 11:54       ` yalin wang
2015-11-13 14:01       ` Steven Rostedt
2015-11-13 14:01         ` Steven Rostedt
2015-11-16  1:35         ` yalin wang
2015-11-16  1:35           ` yalin wang
2015-11-16 10:16           ` Vlastimil Babka
2015-11-16 10:16             ` Vlastimil Babka
2015-11-16 14:25             ` Steven Rostedt
2015-11-16 14:25               ` Steven Rostedt
2015-11-17  2:21               ` yalin wang
2015-11-17  2:21                 ` yalin wang
2015-11-17  2:43                 ` Steven Rostedt
2015-11-17  2:43                   ` Steven Rostedt
2015-11-17  3:58                   ` yalin wang
2015-11-17  3:58                     ` yalin wang
2015-11-17  7:43                     ` Vlastimil Babka [this message]
2015-11-17  7:43                       ` Vlastimil Babka
2015-11-16 14:22           ` Steven Rostedt
2015-11-16 14:22             ` Steven Rostedt
2015-11-13  8:41 Hillf Danton
2015-11-13  8:41 ` Hillf Danton
2015-11-13 10:24 ` yalin wang
2015-11-13 10:24   ` yalin wang

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=564ADAB1.9030500@suse.cz \
    --to=vbabka@suse.cz \
    --cc=akpm@linux-foundation.org \
    --cc=ebru.akagunduz@gmail.com \
    --cc=jmarchan@redhat.com \
    --cc=kirill.shutemov@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mgorman@techsingularity.net \
    --cc=mingo@redhat.com \
    --cc=riel@redhat.com \
    --cc=rostedt@goodmis.org \
    --cc=willy@linux.intel.com \
    --cc=yalin.wang2010@gmail.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.