[Nexus 6  Original Android Development] bbedward:
Pushbullet: https://www.pushbullet.com/channel?tag=zen

But you say I'm just a friend

Project Background

First of all. I like the nexus 6. Actually, I really really like the nexus 6. I think the device from factory performs quite marvelously, especially since the 5.1 update. Because of this, I am actually pretty content with running the stock kernel. "But BB...What about INTelligentSuperBOOSTXX5MillionPOINT5MegaBlast?!?!?!? Can you add this!?". While I appreciate all the great and free work that several great individuals do for the community. I personally don't see the need to alter any of these MSM/Board drivers a whole lot - not on these latest generation of devices. Things run pretty well I think.

"Why don't you just run the stock kernel then you sick low-life waste of space?"

Because, I still think improvements can be made.

I think there's a lot of good intentions out there to make improvements in the kernel-space, BUT:

I've observed a variety of things that were prevalent a couple of years ago and that are still prevalent today. (1) A lot of small things are changed - and advertised as a huge improvement, (2) some tunables are adjusted and advertised as a huge change/improvement but end up being a regression because they were never tested, or (3) some code is merged that causes regressions and it turns out that self-inflicted bugs are being chased around.

Zen is an attempt at improving the stock kernel. That's it.

Project Summary

The Zen kernel has always been oriented at improving the experience for desktop mobile users as much as possible. This iteration of the series is no different. The goal is simple: Improve the experience.

BFS CPU Scheduler

BFS is an alternative CPU scheduler to the stock kernel's CFS. BFS features a simple single-runqueue O(n) earliest virtual deadline first design. There is no need for excessive balancing to achieve fariness on multiple runqueues - fairness is ensured by deadlines.

BFS is tweaked towards human perception. It is not a real-time scheduler (like the SCHED_DEADLINE policy/scheduling in 3.14+) nor does it use runtimes+red/black trees to figure out fairness. It uses deadlines with the 6ms rr_interval based on the fact that humans cannot detect jitters until >= 7ms.

Anyway, not going to get into it much but you may find more information in post 2, or throughout this thread (I explained a bit more details about it around page 4).

Also, check these out:

BFS FAQ

BFS Wikia

Android/MSM 3.10 BFS Port

What is different about this and the 3.10-ck1 bfs v440 patch available on ck.kolivas.org

Backport fixes and features (not SMT NICE) from up to bfs v460ish

Some of Alfred Chen's upstream synchronization and refactoring of BFS methods (linux-3.18/19-gc branch)

My own syncing with mainline as well as backporting

What does this mean

Suspend/Wake issues that were killer on bfs v440 for 3.10 are not present in this port - these issues have been resolved.

You should NEVER report any issue related to this kernel upstream. Not android, linux, or BFS related. Do not report any issues anywhere but here.

"How about the performance?"

This kernel is all about interactivity by default.

The default rr_interval is set to 6. The logic is the human eye cannot detect jitter until about 7ms. Try lowering it if you want to increase interactivity. Try increasing it to achieve higher thoroughput.

-------------------------

Zen/Shamu Features

BFS CPU Scheduler

@flar2 Wake Gestures

@savoca KCAL Screen Color Control

@imoseyon Vibration SysFS interface

USB Fastcharge Support

Fsync SysFS Interface

Overclocking support

Flar2 userspace CPU voltage control

f2fs support and latest f2fs: f2fs/dev (even with ZenyKernel zip)

FIOPS + BFQ + SIO in addition to the stock ROW, CFQ, Deadline, No-op I/O schedulers

Several misc. CAF/msm + upstream updates/fixes.

Forced encryption disabled. (Even With ZenyKernel zip)

Added init.d support (ZenyKernel is up to your existing ROM/kernel)

selinux adjustments for viper4android and other things (ZenyKernel is up to your existing ROM/kernel)

Compatible with most ROMs, use ZenyKernel zip if there's compatibility issues.

Added zRam support

