From 739421ac52472d8dd2f23c141d449ff112fbf9b6 Mon Sep 17 00:00:00 2001 From: Justus Winter <4winter@informatik.uni-hamburg.de> Date: Tue, 30 Sep 2014 09:08:44 +0200 Subject: kern: reduce the size of `struct thread' Reduce the size of `struct thread' by twelve bytes making it fit into exactly five cache lines (on 32-bit platforms). * kern/thread.h (struct thread): Group the state and all flags in a bitfield. (TH_EV_WAKE_ACTIVE, TH_EV_STATE): Provide macros that generate keys for synchronization primitives like `thread_wakeup'. * kern/thread.c (thread_halt, thread_dowait, thread_suspend): Use the new keys instead of addresses of fields for the synchronisation. * kern/ipc_sched.c (thread_handoff): Likewise. * kern/sched_prim.c (thread_invoke, thread_dispatch): Likewise. --- kern/ipc_sched.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'kern/ipc_sched.c') diff --git a/kern/ipc_sched.c b/kern/ipc_sched.c index cc1672d6..be82971b 100644 --- a/kern/ipc_sched.c +++ b/kern/ipc_sched.c @@ -268,7 +268,7 @@ thread_handoff( */ old->wake_active = FALSE; thread_unlock(old); - thread_wakeup((event_t)&old->wake_active); + thread_wakeup(TH_EV_WAKE_ACTIVE(old)); goto after_old_thread; } } else -- cgit v1.2.3