summaryrefslogtreecommitdiff
path: root/debian
diff options
context:
space:
mode:
authorJustus Winter <4winter@informatik.uni-hamburg.de>2014-12-01 16:19:43 +0100
committerJustus Winter <4winter@informatik.uni-hamburg.de>2014-12-01 16:19:43 +0100
commitbd15e05f6dcd3003ebebb27e0f2fd8b1e8816018 (patch)
treedb4ac787881994980cb31a4786f10b783e994d3b /debian
parent0f22e6c59d584ea3ab2be13e0388141183c622b7 (diff)
add patch series
Diffstat (limited to 'debian')
-rw-r--r--debian/patches/0001-kern-disable-all-counters-by-default.patch121
-rw-r--r--debian/patches/series1
2 files changed, 122 insertions, 0 deletions
diff --git a/debian/patches/0001-kern-disable-all-counters-by-default.patch b/debian/patches/0001-kern-disable-all-counters-by-default.patch
new file mode 100644
index 0000000..4880ae2
--- /dev/null
+++ b/debian/patches/0001-kern-disable-all-counters-by-default.patch
@@ -0,0 +1,121 @@
+From cd76999cd1cf590b95df3e22d2eb2a7dad333499 Mon Sep 17 00:00:00 2001
+From: Justus Winter <4winter@informatik.uni-hamburg.de>
+Date: Mon, 1 Dec 2014 16:16:04 +0100
+Subject: [PATCH gnumach] kern: disable all counters by default
+
+Make all five non-conditional counters conditional ones. Casual
+checking revealed that the hits-to-miss ratio is excellent.
+
+* kern/counters.c: Make all counters conditional.
+* kern/counters.h: Likewise.
+* kern/ipc_sched.c: Likewise.
+* kern/sched_prim.c: Likewise.
+---
+ kern/counters.c | 3 +--
+ kern/counters.h | 3 +--
+ kern/ipc_sched.c | 4 ++--
+ kern/sched_prim.c | 8 ++++----
+ 4 files changed, 8 insertions(+), 10 deletions(-)
+
+diff --git a/kern/counters.c b/kern/counters.c
+index a9d450e..74fd42d 100644
+--- a/kern/counters.c
++++ b/kern/counters.c
+@@ -32,13 +32,12 @@
+ * This makes them easier to examine with ddb.
+ */
+
++#if MACH_COUNTERS
+ mach_counter_t c_thread_invoke_hits = 0;
+ mach_counter_t c_thread_invoke_misses = 0;
+ mach_counter_t c_thread_invoke_csw = 0;
+ mach_counter_t c_thread_handoff_hits = 0;
+ mach_counter_t c_thread_handoff_misses = 0;
+-
+-#if MACH_COUNTERS
+ mach_counter_t c_threads_current = 0;
+ mach_counter_t c_threads_max = 0;
+ mach_counter_t c_threads_min = 0;
+diff --git a/kern/counters.h b/kern/counters.h
+index 474c6a2..bfa9b44 100644
+--- a/kern/counters.h
++++ b/kern/counters.h
+@@ -55,13 +55,12 @@
+
+ typedef unsigned int mach_counter_t;
+
++#if MACH_COUNTERS
+ extern mach_counter_t c_thread_invoke_hits;
+ extern mach_counter_t c_thread_invoke_misses;
+ extern mach_counter_t c_thread_invoke_csw;
+ extern mach_counter_t c_thread_handoff_hits;
+ extern mach_counter_t c_thread_handoff_misses;
+-
+-#if MACH_COUNTERS
+ extern mach_counter_t c_threads_current;
+ extern mach_counter_t c_threads_max;
+ extern mach_counter_t c_threads_min;
+diff --git a/kern/ipc_sched.c b/kern/ipc_sched.c
+index d5b9263..cc1672d 100644
+--- a/kern/ipc_sched.c
++++ b/kern/ipc_sched.c
+@@ -214,7 +214,7 @@ thread_handoff(
+ thread_unlock(new);
+ (void) splx(s);
+
+- counter_always(c_thread_handoff_misses++);
++ counter(c_thread_handoff_misses++);
+ return FALSE;
+ }
+
+@@ -278,6 +278,6 @@ thread_handoff(
+ after_old_thread:
+ (void) splx(s);
+
+- counter_always(c_thread_handoff_hits++);
++ counter(c_thread_handoff_hits++);
+ return TRUE;
+ }
+diff --git a/kern/sched_prim.c b/kern/sched_prim.c
+index 66eb9c9..89fb1dc 100644
+--- a/kern/sched_prim.c
++++ b/kern/sched_prim.c
+@@ -726,7 +726,7 @@ boolean_t thread_invoke(
+ * running out of stack.
+ */
+
+- counter_always(c_thread_invoke_hits++);
++ counter(c_thread_invoke_hits++);
+ (void) spl0();
+ call_continuation(new_thread->swap_func);
+ /*NOTREACHED*/
+@@ -738,7 +738,7 @@ boolean_t thread_invoke(
+ */
+ thread_swapin(new_thread);
+ thread_unlock(new_thread);
+- counter_always(c_thread_invoke_misses++);
++ counter(c_thread_invoke_misses++);
+ return FALSE;
+
+ case 0:
+@@ -759,7 +759,7 @@ boolean_t thread_invoke(
+ {
+ thread_swapin(new_thread);
+ thread_unlock(new_thread);
+- counter_always(c_thread_invoke_misses++);
++ counter(c_thread_invoke_misses++);
+ return FALSE;
+ }
+ }
+@@ -788,7 +788,7 @@ boolean_t thread_invoke(
+ * changing address spaces. It updates active_threads.
+ * It returns only if a continuation is not supplied.
+ */
+- counter_always(c_thread_invoke_csw++);
++ counter(c_thread_invoke_csw++);
+ old_thread = switch_context(old_thread, continuation, new_thread);
+
+ /*
+--
+2.1.3
+
diff --git a/debian/patches/series b/debian/patches/series
index 39a711a..1aeb162 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -8,3 +8,4 @@ Add-some-padding-to-make-objects-fit-a-single-cache-.patch
vm_cache_policy.patch
tn-0001-kern-provide-notifications-about-new-tasks.patch
tn-0002-include-add-X_IMPORTS-to-ipc-definitions.patch
+0001-kern-disable-all-counters-by-default.patch