From a6767cf581a44fb7e7bcdb11ae34135f897c2fb2 Mon Sep 17 00:00:00 2001 From: Fabian Keil Date: Sun, 20 Sep 2015 16:36:46 +0200 Subject: [PATCH 213/257] vm_pageout_scan(): Add SDT probes to make a couple of internal variables visible Obtained from: ElectroBSD --- sys/vm/vm_pageout.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/sys/vm/vm_pageout.c b/sys/vm/vm_pageout.c index 67cf415d2e1e..3e36f7c1c3fa 100644 --- a/sys/vm/vm_pageout.c +++ b/sys/vm/vm_pageout.c @@ -140,6 +140,15 @@ SYSINIT(pagedaemon, SI_SUB_KTHREAD_PAGE, SI_ORDER_SECOND, kproc_start, SDT_PROVIDER_DEFINE(vm); SDT_PROBE_DEFINE(vm, , , vm__lowmem_scan); +SDT_PROBE_DEFINE4(vm, , , before__inactive__scan, "struct vm_domain *vmd", + "int pass", "int page_shortage", "int deficit"); +SDT_PROBE_DEFINE5(vm, , , after__inactive__scan, "struct vm_domain *vmd", + "int pass", "int page_shortage", "int addl_page_shortage", + "int vnodes_skipped"); +SDT_PROBE_DEFINE3(vm, , , before__active__scan, "struct vm_domain *vmd", + "int pass", "int page_shortage"); +SDT_PROBE_DEFINE3(vm, , , after__active__scan, "struct vm_domain *vmd", + "int pass", "int page_shortage"); #if !defined(NO_SWAPPING) /* the kernel process "vm_daemon"*/ @@ -921,6 +930,9 @@ vm_pageout_scan(struct vm_domain *vmd, int pass) vnodes_skipped = 0; + SDT_PROBE4(vm, , , before__inactive__scan, vmd, pass, page_shortage, + deficit); + /* * Start scanning the inactive queue for pages that we can free. The * scan will stop when we reach the target or we have scanned the @@ -1146,6 +1158,9 @@ relock_queue: } vm_pagequeue_unlock(pq); + SDT_PROBE5(vm, , , after__inactive__scan, vmd, pass, page_shortage, + addl_page_shortage, vnodes_skipped); + #if !defined(NO_SWAPPING) /* * Wakeup the swapout daemon if we didn't free the targeted number of @@ -1194,6 +1209,8 @@ relock_queue: if (min_scan > 0 || (inactq_shortage > 0 && maxscan > 0)) vmd->vmd_last_active_scan = scan_tick; + SDT_PROBE3(vm, , , before__active__scan, vmd, pass, page_shortage); + /* * Scan the active queue for pages that can be deactivated. Update * the per-page activity counter and use it to identify deactivation @@ -1271,6 +1288,9 @@ relock_queue: vm_page_unlock(m); } vm_pagequeue_unlock(pq); + + SDT_PROBE3(vm, , , after__active__scan, vmd, pass, page_shortage); + #if !defined(NO_SWAPPING) /* * Idle process swapout -- run once per second. -- 2.11.0