Giter Club home page Giter Club logo

ktweak's Introduction

KTweak

A no-nonsense kernel tweak script for Linux and Android systems, backed by evidence.

Another "kernel optimizer"?

No. Well, yes. However, a "kernel optimizer" is a poor way to put it. KTweak performs kernel adjustments based on facts and evidence, unlike other optimizers with poorly written or heavily obfuscated code.

  • NFS Injector uses closed source, compiled binaries with various typos in the README. It also provides a "pro" version that costs money.
  • MAGNETAR also uses closed source, compiled binaries. I'd love to say more about this, but I can't even find out what the module even does.
  • FDE.AI also uses closed source, compiled binaries with a paid variant.
  • LKT sets random nonsensical build.props that don't even exist.
  • ZeetaTweaks is a clone of KTweak with the values changed. As of the V11 zip, it disables essential system services, deletes files permanently from /data/data, kills perfd (which is the userspace boosting daemon), disables SELinux, disables fsync, and various other detrimental changes.

What's different about KTweak?

Unlike other "kernel optimizers", KTweak is:

  • Entirely open source with no compiled components
  • Concise, at less than 200 lines long
  • Backed by benchmarks and evidence
  • Designed by an experienced kernel developer
  • Non-intrusive and completely systemless

Benchmarks

The following benchmarks were performed on a OnePlus 7 Pro running the stock kernel provided by the OEM on Android 10. KTweak sacrifices throughput for latency, since latency correlates to UI / UX smoothness. This explains the slight regression with the scheduler throughput.

Scheduler latency via schbench (lower is better)

  • Stock: 50.0th: 4052 75.0th: 14288 90.0th: 26848 95.0th: 32960 *99.0th: 45120 99.5th: 49856 99.9th: 59200 min=0, max=73600

  • KTweak: 50.0th: 1054 75.0th: 1790 90.0th: 2628 95.0th: 3836 *99.0th: 8880 99.5th: 11472 99.9th: 18080 min=0, max=32781

Synthmark Latencymark (lower is better)

  • Stock: 10 / 12
  • KTweak: 4 / 4

Scheduler throughput via perf bench sched messaging (lower is better)

  • Stock: 0.331 seconds
  • KTweak: 0.808 seconds

Scheduler throughput via perf bench sched pipe (lower is better)

  • Stock: 16.159 seconds
  • KTweak: 18.599 seconds

The Tweaks

Head over to the script itself to learn what everything does. It is documented in the comments.

Contact

You can find me on telegram at @tytydraco. Feel free to email me at [email protected].

Join the releases channel at @ktweak, or the discussion channel at @ktweak_discussion.

ktweak's People

Contributors

frap129 avatar tytydraco avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ktweak's Issues

Question.

How doI know if your tweaks is really working on my phone? there's a log? sorry for my english :)

Feature suggestions

Here are a few things you can to Ktweak, these are mostly debugging related.

write /proc/sys/kernel/printk 0 0 0 0

write /sys/kernel/debug/debug_enabled N

write /sys/module/binder/parameters/debug_mask 0

write /sys/module/lowmemorykiller/parameters/debug_level 0

write /sys/module/rmnet_data/parameters/rmnet_data_log_level 0

write /sys/module/subsystem_restart/parameters/enable_ramdumps 0

write /proc/sys/fs/dir-notify-enable 0

write /proc/sys/vm/oom_dump_tasks 0

write /proc/sys/kernel/hung_task_timeout_secs 0

write /proc/sys/vm/reap_mem_on_sigkill 1

Patch custom ROMs

I'm very interested in these tweaks but I don't use any kind of root or systemless root like Magisk. Are those available in the form of a patchset or something that can be included in a custom build process? I imagine that, anyway, I could simply copy the parameters to my kernel config before building. But I've seen that some parameters are changed dynamically during execution, so I assume the script you made needs to be included in system.

Do KTweak changes remain after uninstalling it?

I installed it and I had issues at shut down -had to keep shutdown button pressed to turn off.
I uninstalled it and I noticed my SSD driver led keeps working -even when I run nothing.
Do I need to manually uninstall everything, and how?

Power saving focused configuration

As far as I know, this script performs various configuration on the kernel to focus on performance by setting multiple parameters of the scheduler. And it actually looks promising

I suggest creating a power-saving-only variant of this script. I think that many many people would be interested on this.

Comparisons between different branches?

Hi there! I'm talking a look at this, and I see you have different branches, throughput, latency, and balanced, which is fair enough. Though where does "budget" come in? And how would one tweak these parameters in a way that limits power consumption?

My knowledge on how the kernel does things is.... High level... At best so some explanation on what some of these tweaks are supposed to achieve would be really appreciated

Make the readme.md more informative

Sir bro update the readme.md to show in detail all tweaks Ktweak applies, why it applies and what we can gain from changing the parameter. For example:

/proc/sys/kernel/perf_cpu_time_max_percent: 25 -> 5

This is the maximum CPU time long perf event processing can take as a percentage. If this percentage is exceeded (meaning perf event processing used too much CPU time), the polling rate is throttled. This is reduced from 25% to 5%. We can afford inaccuracies with perf events in exchange for more time that a foreground task can use.

This will make Ktweak different from other optimizers which just says "CPU/GPU optimized and ram improved".

[Question] about the fair swapiness

Hello there, I've been looking into the nice script within this repo when something struck me as a bit weird.

The swapiness is set to 100 which as far as I know is the maximum value available.
However, the comment state "swap at a fair rate" which seems weird.

I feel like I'm missing a piece of the puzzle here and would appreciate to be enlightened on how this value was chosen 😄

Issue w/ new branch "magisk"

I noticed a new branch "magisk", does this branch use a magisk module? Also, how does this branch compare to the branches listed above? Lastly, it seems the branch is bugged, it throws an error every time I try to update the script.

Screenshot_20211126-105626.png

Why there are no releases?

Hello, why there are no releases? They used to be there and I used it to install new versions. How are we supposed to install KTweak now?

Couple branches don't load

I'm using the Google Play store copy & having one small issue. Only the balance branch seems to work. Budget, latency & throughput all return "unable to find script" error message

Manual install

Hi. I have Android 5.1 and not found KTweak on Google Play.
How i can get/apply this script alternative, manually?
I can run from terminal, etc.?
Thanks

CPU Govenor

The Interactive CPU Govenor you set, is causing my Phone to autostart whenever i plug it into a charger in its fully off state.

Sss

Gaahusiwownsbhiddu

Lost fingerprint feature

I installed version 1.1.2 on my Oneplus 7T running OxygenOS Open Beta 7.

After install and reboot, I lost access to the fingerprint scanner. The fingerprint logo was not displayed on the screen and putting the finger at the right place would not work. I also had a UI restart.

All of this was solved after disabling the module in Magisk.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.