MPDecision disabled by default, replaced by touchboost listener + ZenDecision 2.0

ZenyKernel based on @osm0sis AnyKernel2 to use for roms who break compatibility with stock ramdisk

I work based on real results from user experience, not numbers. I don't claim anything as a big deal if it isn't one. Zen is a no-nonsense, well-tested kernel making real improvements to interactivity in the kernel space.

---------

Releases

All of these builds are for android 5.1 and above, unless otherwise noted

Wipe /cache before flashing for best results

Versions

- Recovery Zip: Kernel+Ramdisk: Use this on a stock/stock-like rom, or on a rom without support for things like viper4android or init.d support. Flash in recovery.

- Boot.IMG: Kernel+Ramdisk: Same as recovery zip, except in the raw boot.img form. Can be flashed in fastboot, flashify, etc.

- ZenyKernel Zip: Kernel Only (+ no force encryption +f2fs support +zen settings): Will use the exact same ramdisk you already have. If you have issues with the other full versions, then dirty flash your rom and this on top of it.

3.10-zen21 "Cheap and Easy"

Changes:

Compile with GCC 5.1

Several bcmdhd/wifi driver updates

Misc. CAF updates

Fix come cores sticking to performance governor

3.10-zen21 Recovery Zip Download

3.10-zen21 boot.img (install via fastboot/twrp IMG) Download

3.10-zen21 ZenyKernel Zip (Use on top of ROM dirty flash if issues with the above two)

Legacy Releases

3.10-zen20_rev2 "Grad Party"

Changes:

Disable MPDecision by default

ZenDecision 2 - Driver to ensure all cores are online when they are supposed to be online (tunables in /sys/kernel/zen_decision)

TouchBoost generic interface from franco, but modified for globalization

CPU-BOOST: Strip all existing input_boost functionality, use the existing parameters for the new touchboost interface

Slub: Update to newer upstream version of the mem. allocator ported by [MENTION=4517211]XileForce[/MENTION]

OC: Add 3.09GHz support (requires v2 of zen_max_freq zip)

msm_hsic wakelock slider...

f2fs: numerous upstream updates

conservative: add franco's twostep counter functionality

conservative: adjust default settings

interactive: adjust default settings

ondemand: Update frequency decision making from upstream

ondemand: Adjust defaults to be less aggressive

BFQ default I/O scheduler - based on significant interactivity improvement benchmarks on solid state and emmc memory.

rev1 fixes issue setting bat_threshold_ignore in ZenDecision

rev2 fixes issues with f2fs

3.10-zen20 Recovery Zip Download

3.10-zen20 boot.img (install via fastboot/twrp IMG) Download

3.10-zen20 ZenyKernel Zip (Use on top of ROM dirty flash if issues with the above two)

3.10-zen19 "Show Stopper"

Changes:

Revert to MPDecision by default. I don't have the time to fully implement a replacement ATM

BFS: Sync try_to_wakeup_* and ttwu_*

BFS: Replace resched_task with resched_curr

BFS: add soft_affined flag

BFS: sync context_switch and finish_task_switch

F2FS: Numerous upstream updates

MSM/KGSL: CAF Fixes/Updates

MSM/MDSS: CAF Fixes/Updates

MSM/mmc: CAF Fixes/Updates

MSM/vidc: CAF Fixes/Updates

MSM/QoS: CAF Fixes/Updates

Misc general upstream updates

Wake Gestures: Disable haptic by default

3.10-zen19 Recovery Zip Download

3.10-zen19 boot.img (install via fastboot/twrp IMG) Download

3.10-zen19 ZenyKernel Zip (Use on top of ROM dirty flash if issues with the above two)

3.10-zen18 "Think Twice"

Changes:

Disable MPDecision by default

Delegate MPDecision's input boosting (raising min_freq) to cpu-boost

Default cpu-boost touch boost set to 2s @ 1.497GHz, configurable in user space

ARM Updates

Some BFS updates

