Meet LKL: Turn Linux Kernel into a Library
1–10 of 25 posts
Re: Meet LKL: Turn Linux Kernel into a Library
#2Re: Meet LKL: Turn Linux Kernel into a Library
#3One problem is it appears to require that programs are rewritten, replacing all system calls with lkl_sys_* variants. For some programs this is necessary, because you want to differentiate between (eg) lkl_sys_open (open a file through LKL) and regular open (open a file on the host), but it's also a pain for any significant program.
[1] https://rwmj.wordpress.com/2015/11/07/linux-kernel-library-b...
Re: Meet LKL: Turn Linux Kernel into a Library
#4So basically this is Linux's version of NetBSD's Rump, right?
Re: Meet LKL: Turn Linux Kernel into a Library
#5Re: Meet LKL: Turn Linux Kernel into a Library
#6Does this still incur the penalty of context switching from user space to kernel space? Filesystems are an interest of mine, and this would be a nice alternative to FUSE if it could mitigate the context-switching overhead.
Re: Meet LKL: Turn Linux Kernel into a Library
#7Does this still incur the penalty of context switching from user space to kernel space? Filesystems are an interest of mine, and this would be a nice alternative to FUSE if it could mitigate the context-switching overhead.
If you link (-llkl) directly to your program, then no, since it's all in the same process. But this is not exposing the POSIX API or a host filesystem, so that's possibly not useful, depending on what you're trying to do.
I compare lkl to libguestfs in my article here: https://rwmj.wordpress.com/2015/11/07/linux-kernel-library-b...
Re: Meet LKL: Turn Linux Kernel into a Library
#8Does this still incur the penalty of context switching from user space to kernel space? Filesystems are an interest of mine, and this would be a nice alternative to FUSE if it could mitigate the context-switching overhead.
But the context switches not the bottleneck in FUSE. Did you benchmark?
Re: Meet LKL: Turn Linux Kernel into a Library
#9Does this still incur the penalty of context switching from user space to kernel space? Filesystems are an interest of mine, and this would be a nice alternative to FUSE if it could mitigate the context-switching overhead.
If you use it to write a FUSE filesystem, then yes, because it's using FUSE. If you link (-llkl) directly to your program, then no, since it's all in the same process. But this is not exposing the POSIX API or a host filesystem, so that's possibly not useful, depending on what you're trying to do. I compare lkl to libguestfs in my article here: https://rwmj.wordpress.com/2015/11/07/linux-kernel-library-b...
Basically this is a kernel running in userspace, not hooking into the actual kernel running in kernel space?
Re: Meet LKL: Turn Linux Kernel into a Library
#10Does this still incur the penalty of context switching from user space to kernel space? Filesystems are an interest of mine, and this would be a nice alternative to FUSE if it could mitigate the context-switching overhead.
This does not make any sense. As soon you issue any system call you will trigger a context switch. So, eve without using FUSE and just using LKL as tool to extract your favorite filesystem it will face them. But the context switches not the bottleneck in FUSE. Did you benchmark?