linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: akpm@linux-foundation.org
Cc: aneesh.kumar@linux.ibm.com, carmenjackson@google.com,
	dan.j.williams@intel.com, dancol@google.com, jglisse@redhat.com,
	joel@joelfernandes.org, linux-mm@kvack.org,
	mayankgupta@google.com, mhocko@suse.com, minchan@kernel.org,
	mm-commits@vger.kernel.org, rcampbell@nvidia.com,
	timmurray@google.com, torvalds@linux-foundation.org,
	vbabka@suse.cz, willy@infradead.org
Subject: Re: [patch 026/158] mm: emit tracepoint when RSS changes
Date: Mon, 2 Dec 2019 12:14:15 -0500	[thread overview]
Message-ID: <20191202121415.1e64a461@gandalf.local.home> (raw)
In-Reply-To: <20191201015030.MR-ux4mV1%akpm@linux-foundation.org>

On Sat, 30 Nov 2019 17:50:30 -0800
akpm@linux-foundation.org wrote:

>  /* Optimized variant when page is already known not to be PageAnon */
> --- a/include/trace/events/kmem.h~mm-emit-tracepoint-when-rss-changes
> +++ a/include/trace/events/kmem.h
> @@ -316,6 +316,27 @@ TRACE_EVENT(mm_page_alloc_extfrag,
>  		__entry->change_ownership)
>  );
>  
> +TRACE_EVENT(rss_stat,
> +
> +	TP_PROTO(int member,
> +		long count),
> +
> +	TP_ARGS(member, count),
> +
> +	TP_STRUCT__entry(
> +		__field(int, member)
> +		__field(long, size)
> +	),
> +
> +	TP_fast_assign(
> +		__entry->member = member;
> +		__entry->size = (count << PAGE_SHIFT);

It's best to put all calculations (including shifts) in the print part,
as that's the slow path. The TP_fast_assign() is done when the trace
point is triggered (during the execution of the code). It's best to
keep this in the slow path (TP_printk).

		__entry->count = count;

> +	),
> +
> +	TP_printk("member=%d size=%ldB",
> +		__entry->member,
> +		__entry->size)

		__entry->count << PAGE_SHIFT)

-- Steve


> +	);
>  #endif /* _TRACE_KMEM_H */
>  
>  /* This part must be outside protection */
> --- a/mm/memory.c~mm-emit-tracepoint-when-rss-changes


  reply	other threads:[~2019-12-02 17:14 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-01  1:50 akpm
2019-12-02 17:14 ` Steven Rostedt [this message]
2019-12-02 21:13   ` Joel Fernandes
2019-12-02 21:56     ` Steven Rostedt
2019-12-02 23:45       ` Joel Fernandes
2019-12-02 23:53         ` Steven Rostedt
2019-12-03  2:48           ` Primiano Tucci
2019-12-03  5:38             ` Mathieu Desnoyers
2019-12-03 10:44               ` Primiano Tucci
2019-12-03 15:58                 ` Steven Rostedt
2019-12-04  4:08                   ` Joel Fernandes
2019-12-03 14:53             ` Steven Rostedt

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=20191202121415.1e64a461@gandalf.local.home \
    --to=rostedt@goodmis.org \
    --cc=akpm@linux-foundation.org \
    --cc=aneesh.kumar@linux.ibm.com \
    --cc=carmenjackson@google.com \
    --cc=dan.j.williams@intel.com \
    --cc=dancol@google.com \
    --cc=jglisse@redhat.com \
    --cc=joel@joelfernandes.org \
    --cc=linux-mm@kvack.org \
    --cc=mayankgupta@google.com \
    --cc=mhocko@suse.com \
    --cc=minchan@kernel.org \
    --cc=mm-commits@vger.kernel.org \
    --cc=rcampbell@nvidia.com \
    --cc=timmurray@google.com \
    --cc=torvalds@linux-foundation.org \
    --cc=vbabka@suse.cz \
    --cc=willy@infradead.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox