We have moved to a new Sailfish OS Forum. Please start new discussions there.
139

kernel 4.4 on Sailfish X

asked 2017-10-13 04:22:15 +0200

this post is marked as community wiki

This post is a wiki. Anyone with karma >75 is welcome to improve it.

updated 2018-03-02 13:19:36 +0200

DrYak gravatar image

This means Sony will have a kernel 4.4 for their Xperia X F5121 hardware platform [as seen on the current unofficial AOSP test builds.

It would be awesome if Jolla could also provide this updated kernel in one of the next uprages of Sailfish X.

(This could potentially bring new extra security protections, and even a bunch of features introduced that the current 3.10 lacks)

update

Ressource :

Also :

µSDXC fixes :

  • Users report having problems with some µSDXC cards
  • one TMO user reports consistently having the same card accepted by stock android, and completely unseen by Sailfish X
  • One interesting answer points to known kernel bugs (which could explain why Up-to-date Android's 3.10.1xx kernel can detect the card, but Sailfish X's slightly older 3.10.84 misses it)

This kind of bugs would be a very good argument for Jolla to try to follow as closely as possible the updates that Sony makes available of their kernel for Xperia X.1

Meltdown & Spectre

As underlined by another request on TJC : according to ARM the Cortex-A72 core that is found inside Sony Xperia X' Snapdragon 650, is vulnerable to Spectre variation 1 (Bounds Check Bypass) and Spectre varation 2 (Branch Target Injection) - (And also a distant cousin of Meltdown Rogue Data Cache Load, that they call 3a, but one that doesn't require mitigation).

The various fixes will get merged eventually in the kernels that are still supported ( 3.18, 4.4 and 4.9 - versions considered still supported by Google ). But it's very unlikely that there will be efforts to bring them to older kernels (like the 3.10 that Sailfish X is currently using).

It's starting to look very urgent for Jolla to move Sailfish X to the newest Sony kernel.

again update

Jolla mentions coming updates for Sailfish including features that aren't supported by the current kernel, like BTRFS support. Which means they'll be considering at least some kernel update.

sailfish x 2.1.4

changelog mentions upgrade to kernel 3..10.108

My mistake, the correct package to check for is droid-hal-f5121-img-boot. Which is still the exact same 3.10.84 version, only a new release (a new recompile, with the options mentioned by Jolla such as BTRFS enabled)

So still not 4.4 (and thus as release note reports, no little.BIG-aware scheduler yet) but at least the SD cards bugs should get fixed nor SD cards fixes either.

Let's hope 4.4 will be there for version 2.2.0

OOM killer on SFX 2.1.4

Note that the "out of memory killer" has been activated, to kill apps when ram usage is high.