Fair Queue packet scheduler (Queue discipline)

Heavy-Hitter Filter Qdisc

PIE AQM Qdisc

I/O Scheduler: Change default deadline scheduler settings

I/O Scheduler: Add simple I/O scheduler v0.3 (user request - default remains CFQ)

ARM/Crypto: optimized SHA-256/224 (faster encryption performance)

Kcal updates

F2FS updates from upstream

Standard ramdisk support for CM12.1 and friends

The net schedulers are probably useless to the average user, but harmless. A couple people who like to play with network stuff may want to play around with them by using the "tc" command. If you aren't sure you don't need to do anything :silly:

3.10-zen18 Recovery Zip Download

3.10-zen18 boot.img (install via fastboot/twrp IMG) Download

3.10-zen18 ZenyKernel Zip (Use on top of ROM dirty flash if issues with the above two)

3.10-zen17 "Epidemic"

Changes:

Fix GPU frequency displaying low power modes

MDSS/Panel: misc. updates

MM: Misc upstream updates

CPUFreq: General CPUFreq driver updates/fixes

CPUFreq/Interactive: Numerous updates

BCMDHD: Reduce packet timeout, supposed to reduce wlan_rx wakelock

MSM/Power: quickwakeup driver from motorola + implementation

MSM/PM: Replace BUG_ON usage with correct solutions

AnyKernel: Remove device check, some devices that identified as something besides "shamu" had issues flashing.

3.10-zen17 Recovery Zip Download

3.10-zen17 boot.img (install via fastboot/twrp IMG) Download

3.10-zen17 AnyKernel Zip (Use for CM 12.1 or other roms that change ramdisk/sepolicy things)

3.10-zen16 "Yippee Ki-Yay"

Changes:

Revert ext4/3.18 backport which caused periodic lockups.

Merge up ext4 from v3.10.74 in lieu of the above

Add faux sound support

Adaptive LMK default

msm: vid coder possible null pointer fix from CAF

msm: mdss/panel fixes from CAF

kmemleak reporting improvements from upstream

3.10-zen16 Recovery Zip Download

3.10-zen16 boot.img (install via fastboot/twrp IMG) Download

3.10-zen16 AnyKernel Zip (Use for CM 12.1 or other roms that change ramdisk/sepolicy things)

3.10-zen15 "Unbroken"

Changes:

All the great changes of zen14 except without the BFS LLC cpumask selection - was an issue causer

Updated kcal (I forgot to merge into 14)

3.10-zen15 Recovery Zip Download

3.10-zen15 boot.img (install via fastboot/twrp IMG) Download

3.10-zen14 "Flight School"

Changes:

BFS: Full cpumask LLC cpu selection from -gc

BFS: Some trivial cleanups and fixes

Sched/BFS: Brought in the scheduler attr stuff from v3.14

rtmutex: deadlock detect fixes from upstream, prio. boost support for __setscheduler

Everything: Dozens and dozens of relevant i2c/usb/pinctrl/others race condition fixes, memory leak, deadlock fixes, etc. from upstream v3.10.y (without pulling it all I cherry picked relevant stuff)

VMA cache from upstream

ARM fixes from v3.10.y

Asynchronous I/O updates and unnecessary plug I/O removed for SSDs

Just dumped all my KGSL changes and sync'd with newest stuff from leankernel because i was too lazy to bisect and determine what was causing random page faults (they may still be there, they are on stock kernel too)

MSM: Updated sound soc

CM12.1 and friends AnyKernel zip added

3.10-zen14 Recovery Zip Download

3.10-zen14 boot.img (install via fastboot/twrp IMG) Download

3.10-zen14 AnyKernel Zip (Use for CM 12.1 or other roms that change ramdisk/sepolicy things)

3.10-zen12 "On top of the World"

Changes:

BFS: Sync up some tick accounting from upstream

LEDS: Merge in 13 or so patches. Fixes bugs such as concurrency issues as well as adds some features

