From mboxrd@z Thu Jan 1 00:00:00 1970 From: Wu Fengguang Subject: [PATCH 24/27] writeback: trace global_dirty_state Date: Thu, 03 Mar 2011 14:45:29 +0800 Message-ID: <20110303074951.840216412@intel.com> References: <20110303064505.718671603@intel.com> Cc: Jan Kara , Wu Fengguang To: Andrew Morton Return-path: CC: Christoph Hellwig CC: Trond Myklebust CC: Dave Chinner CC: Theodore Ts'o CC: Chris Mason CC: Peter Zijlstra CC: Mel Gorman CC: Rik van Riel CC: KOSAKI Motohiro CC: Greg Thelen CC: Minchan Kim CC: Vivek Goyal CC: Andrea Righi CC: Balbir Singh Cc: linux-mm Cc: Cc: LKML Content-Disposition: inline; filename=writeback-trace-global-dirty-states.patch Sender: owner-linux-mm@kvack.org List-Id: linux-fsdevel.vger.kernel.org Add trace balance_dirty_state for showing the global dirty page counts and thresholds at each balance_dirty_pages() loop. Signed-off-by: Wu Fengguang --- include/trace/events/writeback.h | 48 +++++++++++++++++++++++++++++ mm/page-writeback.c | 1 2 files changed, 49 insertions(+) --- linux-next.orig/mm/page-writeback.c 2011-03-03 14:02:58.000000000 +0800 +++ linux-next/mm/page-writeback.c 2011-03-03 14:03:24.000000000 +0800 @@ -386,6 +386,7 @@ void global_dirty_limits(unsigned long * tsk = current; *pbackground = background; *pdirty = dirty; + trace_global_dirty_state(background, dirty); } EXPORT_SYMBOL_GPL(global_dirty_limits); --- linux-next.orig/include/trace/events/writeback.h 2011-03-03 14:02:58.000000000 +0800 +++ linux-next/include/trace/events/writeback.h 2011-03-03 14:03:24.000000000 +0800 @@ -287,6 +287,54 @@ TRACE_EVENT(balance_dirty_pages, ) ); +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) + __field(unsigned long, poll_thresh) + __field(unsigned long, nr_dirtied) + __field(unsigned long, nr_written) + ), + + 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->nr_dirtied = global_page_state(NR_DIRTIED); + __entry->nr_written = global_page_state(NR_WRITTEN); + __entry->background_thresh = background_thresh; + __entry->dirty_thresh = dirty_thresh; + __entry->poll_thresh = current->nr_dirtied_pause; + ), + + TP_printk("dirty=%lu writeback=%lu unstable=%lu " + "bg_thresh=%lu thresh=%lu gap=%ld poll=%ld " + "dirtied=%lu written=%lu", + __entry->nr_dirty, + __entry->nr_writeback, + __entry->nr_unstable, + __entry->background_thresh, + __entry->dirty_thresh, + __entry->dirty_thresh - __entry->nr_dirty - + __entry->nr_writeback - __entry->nr_unstable, + __entry->poll_thresh, + __entry->nr_dirtied, + __entry->nr_written + ) +); + 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: email@kvack.org