All of lore.kernel.org
 help / color / mirror / Atom feed
From: Xie XiuQi <xiexiuqi@huawei.com>
To: Borislav Petkov <bp@suse.de>
Cc: <n-horiguchi@ah.jp.nec.com>, <gong.chen@linux.intel.com>,
	<bhelgaas@google.com>, <tony.luck@intel.com>,
	<rostedt@goodmis.org>, <linux-kernel@vger.kernel.org>,
	<linux-mm@kvack.org>, <jingle.chen@huawei.com>
Subject: Re: [PATCH] tracing: add trace event for memory-failure
Date: Fri, 20 Mar 2015 12:15:46 +0800	[thread overview]
Message-ID: <550B9EF2.7000604@huawei.com> (raw)
In-Reply-To: <20150319103939.GD11544@pd.tnic>

On 2015/3/19 18:39, Borislav Petkov wrote:
> On Thu, Mar 19, 2015 at 11:04:30AM +0800, Xie XiuQi wrote:
>> Memory-failure as the high level machine check handler, it's necessary
>> to report memory page recovery action result to user space by ftrace.
>>
>> This patch add a event at ras group for memory-failure.
>>
>> The output like below:
>> #  tracer: nop
>> # 
>> #  entries-in-buffer/entries-written: 2/2   #P:24
>> # 
>> #                               _-----=> irqs-off
>> #                              / _----=> need-resched
>> #                             | / _---=> hardirq/softirq
>> #                             || / _--=> preempt-depth
>> #                             ||| /     delay
>> #            TASK-PID   CPU#  ||||    TIMESTAMP  FUNCTION
>> #               | |       |   ||||       |         |
>>        mce-inject-13150 [001] ....   277.019359: memory_failure_event: pfn 0x19869: free buddy page recovery: Delayed
>>
>> ---
>> v1->v2:
>>  - Comment update
>>  - Just passing 'result' instead of 'action_name[result]',
>>    suggested by Steve. And hard coded there because trace-cmd
>>    and perf do not have a way to process enums.
>>
>> Cc: Tony Luck <tony.luck@intel.com>
>> Cc: Steven Rostedt <rostedt@goodmis.org>
>> Signed-off-by: Xie XiuQi <xiexiuqi@huawei.com>
>> ---
>>  include/ras/ras_event.h | 38 ++++++++++++++++++++++++++++++++++++++
>>  mm/memory-failure.c     |  3 +++
>>  2 files changed, 41 insertions(+)
>>
>> diff --git a/include/ras/ras_event.h b/include/ras/ras_event.h
>> index 79abb9c..ebb05f3 100644
>> --- a/include/ras/ras_event.h
>> +++ b/include/ras/ras_event.h
>> @@ -232,6 +232,44 @@ TRACE_EVENT(aer_event,
>>  		__print_flags(__entry->status, "|", aer_uncorrectable_errors))
>>  );
>>  
>> +/*
>> + * memory-failure recovery action result event
>> + *
>> + * unsigned long pfn -	Page Number of the corrupted page
>> + * char * action -	Recovery action for various type of pages
>> + * int result	 -	Action result
>> + *
>> + * NOTE: 'action' and 'result' are defined at mm/memory-failure.c
>> + */
>> +TRACE_EVENT(memory_failure_event,
> 
> What is the real reason for adding this TP? Real-life use cases please.
> Add those to the commit message too.
> 
> "Just because" is not a proper justification.

RAS user space tools like rasdaemon which base on trace event, could
receive mce error event, but no memory recovery result event. So, I
want to add this event to make this scenario complete.

I'll add it to commit message, thanks.

> 
>> +	TP_PROTO(const unsigned long pfn,
>> +		 const char *action,
>> +		 const int result),
>> +
>> +	TP_ARGS(pfn, action, result),
>> +
>> +	TP_STRUCT__entry(
>> +		__field(unsigned long, pfn)
>> +		__string(action, action)
>> +		__field(int, result)
>> +	),
>> +
>> +	TP_fast_assign(
>> +		__entry->pfn	= pfn;
>> +		__assign_str(action, action);
>> +		__entry->result	= result;
>> +	),
>> +
>> +	TP_printk("pfn %#lx: %s page recovery: %s",
>> +		__entry->pfn,
>> +		__get_str(action),
>> +		__print_symbolic(__entry->result,
>> +				{0, "Ignored"},
>> +				{1, "Failed"},
>> +				{2, "Delayed"},
>> +				{3, "Recovered"})
> 
> If you're going to do this, please add a comment above it like this:
> 
> /*
>  * Keep those in sync with static const char *action_name[] in
>  * mm/memory-failure.c
>  */

Thanks. I will ;-)

> 
> Thanks.
> 



WARNING: multiple messages have this Message-ID (diff)
From: Xie XiuQi <xiexiuqi@huawei.com>
To: Borislav Petkov <bp@suse.de>
Cc: n-horiguchi@ah.jp.nec.com, gong.chen@linux.intel.com,
	bhelgaas@google.com, tony.luck@intel.com, rostedt@goodmis.org,
	linux-kernel@vger.kernel.org, linux-mm@kvack.org,
	jingle.chen@huawei.com
Subject: Re: [PATCH] tracing: add trace event for memory-failure
Date: Fri, 20 Mar 2015 12:15:46 +0800	[thread overview]
Message-ID: <550B9EF2.7000604@huawei.com> (raw)
In-Reply-To: <20150319103939.GD11544@pd.tnic>

On 2015/3/19 18:39, Borislav Petkov wrote:
> On Thu, Mar 19, 2015 at 11:04:30AM +0800, Xie XiuQi wrote:
>> Memory-failure as the high level machine check handler, it's necessary
>> to report memory page recovery action result to user space by ftrace.
>>
>> This patch add a event at ras group for memory-failure.
>>
>> The output like below:
>> #  tracer: nop
>> # 
>> #  entries-in-buffer/entries-written: 2/2   #P:24
>> # 
>> #                               _-----=> irqs-off
>> #                              / _----=> need-resched
>> #                             | / _---=> hardirq/softirq
>> #                             || / _--=> preempt-depth
>> #                             ||| /     delay
>> #            TASK-PID   CPU#  ||||    TIMESTAMP  FUNCTION
>> #               | |       |   ||||       |         |
>>        mce-inject-13150 [001] ....   277.019359: memory_failure_event: pfn 0x19869: free buddy page recovery: Delayed
>>
>> ---
>> v1->v2:
>>  - Comment update
>>  - Just passing 'result' instead of 'action_name[result]',
>>    suggested by Steve. And hard coded there because trace-cmd
>>    and perf do not have a way to process enums.
>>
>> Cc: Tony Luck <tony.luck@intel.com>
>> Cc: Steven Rostedt <rostedt@goodmis.org>
>> Signed-off-by: Xie XiuQi <xiexiuqi@huawei.com>
>> ---
>>  include/ras/ras_event.h | 38 ++++++++++++++++++++++++++++++++++++++
>>  mm/memory-failure.c     |  3 +++
>>  2 files changed, 41 insertions(+)
>>
>> diff --git a/include/ras/ras_event.h b/include/ras/ras_event.h
>> index 79abb9c..ebb05f3 100644
>> --- a/include/ras/ras_event.h
>> +++ b/include/ras/ras_event.h
>> @@ -232,6 +232,44 @@ TRACE_EVENT(aer_event,
>>  		__print_flags(__entry->status, "|", aer_uncorrectable_errors))
>>  );
>>  
>> +/*
>> + * memory-failure recovery action result event
>> + *
>> + * unsigned long pfn -	Page Number of the corrupted page
>> + * char * action -	Recovery action for various type of pages
>> + * int result	 -	Action result
>> + *
>> + * NOTE: 'action' and 'result' are defined at mm/memory-failure.c
>> + */
>> +TRACE_EVENT(memory_failure_event,
> 
> What is the real reason for adding this TP? Real-life use cases please.
> Add those to the commit message too.
> 
> "Just because" is not a proper justification.

RAS user space tools like rasdaemon which base on trace event, could
receive mce error event, but no memory recovery result event. So, I
want to add this event to make this scenario complete.

I'll add it to commit message, thanks.

> 
>> +	TP_PROTO(const unsigned long pfn,
>> +		 const char *action,
>> +		 const int result),
>> +
>> +	TP_ARGS(pfn, action, result),
>> +
>> +	TP_STRUCT__entry(
>> +		__field(unsigned long, pfn)
>> +		__string(action, action)
>> +		__field(int, result)
>> +	),
>> +
>> +	TP_fast_assign(
>> +		__entry->pfn	= pfn;
>> +		__assign_str(action, action);
>> +		__entry->result	= result;
>> +	),
>> +
>> +	TP_printk("pfn %#lx: %s page recovery: %s",
>> +		__entry->pfn,
>> +		__get_str(action),
>> +		__print_symbolic(__entry->result,
>> +				{0, "Ignored"},
>> +				{1, "Failed"},
>> +				{2, "Delayed"},
>> +				{3, "Recovered"})
> 
> If you're going to do this, please add a comment above it like this:
> 
> /*
>  * Keep those in sync with static const char *action_name[] in
>  * mm/memory-failure.c
>  */

Thanks. I will ;-)

> 
> 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-03-20  4:16 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-19  3:04 [PATCH] tracing: add trace event for memory-failure Xie XiuQi
2015-03-19  3:04 ` Xie XiuQi
2015-03-19  3:22 ` Steven Rostedt
2015-03-19  3:22   ` Steven Rostedt
2015-03-19 10:39 ` Borislav Petkov
2015-03-19 10:39   ` Borislav Petkov
2015-03-20  4:15   ` Xie XiuQi [this message]
2015-03-20  4:15     ` Xie XiuQi
2015-03-20 17:24     ` Luck, Tony
2015-03-20 17:24       ` Luck, Tony
2015-03-21  5:44       ` Xie XiuQi
2015-03-21  5:44         ` Xie XiuQi
  -- strict thread matches above, loose matches on Subject: below --
2015-03-13 10:10 Xie XiuQi
2015-03-13 10:10 ` Xie XiuQi
2015-03-13 16:37 ` Tony Luck
2015-03-13 16:37   ` Tony Luck
2015-03-13 19:32   ` Steven Rostedt
2015-03-13 19:32     ` Steven Rostedt
2015-03-17 10:47     ` Xie XiuQi
2015-03-17 10:47       ` Xie XiuQi
2015-03-18  0:55       ` Steven Rostedt
2015-03-18  0:55         ` Steven Rostedt
2015-03-16  9:27 ` Naoya Horiguchi
2015-03-16  9:27   ` Naoya Horiguchi
2015-03-16 13:04   ` Xie XiuQi
2015-03-16 13:04     ` Xie XiuQi

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=550B9EF2.7000604@huawei.com \
    --to=xiexiuqi@huawei.com \
    --cc=bhelgaas@google.com \
    --cc=bp@suse.de \
    --cc=gong.chen@linux.intel.com \
    --cc=jingle.chen@huawei.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=n-horiguchi@ah.jp.nec.com \
    --cc=rostedt@goodmis.org \
    --cc=tony.luck@intel.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.