[Kernel][osprey][merlin] Squid Kernel for Moto G 2015

Search This thread

ArcherTanu

Senior Member
Jan 5, 2015
138
108
Kolkata
I've been a combination of busy/lazy/tired lately, but I'm going to work on some Android related things this weekend. The kernel source code already supports Oreo if you want to build it yourself, but I haven't yet released an Oreo build publicly.

Im trying to complile ur oreo brunch kernel source from ur source repo with linaro gcc 7.2.

Successful compilation without any error. But after flashing zImage in my merlin with los15.1 oreo bootloader stack cant pass bootloader.

Any clue whts wrong?
 
  • Like
Reactions: lonkar

ArcherTanu

Senior Member
Jan 5, 2015
138
108
Kolkata
Im trying to complile ur oreo brunch kernel source from ur source repo with linaro gcc 7.2.

Successful compilation without any error. But after flashing zImage in my merlin with los15.1 oreo bootloader stack cant pass bootloader.

Any clue whts wrong?


Now i know whats wrong.. Im compiling old source code with out latest commits..

And till now ur not adding couatom goverbors and hotplugs..?
 
  • Like
Reactions: lonkar

ArcherTanu

Senior Member
Jan 5, 2015
138
108
Kolkata

Attachments

  • Screenshot_Settings_20190616-111555.png
    Screenshot_Settings_20190616-111555.png
    96.8 KB · Views: 472
  • Screenshot_Kernel_Adiutor_20190616-111654.png
    Screenshot_Kernel_Adiutor_20190616-111654.png
    67.7 KB · Views: 482
  • Screenshot_Kernel_Adiutor_20190616-192223.png
    Screenshot_Kernel_Adiutor_20190616-192223.png
    103.7 KB · Views: 481
  • Screenshot_Kernel_Adiutor_20190616-192230.png
    Screenshot_Kernel_Adiutor_20190616-192230.png
    80.1 KB · Views: 457
  • Screenshot_Kernel_Adiutor_20190616-192317.png
    Screenshot_Kernel_Adiutor_20190616-192317.png
    70.8 KB · Views: 445
  • Screenshot_Kernel_Adiutor_20190616-192352.png
    Screenshot_Kernel_Adiutor_20190616-192352.png
    61.7 KB · Views: 439
  • Screenshot_20190617-153006_Settings.png
    Screenshot_20190617-153006_Settings.png
    69 KB · Views: 431
  • Screenshot_20190618-133547_Kernel_Adiutor.png
    Screenshot_20190618-133547_Kernel_Adiutor.png
    72 KB · Views: 427
  • Screenshot_20190618-155012_Kernel_Adiutor.png
    Screenshot_20190618-155012_Kernel_Adiutor.png
    86.6 KB · Views: 424

saikat08

Senior Member
Jul 27, 2019
57
27
New Delhi
thanks a lot for this kernel :):) . this kernel makes a huge difference in terms of performance , and also the battery life of this phone . thanks for adding IntelliPlug CPU hotplug in it . this is the best tool to get the best battery life out of this phone i think .
with few tweaks in cpu, gpu governors ,and a little bit of underclocking of cpu with this intelliplug hotplug tweaks , this phone's battery is a beast now . :D:D
 

saikat08

Senior Member
Jul 27, 2019
57
27
New Delhi
Do you implement custom changes unto stock Squid kernel? If so, I'd like to hear what settings you tinkered with, why and how? If you don't mind me asking. Posting a battery consumption screenshot would be helpful too. I've been using Squid as-is ever since it was released and it is the best kernel I've used on osprey by a long shot.

Sure!.
I believe it mainly depends on one's usage. My everyday use consist of mainly youtube (3-4.5 hrs everyday), calling, WhatsApp, Google music, reddit, google chrome (&other apps but those are rare).

For CPU I did underclocked cpu to 1094 mhz, and set the cpu governor to conservative. (Conservative gives best battery backup i think, but performance can be slightly choppy sometimes).

