diff options
-rw-r--r-- | include/litmus.h | 1 | ||||
-rw-r--r-- | src/kernel_iface.c | 10 |
2 files changed, 11 insertions, 0 deletions
diff --git a/include/litmus.h b/include/litmus.h index 0d0b31c..0371a6c 100644 --- a/include/litmus.h +++ b/include/litmus.h | |||
@@ -105,6 +105,7 @@ task_class_t str2class(const char* str); | |||
105 | /* non-preemptive section support */ | 105 | /* non-preemptive section support */ |
106 | void enter_np(void); | 106 | void enter_np(void); |
107 | void exit_np(void); | 107 | void exit_np(void); |
108 | void exit_np_trace(void); | ||
108 | 109 | ||
109 | /* task system support */ | 110 | /* task system support */ |
110 | int wait_for_ts_release(void); | 111 | int wait_for_ts_release(void); |
diff --git a/src/kernel_iface.c b/src/kernel_iface.c index 69e306b..34767ae 100644 --- a/src/kernel_iface.c +++ b/src/kernel_iface.c | |||
@@ -68,6 +68,15 @@ void exit_np(void) | |||
68 | if (likely(ctrl_page != NULL) && --ctrl_page->sched.np.flag) { | 68 | if (likely(ctrl_page != NULL) && --ctrl_page->sched.np.flag) { |
69 | /* became preemptive, let's check for delayed preemptions */ | 69 | /* became preemptive, let's check for delayed preemptions */ |
70 | __sync_synchronize(); | 70 | __sync_synchronize(); |
71 | if (ctrl_page->sched.np.preempt) | ||
72 | sched_yield(); | ||
73 | } | ||
74 | } | ||
75 | |||
76 | void exit_np_trace(void) | ||
77 | { | ||
78 | if (likely(ctrl_page != NULL) && --ctrl_page->sched.np.flag) { | ||
79 | __sync_synchronize(); | ||
71 | if (ctrl_page->sched.np.preempt) { | 80 | if (ctrl_page->sched.np.preempt) { |
72 | ctrl_page->ts_syscall_start = (uint64_t) get_cycles(); | 81 | ctrl_page->ts_syscall_start = (uint64_t) get_cycles(); |
73 | sched_yield(); | 82 | sched_yield(); |
@@ -75,6 +84,7 @@ void exit_np(void) | |||
75 | } | 84 | } |
76 | } | 85 | } |
77 | 86 | ||
87 | |||
78 | /* init and return a ptr to the control page for | 88 | /* init and return a ptr to the control page for |
79 | * preemption and migration overhead analysis | 89 | * preemption and migration overhead analysis |
80 | * | 90 | * |