SMP - Big kernel lock (BKL)
- to isolate execution inside kernel we use a big kernel lock implemented as a spinlock - the lock is acquired asap after entering kernel mode and released as late as possible. Only one CPU as a time can execute the core kernel code - measurement son real hw show that the overhead of this lock is close to 0% of kernel time for the currnet system - the overhead of this lock may be as high as 45% of kernel time in virtual machines depending on the ratio between physical CPUs available and emulated CPUs. The performance degradation is significant
This commit is contained in:
@@ -24,6 +24,10 @@
|
||||
#ifdef CONFIG_SMP
|
||||
#include "smp.h"
|
||||
#endif
|
||||
#ifdef CONFIG_WATCHDOG
|
||||
#include "watchdog.h"
|
||||
#endif
|
||||
#include "spinlock.h"
|
||||
|
||||
/* Prototype declarations for PRIVATE functions. */
|
||||
FORWARD _PROTOTYPE( void announce, (void));
|
||||
@@ -93,6 +97,7 @@ PUBLIC int main(void)
|
||||
struct exec e_hdr; /* for a copy of an a.out header */
|
||||
size_t argsz; /* size of arguments passed to crtso on stack */
|
||||
|
||||
BKL_LOCK();
|
||||
/* Global value to test segment sanity. */
|
||||
magictest = MAGICTEST;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user