For GPU I didnt underclocked or overclocked. Just changed the governor to simple-ondemand. It is similar to msm_adreno_tz (which is default). It's just msm_adreno_tz is bit biased towards performance.
(I think powersave governor will give best battery life but I tried it and even youtube videos while opening, were lagging so I sticked with simple_ondemand.

In cpu hotplugging I did set the profile to eco_conservative, which I think totally shuts down 2 cores. And also I did set the minimum cores online to 1 (2 was there by default).
I did changed the cpu threshold to 666(mhz?). I think it's the minimum cpu usage required by the 1st core before it turns the 2nd core.
I changed the hysteresis value to 5. (I have no knowledge about hysteresis, It was just random experiment).

i also use universal gms doze ( a magisk module made for better battery life )

With all these changes I'm getting more than 24hrs backup, earlier in stock MM and other pie custom Roms I had to charge 2-3 times in a day with my usage (although I never let it get down to 0%, I used to put phone on charge when it reached around 25-30% then).


I'm sure if one uses more apps, particularly games then these setting won't be good for him. But these settings fits perfect for me so far.

I'm no Dev, very new to all these, I just read forums and tried tweaking. so i think I can be wrong somewhere in these, (if anyone can correct me, that will be very helpful).

Also I can't find any online forums or websites where intelli plug tweaking Is explained. So I found I bit difficult to understand the terms. If anyone can help out with this it will be very helpful.

edit : i did changed a few more things later apart from the above changes and it is now giving me more than what i can ever ask for . :D
changes with current profile :
CPU :
set cpu freq : 400Mhz- 998 Mhz
cpu gov : conservative

intelliplug hotplug :
profile : eco conservative
touch boost : on
hysteresis value : 2
cpu threshold :665
cpu maximum screen off freq : 533 Mhz
minimum cpu online : 1

GPU
GPU freq : 200 Mhz - 310 Mhz
GPU gov : simple_ondemand

I/O scheduler : FIOPS ( for both internal & external storage )
read ahead : 1024 kB ( only internal storage as my sd card is only 8GB so the
default 128kB is ok for it )

Low memory killer :
16 MB
32 MB
64 MB ( top to bottom )
128 MB
144 MB
180 MB

earlier without these changes i felt little lagging due to eco conservative mode ( although it was ignorable ) . but after these changes in I/O scheduler and LMK i feel that lagging has reduced very much and it feels almost like buttery smooth .
also underclocking GPU to 310 Mhz doesnt really effect overall performance , but i think it somewhat helps in getting more battery backup.

ps : the screen shots are of the old configurations . if you want , then i can change it back to the latest one .

now it almost feels like my osprey got a second life . :D the battery life is too good to be true for a 3.5 year old device . thank you so much @squid2. i cant thank you enough .
 

Attachments

  • Screenshot_20190904-211906.png
    Screenshot_20190904-211906.png
    243.8 KB · Views: 343
  • Screenshot_20190905-032809.png
    Screenshot_20190905-032809.png
    122.9 KB · Views: 337
  • Screenshot_20190905-032833.png
    Screenshot_20190905-032833.png
    107.2 KB · Views: 339
  • Screenshot_20190905-032848.png
    Screenshot_20190905-032848.png
    75.3 KB · Views: 324
  • Screenshot_20190905-032911.png
    Screenshot_20190905-032911.png
    101 KB · Views: 313
Last edited:

saikat08

Senior Member
Jul 27, 2019
57
27
New Delhi
while further observing i found that out of the 5 profiles in the intelliplug hotplug :
( 1. balanced ,
2. performance,
3. conservative ,
4. eco performance,
5. eco conservative )
the eco performance & eco conservative totally shuts down 2 cores , which leaves 2 cores operational.
the eco performance is biased towards performance , and the eco conservative towards battery life , as you can guess by the name .

the balanced one is totally balanced , i.e, inbetween the performance side and the battery side . and shuts down cores when work load is not on it .and activates all cores when it is required .

performance & conservative modes enables to use all 4 cores , its just performance mode is biased towards performance and conservative mode is biased towards battery life .

( maybe i'am wrong , correct me in that case .)

i feel eco performance is better than eco conservative , as the battery backup difference is negligible between the two but the eco performance does boosts the performance a bit , when one can feel easily after switching from eco conservative to eco performance .
 
Last edited:

phool4XC

Member
Feb 6, 2020
19
13
Nexus 7 (2013)
Moto G 2015
ROM / Kernel pairing?

My thanks to @squid2 for all the contributions to LineageOS!

I've recently inherited an osprey and have been playing with it. I know that I *should* read all 87 pages in the thread to find the answer for myself, but perhaps someone can save me some time. Does the version of LOS I install matter, or is the Squid kernel tied to particular ROMs? (And if so, which ones?) I ask because when I tried flashing the kernel on a phone running LOS 17, the result was a boot loop. Thanks in advance!
 
Last edited:

IronTechmonkey

Recognized Contributor
Feb 12, 2013
9,685
16,889
My thanks to @squid2 for all the contributions to LineageOS!

I've recently inherited an osprey and have been playing with it. I know that I *should* read all 87 pages in the thread to find the answer for myself, but perhaps someone can save me some time. Does the version of LOS I install matter, or is the Squid kernel tied to particular ROMs? (And if so, which ones?) I ask because when I tried flashing the kernel on a phone running LOS 17, the result was a boot loop. Thanks in advance!

Yeah, no expectation of reading all pages but there is a reasonable expectation to read the OPs and search a bit. You can pick that low hanging fruit on your own but here's a meatball to tide you over until you find more details:

There have been one or two boundaries (Android version updates) where you must use different version of kernel on each side of the update and there are some audio related reasons a person might use one or the other kernel version depending on Android version and ROM variant. Most of what you need to kow about this is in explained in the OPs and within the newest 10-15 search results for "version".
 

phool4XC

Member
Feb 6, 2020
19
13
Nexus 7 (2013)
Moto G 2015
Yeah, no expectation of reading all pages but there is a reasonable expectation to read the OPs and search a bit. You can pick that low hanging fruit on your own but here's a meatball to tide you over until you find more details:

There have been one or two boundaries (Android version updates) where you must use different version of kernel on each side of the update and there are some audio related reasons a person might use one or the other kernel version depending on Android version and ROM variant. Most of what you need to kow about this is in explained in the OPs and within the newest 10-15 search results for "version".

Thanks for being gentle with the clue-bat. ;)
 

gg2001

Senior Member
Nov 2, 2016
70
30
Buenos Aires
My thanks to @squid2 for all the contributions to LineageOS!

I've recently inherited an osprey and have been playing with it. I know that I *should* read all 87 pages in the thread to find the answer for myself, but perhaps someone can save me some time. Does the version of LOS I install matter, or is the Squid kernel tied to particular ROMs? (And if so, which ones?) I ask because when I tried flashing the kernel on a phone running LOS 17, the result was a boot loop. Thanks in advance!
Don't know about LOS, but my osprey 2gb is still rocking a resurrection remix 5.7 (MM 6.01) with squid 23 kernel. All is running smooth and perfectly
 

Top Liked Posts

  • There are no posts matching your filters.
  • 127
    This is my "Squid Kernel" for the 2015 Moto G, codenamed osprey. It shares a common codebase with my kernels for surnia and lux. It consists of the latest Motorola MSM8916 kernel, with all the latest changes from CodeAurora and Kernel.org merged in, along with select cherry-picks and additions of my own. Flash it using TWRP. Bug reports and contributions are welcome.

    Version r22b and up require ROMs with an updated ACDB (audio calibration database) loader, such as LineageOS 14.1 builds from January 2018 and newer. If your ROM has an incompatible ACDB loader, you may experience low audio volume. Stick with version r22 for Marshmallow ROMs (including stock) and older Nougat ROMs without an updated ACDB loader.

    Disclaimer:
    This is for the 2015 Moto G (osprey and merlin) only! Don't flash it on a previous Moto G, or surnia, or lux. This kernel is provided AS-IS, with no warranties. I am not responsible for bricking your device. Flash at your own risk.

    Features:
    • Moderately undervolted
    • Updated to Linux 3.10.108
    • Synced with latest CodeAurora changes
    • Improved memory management
    • Improved memory caching backported from Linux 3.15
    • Improved storage performance
    • Optimized ARM crypto routines
    • Updated f2fs and WiFi drivers
    • FIOPS and BFQ I/O schedulers
    • Lionfish CPU governor
    • IntelliPlug CPU hotplug (by faux123)
    • KCAL MDP5 colour control (by savoca)
    • Improved zRAM backported from Linux 4.9
    • Vibration intensity control
    • Compiled with Linaro GCC 7.3 and optimized for Cortex A53
    • Stripped down and optimized configuration

    Release History:
    Code:
    r23: August 15, 2018
    - Tonnes of security patches
    - Updated binder
    - Compiled with Linaro GCC 7.3.1
    
    r22b: January 13, 2018
    - Audio driver fixes
    - Requires a ROM with an updated ACDB loader
    
    r22: January 11, 2018
    - Security patches
    - Updated camera drivers
    
    r21: December 6, 2017
    - Updated to Linux 3.10.108
    - Security patches
    - Oreo support related patches
    
    r20: August 2, 2017
    - Updated to Linux 3.10.107
    - Tonnes of security patches from many places
    - Updated sdcardfs from Google
    - Updated WiFi driver from CAF
    - Compiled with Linaro GCC 6.3.1
    
    r19: January 1, 2017
    - Added support for Nougat ROMs
    - Updated zRAM from Linux 4.9
    - Updated (optimized) FUSE from CAF
    - Kernel ASLR and many info leak fixes
    - ARM PXN support for exploit mitigation
    - Tons of security updates
    - Some CAF updated from LA.BR.1.2.9_rb1.10
    - Fixed kernel panic on VPN disconnection
    - Updated compiler to Linaro GCC 6.2.1
    
    r18: November 8, 2016
    - Tons of security updates
    - Updated to Linux 3.10.104
    - Updates from Motorola Harpia kernel
    - GPU driver latency reduction
    
    r17: August 16, 2016
    - Security updates
    - Updated to Linux 3.10.102
    - CyanogenMod compatibility updates
    
    r16g: May 16, 2016
    - Security updates
    
    r16f: April 14, 2016
    - Reverted f2fs update
    - Updated zRAM from Linux 4.4
    
    r16d: April 8, 2016
    - Security fixes
    - Vibration intensity control
    - Updated f2fs
    - Patches for CM13 compatibility
    - IntelliPlug disabled by default
    - Built with Linaro GCC 5.3
    
    r16: March 20, 2016
    - Updated to Linux 3.10.101
    - Updated to Motorola MPD24.107
    - Updated WiFi driver from CAF
    - IO optimizations under heavy load
    - Miscellaneous bug and security fixes
    
    r15b: Feburary 27, 2016
    - Updated to Linux 3.10.98
    - ARMv8 crypto related fixes
    - Use ARMv8 crypto for adopted storage
    
    r15: February 6, 2016
    - Updated to Linux 3.10.96
    - Updated f2fs from Linux 4.5
    - Kernel library optimizations
    - Improved CFQ IO scheduler
    - Improved kernel PRNG
    - ARMv8 accelerated crypto support
    - Better use of ARM instruction set
    - Added minimum CPUs parameter for IntelliPlug
    - Miscellaneous bug fixes
    
    r14b: January 23, 2016
    - Fixed low/poor call audio
    - Security fix for CVE-2016-0728
    
    r14: January 16, 2016
    - MARSHMALLOW ONLY
    - Updated to Motorola Marshmallow sources
    - Updates from CAF LA.BR.1.2.7_rb1.1
    - Security and bug fixes from Linux 3.12.52
    - Compatible with Marshmallow stock ROM
    - More than a dozen CAF security fixes
    - Miscellaneous bug fixes
    - Somewhat smoother animations
    - Experimental support for merlin
    
    r12: December 25, 2015
    - FOR CM13 ONLY!
    - Updates for latest camera driver changes
    - Updated zRAM
    - Improved memory caching scheme from Linux 3.15
    - Optimized memory allocation and management
    - Optimized CPU scheduler
    - Optimized performance event tracking
    
    r11f: December 17, 2015
    - Updated to Linux 3.10.94
    - Updated to LA.BR.1.1.3_rb1.41
    - WiFi is a kernel module
    - FOR CM13 ONLY!!!
    
    r11e: December 1, 2015
    - Fixed some cpufreq races
    - Minor bug fixes
    
    r10g: November 11, 2015
    - Patched Pronto CR-930533 vulnerability
    - Fixed possible use-after-free in zRAM
    - Updated to Linux 3.10.93
    - Compiled with Linaro GCC 5.1
    
    r10f: November 8, 2015
    - Updated to Linux 3.10.92
    - Updated to CAF LA.BR.1.1.3_rb1.36
    - Updated to Moto Maxx 2 Kernel
    - Security and stability improvements
    
    r10d: October 26, 2015
    - Fixed r10c SELinux regression on stock ROM
    
    r10c: October 24, 2015
    - Fixed encryption support
    - Patches for Android 6.0 support
    
    r10b: October 4, 2015
    - Fixed move app to SD card issue
    - Cleaned up DTBs to reduce size
    
    r10: October 3, 2015
    - Added KCAL colour control (by savoca)
    - Added optimized crypto routines for ARM
    - Updated to Linux 3.10.90
    - Optimized memory performance
    - General cleanup and optimization
    
    r9e: October 1, 2015
    - Updated to lux kernel sources
    - Updated to Linux 3.10.89
    - Updated to LA.BR.1.1.3_rb1.32
    
    r9b: September 29, 2015
    - Fixed QSEECOM keymaster firmware issue
    
    r9: September 28, 2015
    - Initial standalone release for osprey

    Downloads:
    Main downloads tab

    XDA:DevDB Information
    Squid Kernel for Moto G 2015, Kernel for the Moto G 2015

    Contributors
    squid2
    Source Code: https://github.com/sultanqasim/android_kernel_motorola_msm8916

    Kernel Special Features: undervolted, lionfish, fiops, intelliplug, latest Linux and Qualcomm fixes

    Version Information
    Status: Stable
    Current Stable Version: r23
    Stable Release Date: 2018-08-15

    Created 2015-10-02
    Last Updated 2018-08-15
    40
    Squid Kernel r20

    After a long break, I've prepared a new version of this kernel. This is mainly a maintenance release to get up to speed on security patches, as well as bring in various upstream bug fixes. This kernel is probably the best patched kernel available for this device family as of today - there are hundreds of security-relevant patches here that haven't yet made it to the LineageOS kernel. This is partly a matter of patching policy - for LineageOS, apart from ASB patches, we carefully assess necessity and impact of each change prior to inclusion, whereas here, if I see a security patch that looks relevant, I cherry-pick it without much further analysis. Backporting all these changes to to the LineageOS kernel will be a very time consuming undertaking.

    As before, the kernel should work on both Marshmallow and Nougat ROMs, and both stock and custom ROMs. The download is on the downloads tab.

    Also: merlin users rejoice! Support for your device has returned.
    34
    Squid Kernel r19

    This is a pretty big release. The headline change is added support for Nougat ROMs. This kernel is still backwards compatible with Marshmallow ROMs. I also updated to newer compiler (Linaro GCC 6.2.1). However, there are a bunch of improvements beyond just catching up the the CyanogenMod 14.1 kernel.

    Updated zRAM
    I've updated zRAM to be mostly in sync with Linux 4.9. The main change is the adoption of what is called "per-cpu compression". Essentially, instead of having a fixed number of compression threads spread across all CPU cores that are moved around by the scheduler, there is one dedicated compression stream per online CPU core. Enforcing that compression streams stay fixed on a particular CPU improves caching performance and reduces overhead. Also, compression streams are now automatically added/removed as CPU cores are onlined/offlined. These changes improve zRAM performance by a few percentage points.

    Updated FUSE
    I've cherry-picked a patch series from CAF improving FUSE, the mechanism that facilitates implementing file systems in userspace. Android uses FUSE for SD cards (when not using esdfs or sdcardfs, as is the case on CM13). One improvement I improved is called writeback caching. Traditionally, when writing to a fuse device, the kernel passes data up to the fuse daemon one (128K) chunk at a time, and write() system calls don't complete till all the chunks are passed to fuse. Now, writes are cached in kernel, allowing write() to return more quickly, and fuse then gets cached chunks at its own pace without blocking the write() system call. The other improvement is called "short-circuiting", which allows the fuse userspace to instruct the kernel driver to perform certain IO operations directly, bypassing the userspace daemon. This can reduce overhead and latency. The FUSE changes in this release likely won't be hugely noticeable given the bottleneck is usually the slow speed of SD cards, but there should be some improvement.

    Security Improvements
    As usual, I incorporated all the security patches that made it into the CM/LineageOS kernel since the last release. However, I also scoured Kernel.org and CAF to bring in dozens more security fixes missing in the CM/LineageOS kernel. I plan to upstream the important fixes into the LineageOS kernel later when I get time.

    In addition to the usual reactive security patches, this release also adds some basic exploit mitigations. Nougat introduced kernel address space layout randomization (KASLR) to increase the difficulty of exploitation. However, the kernel has traditionally had a ton of logging messages leaking memory addresses, making it ineffecive. Searching Kernel.org and CAF, I found a bunch more patches fixing kernel address leaks, making KASLR less useless. There are probably still some things that can leak addresses, and KASLR is implemented rather weakly, but something is better than nothing. Another exploit mitigation I added is support for the ARM PXN bit that can mark userspace code as not executable in kernel context. This prevents a class of exploits known as "return to user".

    I also fixed an issue disconnecting from PPTP VPNs reported by @spiked_mistborn. It was a regression introduced by a mismerge I made in r17, leading to a double free.

    For whatever reason, the XDA downloads tab appears blank when logged in with my user account, so I can’t upload to the usual spot right now. In the interim, I’ve posted a build to MediaFire: http://www.mediafire.com/file/p2x6g0h3idn8cgz/squid_kernel_r19-osprey.zip

    Finally, happy new year everyone!
    29
    Squid Kernel r23

    This is a maintenance release with lots of security fixes. It also brings binder updates to make the source more compatible with Oreo. However, the builds I've posted for r23 are still for Nougat ROMs only. I've migrated to the Linaro GCC 7.3 compiler, and fixed numerous compiler warnings in the process.
    26
    Squid Kernel r15

    This new build contains a lot of small changes that contribute to a slightly more polished overall experience. In terms of upstream updates, I brought in Linux 3.10.96 and a new f2fs version backported from Linux 4.5. Beyond that, there are a ton of cherry picks from newer Linux versions (up to 4.4). I included a ton of updates and optimizations to various parts of the kernel library (zlib, CRC, math code, list, and bitmap data structures etc). I updated the CFQ scheduler, and it now defaults to IOPS mode, making it much more competitive, and even beating BFQ and FIOPS at some benchmarks. I updated the pseudorandom number generator in the kernel to use a better algorithm and run more efficiently. I also added an extra parameter to IntelliPlug to specify the minimum number of CPUs you want online. I've set the default for this parameter to 2.

    I brought in a bunch of changes to make use of more ARM specific instructions and replaced old instruction combinations with newer more effcient assembly instructions. These are mainly micro-optimizations, but they can have a measurable impact put together. I also backported support for using the new ARMv8 crypto instructions in 32 bit mode. All our MSM8916 family ROMs are presently using Qualcomm's hardware crypto engine instead of software crypto, so you won't notice much of a difference in disk performance for encrypted storage. However, any kernel routines using software hashing or crypto will see a major speedup. Userspace code using kernel crypto can also benefit. If a ROM is compiled with Qualcomm hardware accelerated encryption disabled, you will likely see performance benefits there too. I've heard that ARMv8 accelerated software encryption tends to be faster in practice for disk encryption than Qualcomm hardware encryption, as the soft crypto is lower latency.