RAM can be save by activating swap. Currently, kernel 3.10.84 only gives an "either/or" situation.

  • Either you write you activate SWAP - as big as you want - on a flash media (SD card, or internal eMMC) but those don't like frequent writes (due to "write amplifications" - a write is actually implemented as a read of all the neighbors, an erase of the whole giant "erase block" and then rewrite everything).
  • Or, you use "ZRAM" which makes a compressed RAM disc on which you can store swap, thus e.g.: you can reserve a small part of your RAM (say ~512MB) on which you can store swap (say ~1GB in case of good compression). Your flash is happy but this is swap is small (of course, as you're sacrificing RAM for it).

Kernel 4.4 would bring us Zswap :

  • Basically compress swap like Zram, but can move the least often used pages to flash storage (giving both space and happy flash media).
  • (Though in practice, it's a tiny bit more complicated under the hood : instead of a ram disk, it works as a compression pre-filter inside the regular Swap stack).
  • Zswap is mainstream since kernel 3.11 - it's thus currently not available on current kernel 3.10.84, but could be compiled with upstream kernel 4.4 from Sony.
edit retag flag offensive close delete

Comments

6

That would be fantastic. Being relegated to the (now ancient) 3.x world has been holding us all back.

deprecated ( 2017-10-13 08:07:17 +0200 )edit
5

Let‘s hope, this would come within the 1 year support we have

duque ( 2017-10-13 08:13:56 +0200 )edit
3

yes, please! It is the next LTS kernel for andriod.

jolladiho ( 2017-10-13 11:31:52 +0200 )edit
3

This will probably also bring better support for the big.LITTLE CPU-Cores and therefore better user experience.

Cmdr_Zod ( 2017-11-15 23:46:44 +0200 )edit
3

kernel 3.2 is still maintained and will see Meltdown & Spectre fixes. KAISER and KPTI happened already in kernel 3.2.98. @DrYak no need to cry today... after May 2018 picture may be different with oldest still maintained LTS linux kernel being 3.16.x (Android-Kernel 3.10 will most likely still be maintained by Google)

lpr ( 2018-01-29 18:24:16 +0200 )edit

8 Answers

Sort by » oldest newest most voted
25

answered 2017-11-13 14:20:31 +0200

Aga4io gravatar image

Sony has released Android firmware with Linux Kernel 4.4, for the Xperia X.

According to Sony's Open Devices Kernel/functionality Matrix, all components appear be working on Linux Kernel 4.4 for the Xperia X

edit flag offensive delete publish link more

Comments

2

Great, now let's hope Jolla manage to incorporate this into an upcoming Sailfish X update !

DrYak ( 2017-11-13 14:28:00 +0200 )edit
4

the adaptation is open, you can try and build it with the 4.4 kernel yourself, no need to wait for Jolla to do it

r0kk3rz ( 2017-11-13 15:08:35 +0200 )edit
2

If you can point me to a repo from which a could git clone some free time I could do my own build :-D

DrYak ( 2017-11-13 16:14:56 +0200 )edit

As @Andy Branson denoted in a comment:

All of the Xperia SailfishX adaptations are open-source and can be found here: https://github.com/mer-hybris/

olf ( 2019-09-04 22:38:52 +0200 )edit
11

answered 2017-10-13 11:46:28 +0200

veritanuda gravatar image

It is not just hardening that is in 4.4 namepace features are as well. Paving the way for snaps to be installable too,

edit flag offensive delete publish link more
5

And all the other container-based goodies, too. (Andbox ?) (Was mentionning containers in my initial text, but found it too long)

DrYak ( 2017-10-13 15:20:16 +0200 )edit
9

answered 2018-02-06 20:44:24 +0200

jb gravatar image

Something else the 4.4 kernel upgrade should improve, from the HADK installation page:

No big.LITTLE technology is currently enabled, Sailfish OS simply fills up the cores in sequence (from 0 to 3 little, then the big ones 4 and 5), which already gives a very smooth performance. However, this means there's no special allocation of the two performance cores for the foreground apps (so the UX experience could be improved even further, even under heavy loads). More details: We can't dedicate two big cores to foreground UI apps because we can't allocate PIDs to the foreground sets. And even if we could, we'd have to add the root process for foreground apps (SFOS booster/invoker?) into there so its children would live on the fast cores. Ping abranson on IRC if you want to chip in, or wait for Android 7 (and kernel v4.4 automatically handling all that much better) where only SFOS booster part will need sorting.

edit flag offensive delete publish link more
2

answered 2018-02-14 16:23:06 +0200

veritanuda gravatar image

I concur. The move to 4.4 is of utmost importance now given SPECTRE has been confirmed and tested upon.

Don't listen to muppets who don't know how kernel development works more lines of code don't mean larger kernels it just mean more drivers any of which can be disabled if not needed for a particular platform.

Such ignorance really is depressing.

Make the switch, sooner rather than later.

edit flag offensive delete publish link more

Comments

2

Reopening the thread just to find out that you bumped it with no new information is also depressing.

Sthocs ( 2018-02-14 17:00:27 +0200 )edit

@Sthocs : question converted to wiki. Feel free to make it better or more structured if you have free time for that.

DrYak ( 2018-02-14 18:41:32 +0200 )edit

? it's already great and well structured, thanks!

Sthocs ( 2018-02-15 03:29:33 +0200 )edit
2

answered 2018-02-15 07:06:07 +0200

shiro kitsune gravatar image

Another consideration to make is the compatibility of Kernel 4.4 with Alien Dalvik. I am not sure if Alien Dalvik (which is compatible to Android 4.4.4 as far as I know) is compatible with Kernel 4.4, or if this would need to much hacking and reimplementation. Someone knows something more substantial about this?

Just my two pennies worth. Have a good day!

edit flag offensive delete publish link more

Comments

2

This indeed used to be a problem on Jolla 1 : it's kernel only covers API that are useable up to Jellybean 4.2, it doesn't cover the API require by Kitkat (there are some theads discussing it).

On the other hand, the Linux 4.4 kernel isn't only used on Android Oreo 8, but Sony is also using it on older versions of android (the same where they used the previous 3.10.84 kernel, so there are chances that there's an overlap in the provided APIs). Some expert in Alien Dalvik should jump in to give more info...

Also kernel 4.4 is also useful for another android layer : Andbox! (it exposes all the cointainer-related API that are required by andbox). So some of the comunity would be able to experiment with it as a solution of getting support for more recent apps that have switched from the dalvik JIT to the current runtime.

DrYak ( 2018-02-16 12:36:56 +0200 )edit
1

answered 2018-09-11 20:12:20 +0200

Jk gravatar image

updated 2018-09-11 20:13:00 +0200

So let's talk about xperia x performance:

Well as many of us know about sailfish in xperia x not uses bigger cores (cortex a72) correctly. So I have three questions:

-Will kernel 4.4 fix cpu utilize and bring more power to sailfish x?

-Is there already (sailfish 2.2.1.18) some improvement about cpu utilize in xperia x?

-What about xperia X graphics processing unit, is it work correctly like in official Sony's android? I mean is it also downgraded by sailfish like central processing unit is currently in xperia x.

I'm just curious about what can be possible in future sailfish x.

edit flag offensive delete publish link more

Comments

4

Will kernel 4.4 fix cpu utilize and bring more power to sailfish x

Yup, scheduling with big.LITTLE cores has been improved in that kernel (seems it has been introduced in kernel 3.13 as seen here on Phoronix, so the current 3.10.84 in Sailfish is missing it, but Sony's 4.4 kernel in AOSP 7.1/8.1 has it)

downgraded by sailfish like central processing unit is currently in xperia x.

The thing is, the kernel version 3.10.84 has no idea about big.LITTLE CPU cores.

So on older versions, Sony has written additional custom proprietary libraries to handle the CPU optimisation.

By kernel version 4.4, the kernel is able to handle the situation and would work out-of-the-box without any special library needed.

What about xperia X graphics processing unit, is it work correctly like in official Sony's android? I mean is it also downgraded

The whole raison d'être of the hybris hardware abstraction layer) is to be able to take the normal Android (Linux + Google's bionic libraries, etc.) drivers used by Sony and slap them as-is on a GNU/Linux OS like Sailfish.

Jolla doesn't re-write their own set of drivers, they use whatever the chipset manufacturer provides.

The only problem is that their current adaptation is designed to work with the drivers that came with Sony's Android 6.0 Marshmallow for Xepria X.

Current AOSP 7.1 Nougat and 8.1 Oreo that use Sony's kernel 4.4 obviously use a more recent driver from Qualcomm, so Jolla would need to make a new hybris adaptation.

Which is still a bit of work. Thus don't expect anything before Sailfish 3.0, and even then Jolla's will have to decide if it is worth the effort (my humble user's opinion would be : yes)

DrYak ( 2018-09-11 21:06:04 +0200 )edit

Allright thank you for your quick answers! Very nice to see so quick and proper answers! Now I have more knowledge about this subject. Xperia Xa2 have only kernel 4.4 so it contains those many improvements so it supposed to work better than currently xperia x. So at least in future we have even greater device indeed in many aspects.

I'm so excited about xperia xa2 with sailfish x although it have decent hardware today.

Jk ( 2018-09-11 23:48:46 +0200 )edit
1

You may find my howto on using big cores of some use: https://together.jolla.com/question/187833/howto-enable-a72-cores-to-make-xperia-17x-faster/

butler ( 2018-09-12 00:18:57 +0200 )edit

thank you, @butler, this looks interesting.

DrYak ( 2018-09-12 09:23:30 +0200 )edit
-17

answered 2018-02-07 12:02:34 +0200

alloj gravatar image

Difference in KERNEL lines of code between 4.4.4 and current Jolla kernel 3.10.24 is over 3 MILLION LINES! (3015372) Do the right thing and resist kernel bloat and backport security fixes -do not move to bloated kernel!!!!

edit flag offensive delete publish link more

Comments

1
  1. The current kernel is at 3.10.84 already, you doofus. Try at least to get your facts straight.
DrYak ( 2018-02-07 12:28:10 +0200 )edit
8

Sony has already ported the 4.4 kernel to Loire platform. Jolla would in theory only have to redo their adaptation layer. (In practice, given the latest Blog entry they've apparently went a little bit further, and are recompiling Sony's kernel themselves from source and enabling a couple of extra stuff like BTRFS)

The 3 million lines worth of git diff that you're citing are across the whole fucking kernel codebase.

  • That includes a few bits that are running on the smartphone (e.g.: the newer, better optimised scheduler that better handle the litte.BIG core configuration, leading to more responsive system and better battery usage).
  • But that includes ton of other stuff that will never be compiled-in in the kernel running on your hardware (better opensource drivers for desktop graphics cards like AMD Radeon and Intel. drivers for buses on desktop like PCIe. drivers for buses on clusters like Infiniband. drivers for networking system used by banks like X.25 etc.)

Version 4.4 is a LTS edition.

  • It's what Sony will be spending resource to keep up to date for the Loire platform
  • It's what google recommends (together with 3.18) for Android, so that's where ressource from Google and every other hardware manufacturer will be spent to maintain.
  • It's an LTS edition that tons of other distributions (like RedHat/CentOS/Fedora) will be maintaining too
  • In short, that's the surest things that will be kept up to date.

Backporting security fixes is going to be a nightmare where Jolla would be on their own.

  • that would main weeding through all the 3 million line you cite to find which are security fixes relevant to the current 3.10.84 kernel
  • that means adapting and rewriting a lot of the fixes because 4.4 doesn't look exactly like 3.10.
  • all this done on Jolla on their own, because every other developper on this planet will be working on 4.4
DrYak ( 2018-02-07 12:28:23 +0200 )edit
2

In short, your idea is completely stupid if you'd had any consideration to the work that "back port security fixes" represent and if you spent more than half second thinking what real danger those 3mio diffs pose.

So please stop repeatedly polluting useful discussions with your misconstrued paranoid lies.

Go troll somewhere else

DrYak ( 2018-02-07 12:32:52 +0200 )edit
5

"bloated kernel". This post must be one of the most stupid I've read in this forum.

johanh ( 2018-02-07 13:28:09 +0200 )edit
3

@johanh : the worse part is that alloj keeps reposting the same stupidy each time without even paying attention to any attempt at constructive answer (see the other one).

DrYak ( 2018-02-07 13:29:46 +0200 )edit
-23

answered 2017-10-13 12:40:47 +0200

alloj gravatar image

No I do not agree. New resource drunk kernel leads to slower phone. New millions of lines of code leads to more security vulnerabilities. Instead backport good security features to old kernel -Just like they mentioned Google is also doing in the article.

edit flag offensive delete publish link more

Comments

12

Resource drunk kernel

It's just the kernel, just the part that talks to your hardware. Not the whole android. It's far from resource drunk.

Also speaking about "talking to the hardware", newer kernel bring very interesting optimizations that actually help performance : the 4.4 kernel has better handling of the scheduling of mixed little.BIG cores.

Backporting security fixes is a tedious task, that must be done in addition to development done on main kernel. (i.e.: the security fixes that kernel 4.4 introduce come "for free". backporting them to 3.10.xxx would require additional dev-time. Whereas with 4.4 you "only" need to backport what fixes have come between 4.5 and current 4.14 - like what Google did for 4.4 and 3.18. Meaning less efforts)

New millions of lines of code leads to more security vulnerabilities.

Nobody forces your to enable every last kernel feature like X.25, Infiniband fabric and other useless stuff that have no use on a smartphone, so you won't be affected by ALL THE DIFFS between 3.10 and 4.4

Also, if the industry is standardizing to a more recent kernel for Android Oreo (4.4, with the exception of extremely old hardware stuck at 3.18), means that is going to be even more scrutinity around this kernel. (Instead of each device stuck with its own 3.2, 3.4 (Jolla), 3.10 (Nougat Xperia), etc. kernel).

(Chances are higher that the "next Blueborne" will be seen faster, if more chip maker and handset manufacturer and 3rd party OS devs all look at it).

DrYak ( 2017-10-13 15:31:35 +0200 )edit
2

not to forget treble support: https://source.android.com/devices/architecture/treble

carepack ( 2017-11-13 16:02:48 +0200 )edit

I am trying to port SFOS for the OnePlus 5. However, since it uses the 4.4 kernel this is a difficult task as usb_gadgets are dropped from the mainline kernel. So no telnet to see whats failing. Anyone on this forum know of 4.4 kernel configs that are required for it to be "mer friendly"?

xreactx ( 2017-11-21 05:33:38 +0200 )edit
4

Update: I found a solution to the kernel 4.4 usb_gadget issue (https://developer.ridgerun.com/wiki/index.php/How_to_use_USB_device_networking) I am now able to telnet into my OnePlus 5 with the Mer Boat Loader running

xreactx ( 2017-11-23 04:46:00 +0200 )edit
1

"resource drunk kernel"? From which Microsoft planet are you?

johanh ( 2018-02-07 13:28:52 +0200 )edit
Login/Signup to Answer

Question tools

Follow
21 followers

Stats

Asked: 2017-10-13 04:22:15 +0200

Seen: 7,552 times

Last updated: Sep 11 '18