linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] writeback: trace global_dirty_state
@ 2011-06-10 14:48 Wu Fengguang
  2011-06-13 14:33 ` Jan Kara
  0 siblings, 1 reply; 3+ messages in thread
From: Wu Fengguang @ 2011-06-10 14:48 UTC (permalink / raw)
  To: Andrew Morton
  Cc: Jan Kara, Dave Chinner, Christoph Hellwig,
	Linux Memory Management List, linux-fsdevel, LKML

[It seems beneficial to queue this simple trace event for
 next/upstream after the review?]

Add trace event balance_dirty_state for showing the global dirty page
counts and thresholds at each global_dirty_limits() invocation.  This
will cover the callers throttle_vm_writeout(), over_bground_thresh()
and each balance_dirty_pages() loop.

Signed-off-by: Wu Fengguang <fengguang.wu@intel.com>
---
 include/trace/events/writeback.h |   36 +++++++++++++++++++++++++++++
 mm/page-writeback.c              |    1 
 2 files changed, 37 insertions(+)

--- linux-next.orig/mm/page-writeback.c	2011-06-10 21:52:34.000000000 +0800
+++ linux-next/mm/page-writeback.c	2011-06-10 22:08:26.000000000 +0800
@@ -430,6 +430,7 @@ void global_dirty_limits(unsigned long *
 	}
 	*pbackground = background;
 	*pdirty = dirty;
+	trace_global_dirty_state(background, dirty);
 }
 
 /**
--- linux-next.orig/include/trace/events/writeback.h	2011-06-10 21:52:34.000000000 +0800
+++ linux-next/include/trace/events/writeback.h	2011-06-10 22:25:33.000000000 +0800
@@ -187,6 +187,42 @@ TRACE_EVENT(writeback_queue_io,
 		__entry->moved)
 );
 
+TRACE_EVENT(global_dirty_state,
+
+	TP_PROTO(unsigned long background_thresh,
+		 unsigned long dirty_thresh
+	),
+
+	TP_ARGS(background_thresh,
+		dirty_thresh
+	),
+
+	TP_STRUCT__entry(
+		__field(unsigned long,	nr_dirty)
+		__field(unsigned long,	nr_writeback)
+		__field(unsigned long,	nr_unstable)
+		__field(unsigned long,	background_thresh)
+		__field(unsigned long,	dirty_thresh)
+	),
+
+	TP_fast_assign(
+		__entry->nr_dirty	= global_page_state(NR_FILE_DIRTY);
+		__entry->nr_writeback	= global_page_state(NR_WRITEBACK);
+		__entry->nr_unstable	= global_page_state(NR_UNSTABLE_NFS);
+		__entry->background_thresh = background_thresh;
+		__entry->dirty_thresh	= dirty_thresh;
+	),
+
+	TP_printk("dirty=%lu writeback=%lu unstable=%lu "
+		  "bg_thresh=%lu thresh=%lu",
+		  __entry->nr_dirty,
+		  __entry->nr_writeback,
+		  __entry->nr_unstable,
+		  __entry->background_thresh,
+		  __entry->dirty_thresh
+	)
+);
+
 DECLARE_EVENT_CLASS(writeback_congest_waited_template,
 
 	TP_PROTO(unsigned int usec_timeout, unsigned int usec_delayed),

--
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/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] writeback: trace global_dirty_state
  2011-06-10 14:48 [PATCH] writeback: trace global_dirty_state Wu Fengguang
@ 2011-06-13 14:33 ` Jan Kara
  2011-06-14 13:46   ` Wu Fengguang
  0 siblings, 1 reply; 3+ messages in thread
From: Jan Kara @ 2011-06-13 14:33 UTC (permalink / raw)
  To: Wu Fengguang
  Cc: Andrew Morton, Jan Kara, Dave Chinner, Christoph Hellwig,
	Linux Memory Management List, linux-fsdevel, LKML

On Fri 10-06-11 22:48:05, Wu Fengguang wrote:
> [It seems beneficial to queue this simple trace event for
>  next/upstream after the review?]
> 
> Add trace event balance_dirty_state for showing the global dirty page
> counts and thresholds at each global_dirty_limits() invocation.  This
> will cover the callers throttle_vm_writeout(), over_bground_thresh()
> and each balance_dirty_pages() loop.
  OK, this might be useful. But shouldn't we also add similar trace point
for bdi limits? Otherwise the information is of limited use...

								Honza
> 
> Signed-off-by: Wu Fengguang <fengguang.wu@intel.com>
> ---
>  include/trace/events/writeback.h |   36 +++++++++++++++++++++++++++++
>  mm/page-writeback.c              |    1 
>  2 files changed, 37 insertions(+)
> 
> --- linux-next.orig/mm/page-writeback.c	2011-06-10 21:52:34.000000000 +0800
> +++ linux-next/mm/page-writeback.c	2011-06-10 22:08:26.000000000 +0800
> @@ -430,6 +430,7 @@ void global_dirty_limits(unsigned long *
>  	}
>  	*pbackground = background;
>  	*pdirty = dirty;
> +	trace_global_dirty_state(background, dirty);
>  }
>  
>  /**
> --- linux-next.orig/include/trace/events/writeback.h	2011-06-10 21:52:34.000000000 +0800
> +++ linux-next/include/trace/events/writeback.h	2011-06-10 22:25:33.000000000 +0800
> @@ -187,6 +187,42 @@ TRACE_EVENT(writeback_queue_io,
>  		__entry->moved)
>  );
>  
> +TRACE_EVENT(global_dirty_state,
> +
> +	TP_PROTO(unsigned long background_thresh,
> +		 unsigned long dirty_thresh
> +	),
> +
> +	TP_ARGS(background_thresh,
> +		dirty_thresh
> +	),
> +
> +	TP_STRUCT__entry(
> +		__field(unsigned long,	nr_dirty)
> +		__field(unsigned long,	nr_writeback)
> +		__field(unsigned long,	nr_unstable)
> +		__field(unsigned long,	background_thresh)
> +		__field(unsigned long,	dirty_thresh)
> +	),
> +
> +	TP_fast_assign(
> +		__entry->nr_dirty	= global_page_state(NR_FILE_DIRTY);
> +		__entry->nr_writeback	= global_page_state(NR_WRITEBACK);
> +		__entry->nr_unstable	= global_page_state(NR_UNSTABLE_NFS);
> +		__entry->background_thresh = background_thresh;
> +		__entry->dirty_thresh	= dirty_thresh;
> +	),
> +
> +	TP_printk("dirty=%lu writeback=%lu unstable=%lu "
> +		  "bg_thresh=%lu thresh=%lu",
> +		  __entry->nr_dirty,
> +		  __entry->nr_writeback,
> +		  __entry->nr_unstable,
> +		  __entry->background_thresh,
> +		  __entry->dirty_thresh
> +	)
> +);
> +
>  DECLARE_EVENT_CLASS(writeback_congest_waited_template,
>  
>  	TP_PROTO(unsigned int usec_timeout, unsigned int usec_delayed),
-- 
Jan Kara <jack@suse.cz>
SUSE Labs, CR

--
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/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] writeback: trace global_dirty_state
  2011-06-13 14:33 ` Jan Kara
