Announcement

Collapse
No announcement yet.

How Google's Android Maintains A Stable Linux Kernel ABI

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • coder
    replied
    Originally posted by oiaohm View Post
    Kernel drivers having a stable ABI comes back and bites you. Windows CE and Windows Mobile run into a lot of battery performance problems caused by the driver stable ABI.
    IMO, it's a false dichotomy to debate whether or not to have a stable driver API. Obviously, there will need to be some incompatible API changes, over time. That's why God invented major versions, after all.

    So, the real issue seems to be that there's no policy around introducing incompatible changes. That doesn't seem like such a big ask, but it's understandable why some GPL purists would rather not have to think about such matters.

    However, I think it's not only vendors with proprietary drivers that would benefit. Anyone trying to port fixes forward or backwards could potentially benefit, and not just in kernel modules, but also the the core.

    I should add that I haven't previously followed this debate, and my opinions are based on no actual experience with kernel or driver development. So, my statements should be treated as the view of a relative outsider (though one who's gotten a few scars trying to build or use kernel modules against mismatched versions, over the years).

    Leave a comment:


  • oiaohm
    replied
    Originally posted by starshipeleven View Post
    Only on the long run, and for high performance interfaces.

    For most mobile devices that's less relevant. Most of their interfaces aren't high-speed and don't need top performance, also their realistic hardware life is not going to be much more than 5 years anyway.
    High performance and mobile kind of does match up. Not for being exactly fast. Less processing a driver consumes less battery time it consumes operating.

    When I said performance I don't just mean the case of speed. It can be the case of battery life. If the ABI for a driver is not fine grained enough you can be holding hardware active that could be suspended.

    Kernel drivers having a stable ABI comes back and bites you. Windows CE and Windows Mobile run into a lot of battery performance problems caused by the driver stable ABI.

    Yes google is trying to make longer support window for devices.

    Leave a comment:


  • starshipeleven
    replied
    Originally posted by oiaohm View Post
    Stable driver kernel ABI has kind of equal problem.
    Only on the long run, and for high performance interfaces.

    For most mobile devices that's less relevant. Most of their interfaces aren't high-speed and don't need top performance, also their realistic hardware life is not going to be much more than 5 years anyway.

    They are trying to make a new trade-off for a longer supported window for specific classes of devices.

    Leave a comment:


  • oiaohm
    replied
    Originally posted by starshipeleven View Post
    Yes but it has limits. Eventually they will need the underlying kernel to support something that older kernels don't, and then you would be screwed.

    With this system, you could just leave the kernel modules in the "system" partition and be able to update the kernel too if needed.
    Stable driver kernel ABI has kind of equal problem. At some point you will be doing something in the stable ABI that you don't want to do any more because it causes horrible performance or the like. Linux kernel has removed a few syscalls to userspace over time because they came basically not supportable. Microsoft driver ABI has broken in places as well.

    Remember the spectre and meltdown stuff this was only fixable properly in software by rebuilding all the drivers.

    Stable Kernel ABI still does not mean that they don't need to mainline as many drivers as possible. Hard reality core OS secruity and binary blobs really don't mix. Commercial interest always want binary blobs even that long term its not good for them.

    Leave a comment:


  • starshipeleven
    replied
    Originally posted by oiaohm View Post
    Project Treble stuff has already landed.
    Yes but it has limits. Eventually they will need the underlying kernel to support something that older kernels don't, and then you would be screwed.

    With this system, you could just leave the kernel modules in the "system" partition and be able to update the kernel too if needed.

    Leave a comment:


  • oiaohm
    replied
    Originally posted by starshipeleven View Post
    Currently they have isolated the "hardware support" part (linux kernel and kernel modules) from the "OS part" (most of Android OS) with project Treble. If this goes well, they can reduce the "hardware support" part to just kernel modules.
    Project Treble stuff has already landed.


    Project Treble is the "HAL interface definition language (HIDL)" that cuts userspace of android from the kernel stuff,



    This stable abi work is under the future android versions stuff. Of course google clearly states they wish for the drivers up-streamed just due to the peer review process effect on security.

    Leave a comment:


  • starshipeleven
    replied
    Originally posted by doragasu View Post
    I thought the userspace API was stable, and that only the internal ABI was not.
    This is about the ABI. Aka the interface between the kernel and kernel modules (the hardware drivers).
    This would allow to update the kernel without causing massive breakage in proprietary kernel modules shipped by the stock firmware, and should theoretically allow to update the firmware in a device indefinitely (though third party firmware I guess).

    Currently they have isolated the "hardware support" part (linux kernel and kernel modules) from the "OS part" (most of Android OS) with project Treble. If this goes well, they can reduce the "hardware support" part to just kernel modules.

    This is significant.
    Last edited by starshipeleven; 15 September 2019, 04:06 PM.

    Leave a comment:


  • starshipeleven
    replied
    Originally posted by birdie View Post
    Which kinda invalidates the claim that Linux is the most popular kernel in the world 'cause Google doesn't use the mainline kernel.
    More or less none uses true mainline kernel, all distros have their own patches, big or small.

    Not sure how having some downstream patches makes it "non-Linux".

    Leave a comment:


  • skeevy420
    replied
    Originally posted by flashmozzg View Post

    My 2 year old device is based on 4.4.153. IRC, 4.4 is the minimum for new devices starting with Android 8.0.

    From https://source.android.com/devices/a...re-kernel-reqs:
    My 8.0 device has 3.17.something.

    Code:
    For Android 9, the minimum Long Term Support (LTS) kernel version requirements are 4.4.107, 4.9.84, and 4.14.42.[LIST][*]All system-on-chips (SoCs) productized in 2018 must launch with kernel 4.9.84 or newer.[*]All other SoCs launching Android devices running Android 9 must use kernel 4.4.107 or higher.[*]Device kernels based on 4.14 must include the 4.14.42 or higher LTS release.[*]Regardless of launch date, all SoCs with device launches on Android 8.0 and higher remain subject to the kernel changes required to enable Treble.[*][B]Older Android devices upgrading to Android 8.0 or higher can continue to use their original base kernel version.[/B][/LIST]
    Which is why my 3.17.something* LG V20** running Oreo is getting 3.18.120 with Pie. What a crappy rule.

    And that's if that update actually makes it to the States and through carrier certification...though the phone has an unlocked bootloader so AT&T being shitty as usual won't stop me from updating...

    *it's charging and I'm too lazy to walk across the room and check...

    **It has a headphone jack, removable battery, DAC, SD card, two good cameras, 2K screen, fingerprint reader. I feel no need to upgrade phones because a lot of them feel like downgrades in regards to everything except the SOC/CPU & OS version.

    Leave a comment:


  • DanL
    replied
    Originally posted by Volta View Post
    I hope Linux will break ABI all the time, so those monkeys will have more work to do.
    Come on now. That's just spiteful. That's not helping anybody.

    Leave a comment:

Working...
X