aboutsummaryrefslogtreecommitdiffstats
path: root/include/trace/events
diff options
context:
space:
mode:
authorKOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>2011-06-15 18:08:15 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2011-06-15 23:03:59 -0400
commitd7911ef30cb7bec52234c2b7a5c275ac8f07905a (patch)
treec3d9dc8ffc5d9478da434faecc27759ee34edf83 /include/trace/events
parent83cd81a34357a632509f7491eec81e62e71d65f7 (diff)
vmscan: implement swap token priority aging
While testing for memcg aware swap token, I observed a swap token was often grabbed an intermittent running process (eg init, auditd) and they never release a token. Why? Some processes (eg init, auditd, audispd) wake up when a process exiting. And swap token can be get first page-in process when a process exiting makes no swap token owner. Thus such above intermittent running process often get a token. And currently, swap token priority is only decreased at page fault path. Then, if the process sleep immediately after to grab swap token, the swap token priority never be decreased. That's obviously undesirable. This patch implement very poor (and lightweight) priority aging. It only be affect to the above corner case and doesn't change swap tendency workload performance (eg multi process qsbench load) Signed-off-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com> Reviewed-by: Rik van Riel <riel@redhat.com> Reviewed-by: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include/trace/events')
-rw-r--r--include/trace/events/vmscan.h20
1 files changed, 13 insertions, 7 deletions
diff --git a/include/trace/events/vmscan.h b/include/trace/events/vmscan.h
index 1798e0cee2a9..b2c33bd955fa 100644
--- a/include/trace/events/vmscan.h
+++ b/include/trace/events/vmscan.h
@@ -366,9 +366,10 @@ DEFINE_EVENT_CONDITION(put_swap_token_template, disable_swap_token,
366 366
367TRACE_EVENT_CONDITION(update_swap_token_priority, 367TRACE_EVENT_CONDITION(update_swap_token_priority,
368 TP_PROTO(struct mm_struct *mm, 368 TP_PROTO(struct mm_struct *mm,
369 unsigned int old_prio), 369 unsigned int old_prio,
370 struct mm_struct *swap_token_mm),
370 371
371 TP_ARGS(mm, old_prio), 372 TP_ARGS(mm, old_prio, swap_token_mm),
372 373
373 TP_CONDITION(mm->token_priority != old_prio), 374 TP_CONDITION(mm->token_priority != old_prio),
374 375
@@ -376,16 +377,21 @@ TRACE_EVENT_CONDITION(update_swap_token_priority,
376 __field(struct mm_struct*, mm) 377 __field(struct mm_struct*, mm)
377 __field(unsigned int, old_prio) 378 __field(unsigned int, old_prio)
378 __field(unsigned int, new_prio) 379 __field(unsigned int, new_prio)
380 __field(struct mm_struct*, swap_token_mm)
381 __field(unsigned int, swap_token_prio)
379 ), 382 ),
380 383
381 TP_fast_assign( 384 TP_fast_assign(
382 __entry->mm = mm; 385 __entry->mm = mm;
383 __entry->old_prio = old_prio; 386 __entry->old_prio = old_prio;
384 __entry->new_prio = mm->token_priority; 387 __entry->new_prio = mm->token_priority;
388 __entry->swap_token_mm = swap_token_mm;
389 __entry->swap_token_prio = swap_token_mm ? swap_token_mm->token_priority : 0;
385 ), 390 ),
386 391
387 TP_printk("mm=%p old_prio=%u new_prio=%u", 392 TP_printk("mm=%p old_prio=%u new_prio=%u swap_token_mm=%p token_prio=%u",
388 __entry->mm, __entry->old_prio, __entry->new_prio) 393 __entry->mm, __entry->old_prio, __entry->new_prio,
394 __entry->swap_token_mm, __entry->swap_token_prio)
389); 395);
390 396
391#endif /* _TRACE_VMSCAN_H */ 397#endif /* _TRACE_VMSCAN_H */