MDSS: Merge in over a dozen patches, refactorizations, and bug fixes

Crypto: Update NEON/AES module

3.10-zen12 Recovery Zip Download

3.10-zen12 boot.img (install via fastboot/twrp IMG) Download

3.10-zen11 "Too Fast, Too Furious"

Changes:

Fix a bug in modem that I created

BFS: Add grq lock for priodl (alfred chen -gc)

BFS: Fix a potential bug but probably not in __schedule

Proc/MMU: Merged a bug fix and cleanup patchset.

3.10-zen11 Recovery Zip Download

3.10-zen11 boot.img (install via fastboot/twrp IMG) Download

3.10-zen10 "Interstellar"

Changes:

Reverted the red/black tree change to LowMemKiller. I observed some issues with it, perhaps I was missing fixes for it. Certainly the RBTree selection is much faster than the previous iterative method. But how much do we really care about the performance of LMK with 3GB ram?

Upstream CFQ bug fixes

(1) SMP: Added wake_up_all_idle_cpus function

(2) BFS: Added wake_up_if_idle function

(3) CPUIdle: Use wake_up_all_idle_cpus instead of old kick_all method. Should result in reduced cpuidle latency/better performance

Adreno: revert to stock wake-up latency of 490, from 101.

3.10-zen10 Recovery Zip Download

3.10-zen10 boot.img (install via fastboot/twrp IMG) Download

3.10-zen9 "Sunshine and Whiskey"

Changes:

Completely rebased my entire tree. Based on stock/msm tree again.

Pulled in all VM/MM updates from linux-3.10.y

Updated f2fs to latest f2fs/dev.git (Up to "f2fs: do not recover wrong data index")

Fix a KGSL bug that would result in page faults

Updated MSM V4L2 video driver (msm: vidc)

Misc. updates throughout the kernel and MSM to resolve potential memory leaks

Built a new compiler from latest linaro, building with that now instead of my antique one.

3.10-zen9 Recovery Zip Download

3.10-zen9 boot.img (install via fastboot/twrp IMG) Download

3.10-zen8 "Notorious Z"

Changes:

Repair self-inflicted wounds

KGSL+Adreno fixes

Buy food for phil the cat

Buy coffee

Pick up jacket from dry cleaner

3.10-zen8 Recovery Zip Download

3.10-zen8 boot.img (install via fastboot) Download

3.10-zen7 "Space Bound"

Changes:

BFS: fix hotplug bug related to affinity set/get

block: Add FIOPS I/O scheduler

ARM: numerous upstream updates/fixes

MSM: usb/bam numerous fixes

MSM: mdss numerous fixes

MSM: kgsl numerous fixes

MSM: camera numerous fixes

3.10-zen7 Recovery Zip Download

3.10-zen7 boot.img (install via fastboot) Download

3.10-zen6 "Morning After"

Changes:

qcom-cpufreq allow a boot parameter to specify max_freq, which determines how to populate the frequency table. By default it is the stock 2.6GHz. If you use the aroma zip at the end of this post you can choose up to 3.03GHz. This kernel code/method is from @flar2 I only made minor/trivial changes to it and hacked up the aroma so people can change the boot parameter easily..

Changed f2fs mount options again, for more stability

3.10-zen6 Recovery Zip Download

3.10-zen6 boot.img (install via fastboot) Download

3.10-zen5_rev1 "Day Drinking Sunday = Rough Monday"

Changes:

Added kexec-hardboot support for multirom

Adjusted f2fs default mount options (nobarrier on /data) (inline_dentry, extent_cache on /data and /cache). Zen4 f2fs was acting really slow, this fixes it

Build f2fs with security labels for selinux

Added BFQ v7r7

Added 2.95GHz and 3.03GHz overclock steps

BFS: refactor sched_init_smp

BFS: cleanup/remove unused above_background_load function

3.10-zen5 Recovery Zip Download

3.10-zen5 boot.img (install via fastboot) Download

3.10-zen4 "Bottoms Up"

