diff options
author | Dave Chinner <dchinner@redhat.com> | 2011-07-08 00:14:34 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2011-07-20 01:44:27 -0400 |
commit | 095760730c1047c69159ce88021a7fa3833502c8 (patch) | |
tree | 7cee34087a3e0d3d14691075b0ea614846c87d7c /mm/vmscan.c | |
parent | a9049376ee05bf966bfe2b081b5071326856890a (diff) |
vmscan: add shrink_slab tracepoints
It is impossible to understand what the shrinkers are actually doing
without instrumenting the code, so add a some tracepoints to allow
insight to be gained.
Signed-off-by: Dave Chinner <dchinner@redhat.com>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'mm/vmscan.c')
-rw-r--r-- | mm/vmscan.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/mm/vmscan.c b/mm/vmscan.c index d036e59d302b..255226554a3d 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c | |||
@@ -250,6 +250,7 @@ unsigned long shrink_slab(struct shrink_control *shrink, | |||
250 | unsigned long long delta; | 250 | unsigned long long delta; |
251 | unsigned long total_scan; | 251 | unsigned long total_scan; |
252 | unsigned long max_pass; | 252 | unsigned long max_pass; |
253 | int shrink_ret = 0; | ||
253 | 254 | ||
254 | max_pass = do_shrinker_shrink(shrinker, shrink, 0); | 255 | max_pass = do_shrinker_shrink(shrinker, shrink, 0); |
255 | delta = (4 * nr_pages_scanned) / shrinker->seeks; | 256 | delta = (4 * nr_pages_scanned) / shrinker->seeks; |
@@ -274,9 +275,12 @@ unsigned long shrink_slab(struct shrink_control *shrink, | |||
274 | total_scan = shrinker->nr; | 275 | total_scan = shrinker->nr; |
275 | shrinker->nr = 0; | 276 | shrinker->nr = 0; |
276 | 277 | ||
278 | trace_mm_shrink_slab_start(shrinker, shrink, total_scan, | ||
279 | nr_pages_scanned, lru_pages, | ||
280 | max_pass, delta, total_scan); | ||
281 | |||
277 | while (total_scan >= SHRINK_BATCH) { | 282 | while (total_scan >= SHRINK_BATCH) { |
278 | long this_scan = SHRINK_BATCH; | 283 | long this_scan = SHRINK_BATCH; |
279 | int shrink_ret; | ||
280 | int nr_before; | 284 | int nr_before; |
281 | 285 | ||
282 | nr_before = do_shrinker_shrink(shrinker, shrink, 0); | 286 | nr_before = do_shrinker_shrink(shrinker, shrink, 0); |
@@ -293,6 +297,8 @@ unsigned long shrink_slab(struct shrink_control *shrink, | |||
293 | } | 297 | } |
294 | 298 | ||
295 | shrinker->nr += total_scan; | 299 | shrinker->nr += total_scan; |
300 | trace_mm_shrink_slab_end(shrinker, shrink_ret, total_scan, | ||
301 | shrinker->nr); | ||
296 | } | 302 | } |
297 | up_read(&shrinker_rwsem); | 303 | up_read(&shrinker_rwsem); |
298 | out: | 304 | out: |