whats the difference between BKL and nonBKL ?
any charts? tests? something?
iam not native english, i already reed giant lock, but dont understand anything [nothing seems to be more clear]
both, benchmarks and explanations
Did anybody tried compiling without Big Kernel Lock, this is what I get:
Code:CHK include/linux/version.h UPD include/linux/version.h CHK include/generated/utsrelease.h UPD include/generated/utsrelease.h HOSTCC scripts/kallsyms CC scripts/mod/empty.o HOSTCC scripts/mod/mk_elfconfig MKELF scripts/mod/elfconfig.h HOSTCC scripts/mod/file2alias.o HOSTCC scripts/mod/modpost.o HOSTCC scripts/mod/sumversion.o HOSTCC scripts/pnmtologo HOSTCC scripts/conmakehash HOSTCC scripts/bin2c HOSTLD scripts/mod/modpost CC kernel/bounds.s GEN include/generated/bounds.h CC arch/x86/kernel/asm-offsets.s In file included from /usr/src/linux-2.6.37-rc1/arch/x86/include/asm/suspend_64.h:10:0, from /usr/src/linux-2.6.37-rc1/arch/x86/include/asm/suspend.h:4, from arch/x86/kernel/asm-offsets_64.c:20, from arch/x86/kernel/asm-offsets.c:4: /usr/src/linux-2.6.37-rc1/arch/x86/include/asm/i387.h: In function ‘irq_ts_save’: /usr/src/linux-2.6.37-rc1/arch/x86/include/asm/i387.h:324:2: error: implicit declaration of function ‘kernel_locked’ make[1]: *** [arch/x86/kernel/asm-offsets.s] Error 1 make: *** [prepare0] Error 2 [root@phenon linux-2.6.37-rc1]# make CHK include/linux/version.h CHK include/generated/utsrelease.h CC arch/x86/kernel/asm-offsets.s In file included from /usr/src/linux-2.6.37-rc1/arch/x86/include/asm/suspend_64.h:10:0, from /usr/src/linux-2.6.37-rc1/arch/x86/include/asm/suspend.h:4, from arch/x86/kernel/asm-offsets_64.c:20, from arch/x86/kernel/asm-offsets.c:4: /usr/src/linux-2.6.37-rc1/arch/x86/include/asm/i387.h: In function ‘irq_ts_save’: /usr/src/linux-2.6.37-rc1/arch/x86/include/asm/i387.h:324:2: error: implicit declaration of function ‘kernel_locked’ make[1]: *** [arch/x86/kernel/asm-offsets.s] Error 1 make: *** [prepare0] Error 2 [root@phenon linux-2.6.37-rc1]#
A lock is a synchronization primitive. Basically you place it around blocks of code, and then it becomes impossible for 1 thread to enter the block until the first has exited. The idea is to keep 1 thread from deleting or modifying some shared data before another thread has finished using it. In a userspace program that is only an issue for multi-threaded applications. In the kernel, there are all sorts of threads, events, and hardware interrupts that can cause an issue.
A long time ago, devs originally create 1 large lock and used it everywhere in the kernel. That was simple to do, because essentially grabbing the lock switched all the code inside into a single-threaded mode. But it has issues with scalability - you want as many different threads as possible able to work. There's no reason the memory subsystem and the Ext4 filesystem should both be blocking each other. So the solution is to create 2 locks, one for each section. The complication is that so much complicated code had come to rely on the single lock that it was almost impossible to predict the behavior of the kernel when you messed with that global lock. So people have been slowly going through section by section of the kernel to try and factor out what codes needs to share the same lock and what code can be separated out. A lot of the code under the global lock didn't even need to be, and was just there because the original coder thought it might be an issue.
So I'm not really sure how benchmarks will change. It will definitely increase the scalability of anything that likes to hit a bunch of kernel code. But on the other hand, this has been going on piece by piece for many years. So a lot of the benefits were already done and in previous kernels.