From 608f44306a6f0d5692f5c81bcbfe7a621ec254ba Mon Sep 17 00:00:00 2001 From: Kimplul Date: Fri, 5 Jul 2024 21:02:52 +0300 Subject: implement bkl + Start out using big kernel lock, apparently seL4 thinks its good enough. I might have a go at using a more fair lock, and possibly moving to more fine-grained locks if I really feel the need to get scalability up. --- src/timer.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/timer.c') diff --git a/src/timer.c b/src/timer.c index 2607584..2d4ff01 100644 --- a/src/timer.c +++ b/src/timer.c @@ -21,6 +21,7 @@ #include #include #include +#include #include #include #include @@ -197,12 +198,16 @@ ticks_t nsecs_to_ticks(tunit_t nsecs) /* call to this function from exception handlers */ void handle_timer() { + bkl_lock(); struct timer *t = newest_timer(); remove_timer(t); struct tcb *r = get_tcb(t->tid); - if (!r) + if (!r) { + bkl_unlock(); return; + } notify(r, NOTIFY_TIMER); + bkl_unlock(); } -- cgit v1.3