mm: shrinker: add nid to tracepoint output
authorDave Hansen <dave.hansen@linux.intel.com>
Wed, 4 Jun 2014 23:08:07 +0000 (16:08 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Wed, 4 Jun 2014 23:54:04 +0000 (16:54 -0700)
Now that we are doing NUMA-aware shrinking, and can have shrinkers
running in parallel, or working on individual nodes, it seems like we
should also be sticking the node in the output.

Signed-off-by: Dave Hansen <dave.hansen@linux.intel.com>
Acked-by: Dave Chinner <david@fromorbit.com>
Cc: Konstantin Khlebnikov <khlebnikov@openvz.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
include/trace/events/vmscan.h
mm/vmscan.c

index 1dd5e773114c01d37899755b047bce8724e466d6..69590b6ffc091116911b29dffbb64871bd9f92b1 100644 (file)
@@ -191,6 +191,7 @@ TRACE_EVENT(mm_shrink_slab_start,
        TP_STRUCT__entry(
                __field(struct shrinker *, shr)
                __field(void *, shrink)
+               __field(int, nid)
                __field(long, nr_objects_to_shrink)
                __field(gfp_t, gfp_flags)
                __field(unsigned long, pgs_scanned)
@@ -203,6 +204,7 @@ TRACE_EVENT(mm_shrink_slab_start,
        TP_fast_assign(
                __entry->shr = shr;
                __entry->shrink = shr->scan_objects;
+               __entry->nid = sc->nid;
                __entry->nr_objects_to_shrink = nr_objects_to_shrink;
                __entry->gfp_flags = sc->gfp_mask;
                __entry->pgs_scanned = pgs_scanned;
@@ -212,9 +214,10 @@ TRACE_EVENT(mm_shrink_slab_start,
                __entry->total_scan = total_scan;
        ),
 
-       TP_printk("%pF %p: objects to shrink %ld gfp_flags %s pgs_scanned %ld lru_pgs %ld cache items %ld delta %lld total_scan %ld",
+       TP_printk("%pF %p: nid: %d objects to shrink %ld gfp_flags %s pgs_scanned %ld lru_pgs %ld cache items %ld delta %lld total_scan %ld",
                __entry->shrink,
                __entry->shr,
+               __entry->nid,
                __entry->nr_objects_to_shrink,
                show_gfp_flags(__entry->gfp_flags),
                __entry->pgs_scanned,
@@ -225,13 +228,15 @@ TRACE_EVENT(mm_shrink_slab_start,
 );
 
 TRACE_EVENT(mm_shrink_slab_end,
-       TP_PROTO(struct shrinker *shr, int shrinker_retval,
+       TP_PROTO(struct shrinker *shr, int nid, int shrinker_retval,
                long unused_scan_cnt, long new_scan_cnt, long total_scan),
 
-       TP_ARGS(shr, shrinker_retval, unused_scan_cnt, new_scan_cnt, total_scan),
+       TP_ARGS(shr, nid, shrinker_retval, unused_scan_cnt, new_scan_cnt,
+               total_scan),
 
        TP_STRUCT__entry(
                __field(struct shrinker *, shr)
+               __field(int, nid)
                __field(void *, shrink)
                __field(long, unused_scan)
                __field(long, new_scan)
@@ -241,6 +246,7 @@ TRACE_EVENT(mm_shrink_slab_end,
 
        TP_fast_assign(
                __entry->shr = shr;
+               __entry->nid = nid;
                __entry->shrink = shr->scan_objects;
                __entry->unused_scan = unused_scan_cnt;
                __entry->new_scan = new_scan_cnt;
@@ -248,9 +254,10 @@ TRACE_EVENT(mm_shrink_slab_end,
                __entry->total_scan = total_scan;
        ),
 
-       TP_printk("%pF %p: unused scan count %ld new scan count %ld total_scan %ld last shrinker return val %d",
+       TP_printk("%pF %p: nid: %d unused scan count %ld new scan count %ld total_scan %ld last shrinker return val %d",
                __entry->shrink,
                __entry->shr,
+               __entry->nid,
                __entry->unused_scan,
                __entry->new_scan,
                __entry->total_scan,
index 15e93158bd0b78926f6f227d926c553f69da9a60..9253e188000f1e23a670fab1000d8113a8469411 100644 (file)
@@ -324,7 +324,7 @@ shrink_slab_node(struct shrink_control *shrinkctl, struct shrinker *shrinker,
        else
                new_nr = atomic_long_read(&shrinker->nr_deferred[nid]);
 
-       trace_mm_shrink_slab_end(shrinker, freed, nr, new_nr, total_scan);
+       trace_mm_shrink_slab_end(shrinker, nid, freed, nr, new_nr, total_scan);
        return freed;
 }