Changes:

Merged v3.10.73 from linux-stable/linux-3.10.y

Overclock to 2.9GHz

Userspace voltage control from flar2

f2fs support and latest f2fs/linux-3.10 merged

ext4 3.18 backport, from ext4/backport-for-3.10

BFS rr_interval set back to default of 6

Several CAF KGSL/MDSS Fixes/Improvements

I/O Deadline some tweaks

3.10-zen4 Recovery Zip Download

3.10-zen4 boot.img (install via fastboot) Download

3.10-zen4 boot.img (use for f2fs, has security labels for selinux - Zen4 forgot to include it)

3.10-zen3 "Walking Tall"

Changes:

Fixed issue with KCAL app caused by zen2 ramdisk changes

Reverted culprits of random OOPs' and PANIC issues

Added vibration sysfs interface (same one as leanKernel)

Support for frequency mitigation (from imoseyon). If you just want to change the battery throttling I suggest you see post #2 instead though

1 misc. change

Internal changes that make me feel good inside

3.10-zen3 Recovery Zip Download

3.10-zen3 boot.img (install via fastboot) Download

3.10-zen2 "Where is the love?"

Changes:

Synced up some ramdisk stuff from imoseyon for other rom/CM compatibility

Added a fix from v3.10.51 to fix random oops' caused by my compiler

3.10-zen2 Recovery Zip Download

3.10-zen2 boot.img (install via fastboot) Download

3.10-zen1 "Dollar Drink Night"

3.10-zen1 Recovery Zip Download

3.10-zen1 boot.img (install via fastboot) Download

ZenDecision (zen20+)

You can still turn on MPDecision without any ill effects if desired

As of 5.1+ MPDecision is somehow responsible for at least the following:

Raise MIN_FREQ to 1497MHz for 3 seconds on touch events

Ensure CPUs come online after certain events, like thermal events (due to low battery for example)

User configurability is sacrificed when it is enabled. For example: changing minimum CPU frequency is not possible, nor is changing the touchboost frequency or duration possible. Simply disabling MPDecision results in the permanent disabling of CPUs in certain situations (until the user either reboots, or manually turns them on again).

ZenDecision is a simple "handler" for to keep CPUs online by the following logic:

When screen comes on, make sure all CPUs are online if current battery level is above bat_threshold_ignore

Simple, not a complete replacement for MPDecision. Just a handler for the event of cores never coming back online. Touchboosting is now configurable through the standard cpu-boost module parameters.

ZenDecision tunables (/sys/kernel/zen_decision/):

enabled (0=disabled, 1=enabled): Enable/Disable the driver from doing any work

wake_wait_time (0-60000 ms, 1000 by default): How long to wait to execute CPU_UP work after screen comes online.

bat_threshold_ignore(1-100, 0=disabled, 15 by default): The battery percentage to ignore CPU_UP operations. If current battery level is below this level, then the driver is essentially disabled.

How to enable overclocking (zen6+)

If your device is unstable at the overclocked frequencies, it is a hardware limitation with your device. Do not report it as a bug

To enable overclocking on zen6 or newer, you will need to use the recovery zip/aroma below.

You choose the max frequency you want, it pulls the boot.img from the device, adds a boot parameter specifying the OC frequency.

If you are not on zen6 or newer it will have no affect.

This does not install a kernel, you still have to install the kernel from one of the links above

Zen Overclock Enable v2

3.09GHz step only supported on zen20+

Thanks guys, and enjoy. Feedback is always appreciated.

XDA:DevDB Information

Zen Kernel, Kernel for the Nexus 6

Contributors

bbedward, purian23

Source Code: https://github.com/bbedward/ZenKernel_Shamu/

Kernel Special Features: Android/MSM BFS Port, kcal, gestures, cool stuff

Version Information

Status: Stable

Current Stable Version: 21

Stable Release Date: 2015-05-20

Created 2015-03-24

Last Updated 2015-05-20