diff options
author | Dave Hansen <dave.hansen@linux.intel.com> | 2014-06-04 19:08:06 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2014-06-04 19:54:04 -0400 |
commit | 7fe7047597cf5ebb300802494db4f407327ec94f (patch) | |
tree | b96d8e2c1d247192b2f6dd5922b2242fea9229ce /include/trace | |
parent | cc6b664aa26de93d9a3f99d4021a8d88b434ed06 (diff) |
mm: shrinker trace points: fix negatives
I was looking at a trace of the slab shrinkers (attachment in this comment):
https://bugs.freedesktop.org/show_bug.cgi?id=72742#c67
and noticed that "total_scan" can go negative in some cases. We
used to dump out the "total_scan" variable directly, but some of
the shrinker modifications along the way changed that.
This patch just dumps it out directly, again. It doesn't make
any sense to derive it from new_nr and nr any more since there
are now other shrinkers that can be running in parallel and
mucking with those values.
Here's an example of the negative numbers in the output:
> kswapd0-840 [000] 160.869398: mm_shrink_slab_end: i915_gem_inactive_scan+0x0 0xffff8800037cbc68: unused scan count 10 new scan count 39 total_scan 29 last shrinker return val 256
> kswapd0-840 [000] 160.869618: mm_shrink_slab_end: i915_gem_inactive_scan+0x0 0xffff8800037cbc68: unused scan count 39 new scan count 102 total_scan 63 last shrinker return val 256
> kswapd0-840 [000] 160.870031: mm_shrink_slab_end: i915_gem_inactive_scan+0x0 0xffff8800037cbc68: unused scan count 102 new scan count 47 total_scan -55 last shrinker return val 768
> kswapd0-840 [000] 160.870464: mm_shrink_slab_end: i915_gem_inactive_scan+0x0 0xffff8800037cbc68: unused scan count 47 new scan count 45 total_scan -2 last shrinker return val 768
> kswapd0-840 [000] 163.384144: mm_shrink_slab_end: i915_gem_inactive_scan+0x0 0xffff8800037cbc68: unused scan count 45 new scan count 56 total_scan 11 last shrinker return val 0
> kswapd0-840 [000] 163.384297: mm_shrink_slab_end: i915_gem_inactive_scan+0x0 0xffff8800037cbc68: unused scan count 56 new scan count 15 total_scan -41 last shrinker return val 256
> kswapd0-840 [000] 163.384414: mm_shrink_slab_end: i915_gem_inactive_scan+0x0 0xffff8800037cbc68: unused scan count 15 new scan count 117 total_scan 102 last shrinker return val 0
> kswapd0-840 [000] 163.384657: mm_shrink_slab_end: i915_gem_inactive_scan+0x0 0xffff8800037cbc68: unused scan count 117 new scan count 36 total_scan -81 last shrinker return val 512
> kswapd0-840 [000] 163.384880: mm_shrink_slab_end: i915_gem_inactive_scan+0x0 0xffff8800037cbc68: unused scan count 36 new scan count 111 total_scan 75 last shrinker return val 256
> kswapd0-840 [000] 163.385256: mm_shrink_slab_end: i915_gem_inactive_scan+0x0 0xffff8800037cbc68: unused scan count 111 new scan count 34 total_scan -77 last shrinker return val 768
> kswapd0-840 [000] 163.385598: mm_shrink_slab_end: i915_gem_inactive_scan+0x0 0xffff8800037cbc68: unused scan count 34 new scan count 122 total_scan 88 last shrinker return val 512
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>
Diffstat (limited to 'include/trace')
-rw-r--r-- | include/trace/events/vmscan.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/include/trace/events/vmscan.h b/include/trace/events/vmscan.h index 132a985aba8b..1dd5e773114c 100644 --- a/include/trace/events/vmscan.h +++ b/include/trace/events/vmscan.h | |||
@@ -226,9 +226,9 @@ TRACE_EVENT(mm_shrink_slab_start, | |||
226 | 226 | ||
227 | TRACE_EVENT(mm_shrink_slab_end, | 227 | TRACE_EVENT(mm_shrink_slab_end, |
228 | TP_PROTO(struct shrinker *shr, int shrinker_retval, | 228 | TP_PROTO(struct shrinker *shr, int shrinker_retval, |
229 | long unused_scan_cnt, long new_scan_cnt), | 229 | long unused_scan_cnt, long new_scan_cnt, long total_scan), |
230 | 230 | ||
231 | TP_ARGS(shr, shrinker_retval, unused_scan_cnt, new_scan_cnt), | 231 | TP_ARGS(shr, shrinker_retval, unused_scan_cnt, new_scan_cnt, total_scan), |
232 | 232 | ||
233 | TP_STRUCT__entry( | 233 | TP_STRUCT__entry( |
234 | __field(struct shrinker *, shr) | 234 | __field(struct shrinker *, shr) |
@@ -245,7 +245,7 @@ TRACE_EVENT(mm_shrink_slab_end, | |||
245 | __entry->unused_scan = unused_scan_cnt; | 245 | __entry->unused_scan = unused_scan_cnt; |
246 | __entry->new_scan = new_scan_cnt; | 246 | __entry->new_scan = new_scan_cnt; |
247 | __entry->retval = shrinker_retval; | 247 | __entry->retval = shrinker_retval; |
248 | __entry->total_scan = new_scan_cnt - unused_scan_cnt; | 248 | __entry->total_scan = total_scan; |
249 | ), | 249 | ), |
250 | 250 | ||
251 | TP_printk("%pF %p: unused scan count %ld new scan count %ld total_scan %ld last shrinker return val %d", | 251 | TP_printk("%pF %p: unused scan count %ld new scan count %ld total_scan %ld last shrinker return val %d", |