@ 2011-06-14 13:46   ` Wu Fengguang
  0 siblings, 0 replies; 3+ messages in thread
From: Wu Fengguang @ 2011-06-14 13:46 UTC (permalink / raw)
  To: Jan Kara
  Cc: Andrew Morton, Dave Chinner, Christoph Hellwig,
	Linux Memory Management List, linux-fsdevel@vger.kernel.org, LKML

On Mon, Jun 13, 2011 at 10:33:56PM +0800, Jan Kara wrote:
> On Fri 10-06-11 22:48:05, Wu Fengguang wrote:
> > [It seems beneficial to queue this simple trace event for
> >  next/upstream after the review?]
> > 
> > Add trace event balance_dirty_state for showing the global dirty page
> > counts and thresholds at each global_dirty_limits() invocation.  This
> > will cover the callers throttle_vm_writeout(), over_bground_thresh()
> > and each balance_dirty_pages() loop.
>   OK, this might be useful. But shouldn't we also add similar trace point
> for bdi limits? Otherwise the information is of limited use...

Good point. The bdi limits will be exported in another
balance_dirty_pages trace point.

Thanks,
Fengguang

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2011-06-14 13:47 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-06-10 14:48 [PATCH] writeback: trace global_dirty_state Wu Fengguang
2011-06-13 14:33 ` Jan Kara
2011-06-14 13:46   ` Wu Fengguang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).