Originally posted by starshipeleven
View Post
Announcement
Collapse
No announcement yet.
Google's Gasket Driver Framework Landing For Linux 4.19
Collapse
X
-
Originally posted by Weasel View PostDoesn't this make it "slow", like FUSE is, with a lot of overhead?
I mean, Android has like 3 levels of abstraction (different APIs between system components and apps) before something can even reach the actual blob driver to do something basic like media acceleration.
And it's using a custom JavaVM to run the show. And is locked down so everything an application does requires more resources to check its permissions and provide a secure handle or something, and has a ton of tracking going on all the time (ads you know).
But usually it isn't really running like total trash unless you buy Samsung phones (their "Lagwiz" interface is legendary, it can put even their flagship phone on its knees).
So I wouldn't be surprised if at the end of the day the performance hit will be detectable but not significant.
- Likes 2
Comment
-
Originally posted by Weasel View PostDoesn't this make it "slow", like FUSE is, with a lot of overhead? Kernel code has the advantage of no privilege or context switches.
Yes, the Linux kernel networking stack is too slow for high-speed networks, but kernel bypass solutions aren’t the answer
Networking stack bipasses are a lot like google gasket. Also gasket are a lot like pci pass though for virtual machines. So not that heavy of a overhead.
Please note google gasket driver has to be better than samsung being caught putting /dev/mem under a different name.
EDIT: For general discussion about this topic, please post in the following location (and not here): http://xdaforums.com/showthread.php?t=2057818 Now find a one-click root application at http://xdaforums.com/showthread.php?t=2130276. More...
Yes the /dev/exynos-mem security hole. Because they wanted to write their drivers in user-space.
Please note samsung was not the only android device maker caught doing things this insane.
Really I find bpf being used in drivers more interesting. As bpf jit is native inside the Linux kernel itself. So only adds some driver start up overhead. Does have me asking a question how much of driver operation could be written in bpf restricted language.
- Likes 4
Comment
-
Originally posted by ermo View Post
One has to wonder if this is Google's way of preparing for a Fuchsia OS based future. Write a GASKET shim for both Linux and Fuchsia. Write in-house drivers for GASKET. Test and improve under both Linux and Fuchsia, rinse and repeat.
End result? Be kernel-agnostic and leave Linux behind when Fuchsia is ready.
Originally posted by ermo View PostIt's worth noting that Linux is coming up on 30 years old. With Fuchsia, drivers will likely live in user-space to a large degree, since it's a microkernel-based OS.
- Likes 1
Comment
-
Originally posted by oiaohm View PostYou have to remember fuse has roughly userspace application -> kernel space->fuse userspace-> kernel space-> userspace application.
- Likes 1
Comment
-
Originally posted by pal666 View Postgoogle can't outcompete linux kernel. they are not even largest contributor. even microsoft openly admits it can't outcompete linux kernel
so it will be hugely successful like hurd?
Originally posted by Weasel View PostThanks for the info, do you have the source for this? I'd like to read it, because I want to see *why* it has to do it that way, it sounds dumb as hell but maybe I'm (clearly) overlooking something here...
App creates syscall (asks the kernel) to open file ( Userland- > Kernel )
Kernel maps file to driver, which is generic fuse driver, which it turn asks the userland driver (Kernel -> Userland)
Userland driver (e.g. NTFS-3G) gets the file lookup, there may be multiple swaps between the fuse driver and userland driver here, and ultimately returns the file to the fuse driver ( Userland -> Kernel)
Kernel sends the file to the app. (Kernel -> Userland )
In-kernel drivers don't do this. But you have to implement the driver in kernel-space.
Comment
-
Originally posted by Britoid View PostApp creates syscall (asks the kernel) to open file ( Userland- > Kernel )
Kernel maps file to driver, which is generic fuse driver, which it turn asks the userland driver (Kernel -> Userland)
Userland driver (e.g. NTFS-3G) gets the file lookup, there may be multiple swaps between the fuse driver and userland driver here, and ultimately returns the file to the fuse driver ( Userland -> Kernel)
Kernel sends the file to the app. (Kernel -> Userland )
So without those it's only an extra 2-way communication, not 4 times more as before.
Furthermore, any userspace drivers (from micro kernel) will do the exact same thing if it's implemented with syscalls. Unless it's implemented with some sort of library only (removing the first and last steps), which is probably what you guys meant right?
Comment
-
Originally posted by Weasel View PostFurthermore, any userspace drivers (from micro kernel) will do the exact same thing if it's implemented with syscalls. Unless it's implemented with some sort of library only (removing the first and last steps), which is probably what you guys meant right?
Microkernels use ipc message bus way more than syscalls.
Originally posted by Weasel View PostBut the first and last points should be excluded because they happen without FUSE too. I don't see what's the point in including them?
Basically a proper microkernel style driver could be done with gasket on the Linux kernel and those drivers avoid switching to kernel unless it required. So gasket might not be that slow.
- Likes 1
Comment
-
Originally posted by oiaohm View PostExcept microkernels do not function the same. Most microkernels use IPC a lot more than syscalls. IPC sometimes allows userland driver running on one cpu to be using message bus to talk to application running on a different cpu without passing though kernel space in micro kernels.
Microkernels use ipc message bus way more than syscalls.
Comment
-
Originally posted by Weasel View PostIPC is just as bad, if not even worse, than pure syscalls though...? But yeah you have a point with most of the driver implemented in userland, that's why I mentioned it as the possible reason being faster than FUSE.
Next if you call IPC bad android is bad. Surface finger to hardware compositor on Android is IPC. OpenGL ES can also be implemented on top of IPC on Android devices in fact Android binary only graphics drivers are meant to be implemented this way and libhybris supported using those drivers under normal Linux.
Yes the reason why samsung and other want to do usermode drivers for android is to avoid syscall overhead. IPC overhead is part of the Android API/ABI. With the prior goof ups with security those wanting to userspace drivers for Android need a safe way to-do it.
So there is a context thing. If you have to-do IPC anyhow avoid syscalls can have benefit.
- Likes 2
Comment
Comment