[Q]Overclocking - AT&T Samsung Galaxy S II SGH-I777

I'm planning on overclocking my device by modifying the init.doh script. I have made the modifications as follows:
Code:
#!/system/bin/sh
sleep 5
# ===================
# Max CPU
# ===================
echo "1504000" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
# ===================
# Min CPU
# ===================
echo "200000" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq
# ===================
# Undervolting
# ===================
echo "1425 1300 1200 1100 1000 950 900 900 " > /sys/devices/system/cpu/cpu0/cpufreq/UV_mV_table
# ===================
# CPU Table
# ===================
echo "1600 1400 1200 1000 800 500 200 100" > /sys/devices/system/cpu/cpu0/cpufreq/freq_table;
# ===================
# Governor
# ===================
echo "lulzactive" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
^This is the section of the script I've made modifications to.
As you can see I've OC'ed to 1.5GHz and changed governor to Lulzactive, to see if I can get it stable here as 1.6 causes lockups and crashes.
Did I do it right? Do I need to add 1504 to the respective spots in the cpu frequency/undervolt lists?
Any help is appreciated.
Please don't say to use Setcpu or something. I want to learn something here

Is it possible to oc to 1.5G? I thought the steps above 1.2G are 1.4G and 1.6G. The in between frequencies are physically possible? If not, using those number is not going to be useful I guess?

dineshbabumm said:
Is it possible to oc to 1.5G? I thought the steps above 1.2G are 1.4G and 1.6G. The in between frequencies are physically possible? If not, using those number is not going to be useful I guess?
Click to expand...
Click to collapse
Its possible. I found a stable overclock too
You go off of the most stable setting you can find and add increments of 8 until you find a spot where there's a good balance of stability and speed.
For me it was 1496
Mod can close this now.

Related

[Q] CPU Speed?

I'm currently using Viperrom 1.3 Rom along with Silverneedle test5 kernal, I would like to know how can I check to see what my cpu speed is currently without using something like SetCPU. I'm not 100% sure but I believe something like SetCPU will affect the cpu tweaks that were incorporated along with viperrom's vipercontrol 1.1.
Read the viper ROM post. It explains how to do everything.
Believe it or not, i've read it all front to back... It's been one heluva week since I got my evo 3D. That's why I know that SetCpu which could read the current Cpu speed would affect the vc script. It would actually disable vc because of how he has it set up. vc can sense if other OC daemons or such are installed and it now disables itself. I just want to see the current cpu cycles. I would post there but i'm currently limited because of post count. I've been looking for something that just says, your cpu is currently at ####mhz or so but it doesnt do or affect anything else.
in a terminal emulator type in:
Code:
su
cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq << current frequency
cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq << max frequency
cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq << min frequency
cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_governors << available governors
cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor << current governor
After su just type in any cat command to see what they are.
smokin1337 said:
in a terminal emulator type in:
Code:
su
cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq << current frequency
cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq << max frequency
cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq << min frequency
cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_governors << available governors
cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor << current governor
After su just type in any cat command to see what they are.
Click to expand...
Click to collapse
OIC Thanks now i get what those were for, browsed past them in my journeys.
Last question, can each line be scripted? like a ?batch? file i can click on in esxplorer that will run in the superuser app or ran from within the superuser app?

[REF] Useful init.d scripts

In the process of trying to improve my kernel, I've found that some of the potential improvements available for various kernels are sysfs tweaks that can be achieved in init.d - Some of these are things I was semi-aware of but didn't have the time to play around with until recently.
I'm going to start an archive of various scripts, categorized by "safe", "should be OK", and "dangerous but high payoff".
This post will link to individual posts in the thread, each with their own script.
For short scripts, I will simply put them here as code that can be copied and pasted, allowing for easier review and discussion. For longer scripts, I will attach them. I have started including downloadable versions of each script to avoid CR/LF issues. It is not possible to upload an attachment without an extension - before installing any attached scripts, you must remove the .txt extension
To install a script:
Put the contents into a file. I suggest an editor that can save in UNIX format (different linefeeds than DOS...)
Save the file - Save it without any extension. e.g. "governor_ondemand", not "governor_ondemand.sh"
Push the file as follows:
Code:
adb remount
adb push <file> /system/etc/init.d/<file>
adb chmod 755 /system/etc/init.d/<file>
The current script list:
Setting a CPU governor on boot
Remount all partitions with noatime
Disable per-file fsync()
Tweak I/O scheduler
Increase ext4 commit interval
Filesystem cache settings
Enabling AFTR (Exynos Only)
GPU Clock/Voltage Control (Exynos Only)
Setting a CPU governor on boot
This one's simple, and mainly for ROM developers. It sets the CPU governor as desired upon bootup. Most users will just use SetCPU instead.
Safety category: SAFE
Code:
#!/sbin/sh
log "Changing governor to ondemand"
echo "ondemand" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
Replace "ondemand" with the supported governor of your choice
Remount all partitions with noatime
One feature of ext4 is an "access time" attribute per file, aka atime. This attribute is not useful to very many people (mainly, I think, those doing security audits of sensitive systems). Updating the access time can slow filesystem access down.
The following script (Credit goes to gokhanmoral of SiyahKernel for this one) will remount all partitions with noatime set.
Safety category: SAFE
Code:
#!/sbin/sh
for k in $(/sbin/busybox mount | /sbin/busybox grep relatime | /sbin/busybox cut -d " " -f3)
do
sync
/sbin/busybox mount -o remount,noatime $k
done
Edit: garyd9 has pointed out that this may not actually be very beneficial - /data is already mounted noatime, doesn't matter on /system since that's read-only.
Enabling AFTR
AFTR is a deep-idle state supported by Exynos CPUs - it turns out that it is disabled by default. This script enables it. Credit to gokhanmoral of SiyahKernel for discovering this.
It is somewhat disconcerting that this feature is disabled by default and prints out a lot of debugging info by default. It may have issues. As a result,
Safety Category: SHOULD BE OK
Code:
#!/sbin/sh
log "Enabling AFTR"
echo "3" > /sys/module/cpuidle/parameters/enable_mask
Note that AFTR will cause your dmesg log to be spammed quite a bit by default. Daily Driver 12/8/2011 and newer have a fix for this, as do newer SiyahKernel releases.
This script is OBSOLETE on Daily Driver 1/29/2012 and later releases. AFTR is enabled by default on them.
Disable per-file fsync()
This capability is currently only supported in my kernel and (I think) knzo's void series for the I9100. It is based on patches from Andrea Righi (arighi). It disables per-file sync(), so that even if an application asks for data to be immediately flushed to disk, it won't be. This is most obvious with sqlite - this achieves the same goals as the modded sqlite you see in some tweaks, but in a runtime-controllable fashion.
However, this means that in a crash, you are much more likely to have unwritten database data. This can do things like cause a database to become corrupt, leading to force close loops. I had it happen all the time on xdandroid due to the way xdandroid handled filesystem writes on loop mounts.
Safety category: DANGEROUS (but potentially high payoff in database I/O workloads - this one is good for around 600 points of Quadrant epeen, for example)
Code:
#!/sbin/sh
log "Disabling per-file fsync()"
echo "1" > /sys/module/sync/parameters/fsync_disabled
Tweak I/O scheduler
This changes filesystem I/O scheduler parameters, and also changes the I/O scheduler if desired. This was included in many Infuse kernels, and is currently included in Daily Driver - However, as I believe that the user should have as much control as possible, this script will be removed from DD in favor of living "outside the kernel" where it should be within 1-2 releases.
While I discovered it in the Infuse community, its origin appears to be Bonsai.
Right now it defaults to BFQ. Change the "SCHEDULER=bfq" line to noop, deadline, or cfq as desired.
Safety category: SAFE (After all, it's been in DD almost since the beginning)
Code:
#!/sbin/sh
#
# Copyright (C) 2011 Free Software Foundation, Inc.
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU Library General Public License as published
# by the Free Software Foundation; either version 2, or (at your option)
# any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU Library General Public
# License along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
# USA.
#
# License GPLv2+: GNU GPL version 2 or later <http://gnu.org/licenses/gpl.html>
#
#################################
# BonsaiROM
#################################
MMC=`ls -d /sys/block/mmc*`
SCHEDULER=bfq
# Optimize non-rotating storage;
log "INIT.scheduler BEGIN:setting scheduler parameters for $SCHEDULER"
case "$SCHEDULER" in
noop)
for i in $MMC; do
echo "noop" > $i/queue/scheduler
done
;;
deadline)
for i in $MMC; do
echo "deadline" > $i/queue/scheduler
echo 80 > $i/queue/iosched/read_expire # untested
echo 1 > $i/queue/iosched/fifo_batch # untested
echo 1 > $i/queue/iosched/front_merges # untested
done
;;
cfq)
for i in $MMC; do
echo "cfq" > $i/queue/scheduler
echo "0" > $i/queue/rotational
echo "1" > $i/queue/iosched/back_seek_penalty
echo "1" > $i/queue/iosched/low_latency
echo "3" > $i/queue/iosched/slice_idle
echo "4096" > $i/queue/read_ahead_kb # default: 128; (recomended: 128)
echo 1000000000 > $i/queue/iosched/back_seek_max
echo "16" > $i/queue/iosched/quantum # default: 4 (recomended: 16)
echo "2048" > $i/queue/nr_requests # default:128 (recomended: 2048)
done
echo "0" > /proc/sys/kernel/sched_child_runs_first
;;
bfq)
for i in $MMC; do
echo "bfq" > $i/queue/scheduler
echo "0" > $i/queue/rotational
echo "1" > $i/queue/iosched/back_seek_penalty
echo "3" > $i/queue/iosched/slice_idle
echo "2048" > $i/queue/read_ahead_kb # default: 128
echo 1000000000 > $i/queue/iosched/back_seek_max
echo "16" > $i/queue/iosched/quantum # default: 4 (recomended: 16)
echo "2048" > $i/queue/nr_requests # default:128 (recomended: 2048)
done
;;
*)
log "INIT.scheduler ERROR:failed to set parameters for unknown scheduler: $SCHEDULER"
exit -1;
;;
esac
log "INIT.scheduler END:setting $SCHEDULER scheduler parameters"
Increase ext4 commit interval
This script increases the ext4 commit interval to 20 seconds (Default: 5) - by delaying journal writes longer, it can help performance, but lengthens the window during which a crash will cause unwritten data to be lost.
Credit goes to gokhanmoral of SiyahKernel for this one
Safety category: SHOULD BE OK
Code:
#!/sbin/sh
log "Increasing ext4 commit interval to 20 seconds
for k in $(/sbin/busybox mount | /sbin/busybox grep ext4 | /sbin/busybox cut -d " " -f3)
do
sync
/sbin/busybox mount -o remount,commit=20 $k
done
Filesystem cache settings
This one will be an external link. There are choices - battery-optimized or performance-optimized.
http://www.android-devs.com/?p=31
Safety category: SAFE
Excellent write up, thanks for sharing. Just a note, I think you typoed post #4 from post #2 (the code part).
Ken
Entropy512 said:
One feature of ext4 is an "access time" attribute per file, aka atime. This attribute is not useful to very many people (mainly, I think, those doing security audits of sensitive systems). Updating the access time can slow filesystem access down.
The following script (Credit goes to gokhanmoral of SiyahKernel for this one) will remount all partitions with noatime set.
Safety category: SAFE
Code:
#!/sbin/sh
for k in $(/sbin/busybox mount | /sbin/busybox grep relatime | /sbin/busybox cut -d " " -f3)
do
sync
/sbin/busybox mount -o remount,noatime $k
done
Click to expand...
Click to collapse
Thank you soo much for this script, Entropy!
ran it and noticed within moments ....
guys in the forum just a heads up ... in case you hadn't thought of it ... for ease of managing these scripts, you can download rom toolbox pro and enter a script (i think they're here for us to copy straight in to Terminal() + save new scripts etc etc. very convenient
Entropy512 said:
One feature of ext4 is an "access time" attribute per file, aka atime....
Click to expand...
Click to collapse
I'm surprised this is not off by default in Android. noatime is one of the first things recommended to turn off on file-operation-busy unix servers...
*redundancy edit*
Entropy512 said:
AFTR is a deep-idle state supported by our CPU....
Code:
#!/sbin/sh
log "Changing governor to ondemand"
echo "ondemand" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
...
Click to expand...
Click to collapse
the code above changes governor... is this a typo?
---------- Post added at 10:56 PM ---------- Previous post was at 10:47 PM ----------
Entropy512 said:
This script increases the ext4 commit interval to 20 seconds (Default: 5)
Click to expand...
Click to collapse
I wonder if anyone has confirmed real-life benefit of this? I mean it's a phone on (essentially) SSD drive with relatively little disk IO (especially on write) right?. It's not like we run Oracle on spindles where postponing commit longer may present kernel a chance to optimize/re-order IO operations with disks for better performance (but unsafer)....
vladm7 said:
I'm surprised this is not off by default in Android. noatime is one of the first things recommended to turn off on file-operation-busy unix servers...
Click to expand...
Click to collapse
Surprising
You can use terminal but.pretty sure They are for scripts in system/etc/init.d
You can use script manager if.your kernel does not support init.d
Amplified said:
Thank you soo much for this script, Entropy!
ran it and noticed within moments ....
guys in the forum just a heads up ... in case you hadn't thought of it ... for ease of managing these scripts, you can download rom toolbox pro and enter a script (i think they're here for us to copy straight in to Terminal() + save new scripts etc etc. very convenient
Click to expand...
Click to collapse
Sent from my SAMSUNG-SGH-I777 using xda premium
Entropy512 said:
This changes filesystem I/O scheduler parameters, and also changes the I/O scheduler if desired. This was included in many Infuse kernels, and is currently included in Daily Driver - However, as I believe that the user should have as much control as possible, this script will be removed from DD in favor of living "outside the kernel" where it should be within 1-2 releases.
While I discovered it in the Infuse community, its origin appears to be Bonsai.
Right now it defaults to BFQ. Change the "SCHEDULER=bfq" line to noop, deadline, or cfq as desired.
Safety category: SAFE (After all, it's been in DD almost since the beginning)
Code:
#!/sbin/sh
#
# Copyright (C) 2011 Free Software Foundation, Inc.
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU Library General Public License as published
# by the Free Software Foundation; either version 2, or (at your option)
# any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU Library General Public
# License along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
# USA.
#
# License GPLv2+: GNU GPL version 2 or later <http://gnu.org/licenses/gpl.html>
#
#################################
# BonsaiROM
#################################
MMC=`ls -d /sys/block/mmc*`
SCHEDULER=bfq
# Optimize non-rotating storage;
log "INIT.scheduler BEGIN:setting scheduler parameters for $SCHEDULER"
case "$SCHEDULER" in
noop)
for i in $MMC; do
echo "noop" > $i/queue/scheduler
done
;;
deadline)
for i in $MMC; do
echo "deadline" > $i/queue/scheduler
echo 80 > $i/queue/iosched/read_expire # untested
echo 1 > $i/queue/iosched/fifo_batch # untested
echo 1 > $i/queue/iosched/front_merges # untested
done
;;
cfq)
for i in $MMC; do
echo "cfq" > $i/queue/scheduler
echo "0" > $i/queue/rotational
echo "1" > $i/queue/iosched/back_seek_penalty
echo "1" > $i/queue/iosched/low_latency
echo "3" > $i/queue/iosched/slice_idle
echo "4096" > $i/queue/read_ahead_kb # default: 128; (recomended: 128)
echo 1000000000 > $i/queue/iosched/back_seek_max
echo "16" > $i/queue/iosched/quantum # default: 4 (recomended: 16)
echo "2048" > $i/queue/nr_requests # default:128 (recomended: 2048)
done
echo "0" > /proc/sys/kernel/sched_child_runs_first
;;
bfq)
for i in $MMC; do
echo "bfq" > $i/queue/scheduler
echo "0" > $i/queue/rotational
echo "1" > $i/queue/iosched/back_seek_penalty
echo "3" > $i/queue/iosched/slice_idle
echo "2048" > $i/queue/read_ahead_kb # default: 128
echo 1000000000 > $i/queue/iosched/back_seek_max
echo "16" > $i/queue/iosched/quantum # default: 4 (recomended: 16)
echo "2048" > $i/queue/nr_requests # default:128 (recomended: 2048)
done
;;
*)
log "INIT.scheduler ERROR:failed to set parameters for unknown scheduler: $SCHEDULER"
exit -1;
;;
esac
log "INIT.scheduler END:setting $SCHEDULER scheduler parameters"
Click to expand...
Click to collapse
Installed this script verbatim, swapped bfq with the code noop (after a bit of reading up on these commands (within "Scheduler=bfq)) ~ and was unable to sucessfully run the script. Was wondering what else i should try to set scheduler to noop
*edit*
seperate mod, same useful init.d script thread oirigin
Also ~ after getting adb working i started attempting to tackle the sysctl.conf but after all a few hours of reading i have a couple of questions before i proceed to create this file / adb push it to my phone.
these are the only qs i have:
- Possible to create a file using windows? I assume possible, next q is how to create a *.conf file on a windows PC (at this hour i am not thinking outside of the box lol)
- once i create the sysctl.conf file, if i understand the process properly, i will simply add the codei chose into the file and then adb push the file to my phone which leads to couple sub questions (trying to learn - haters make like bee with no stinger): Should I simply cut / paste snipets of this code in whatever order ?
have it on my mind to complete this mod including new file - dev help is greatly appreciated.
Amplified said:
Surprising
Click to expand...
Click to collapse
well, yeah: i777 is my first Android.
Disabling atime is a widely used (safe) tuning in unix-servers world to increase performance of operations with the file system.
So, yes, I find it odd that Sammy didn't have that off by default in their ROMs.
Or am I missing the point of irony?
vladm7 said:
the code above changes governor... is this a typo?
Click to expand...
Click to collapse
I'll fix it tonight, that one's a copypasta error
vladm7 said:
I wonder if anyone has confirmed real-life benefit of this? I mean it's a phone on (essentially) SSD drive with relatively little disk IO (especially on write) right?. It's not like we run Oracle on spindles where postponing commit longer may present kernel a chance to optimize/re-order IO operations with disks for better performance (but unsafer)....
Click to expand...
Click to collapse
I haven't poked at that one much. It depends partly on if the phone will enter deep sleep with uncommitted data. It may only be good for benchmark epeen
As to scripts in /system/etc/init.d not running:
They must be executable (chmod 755 is recommended)
They must not have a .sh extension - for some reason run-parts won't run them if they do (annoying...)
If created in Windows there might be line-ending issues (CR vs CR/LF)
a couple of small scripts to remount in RW/RO
I know, this is not directly related to kernel params tuning, but I think not worth a new thread.
Since I often mess in terminal, and need to remount /system in RW mode, I wrote those two small scripts to save some extra typing.
Remounts given file system in RW, /system by default. Save as /system/xbin/rw and then chmod +rx /system/xbin/rw:
Code:
#!/sbin/sh
disk=/system
if [ -n "$1" ]; then
if [ $(busybox grep -c $1 /proc/mounts) -gt 0 ]; then
disk="$1"
else
echo "Can't find '$1' mount"
exit
fi
fi
echo "Remounting '$disk' in Read-Write access mode"
busybox mount -o rw,remount $disk
Save as /system/xbin/ro. Remounts given file system in RO, /system by default:
Code:
#!/sbin/sh
disk=/system
if [ -n "$1" ]; then
if [ $(busybox grep -c $1 /proc/mounts) -gt 0 ]; then
disk="$1"
else
echo "Can't find '$1' mount"
exit
fi
fi
echo "Remounting '$disk' in Read-Only access mode"
busybox mount -o ro,remount $disk
Entropy,
Can you attach these scripts please.

[Q] init.d overclock script

Is this what an overclock init.d script should look like?
And how would you know if it worked?
#!/system/bin/sh
echo 245760 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq
echo 1000000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
echo "performance" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governer
echo "sio" > /sys/block/mmcblk0/queue/scheduler;
If no one can tell me if I'm in the right direction or not is there a way to see if the script is working in the init.d?
If I use this:
cat > /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq
it still shows the default and not what I put it too.
Do I have to edit the kernel before making a script?
How can this be done properly?
The kernel needs to support overclocking before anything, if you're confident with kernel development then do that and try an o/c app from the market before using a script.
sinksterĀ©

init.d and voltages

So I got my Galaxy Nexus, yay!
And I installed Android Revolution HD which has busybox and init.d script support.
I put Franco's latest kernel, and it goes smokin' fast.
But my undervolt settings dissapear each time I reboot, which makes me to have to reboot several times until it gets them.
I asked and got told to put a script into init.d that set the voltages.
Code:
echo "1250 1225 1175 775 750 750 725 700" > /sys/devices/virtual/misc/customvoltage/mpu_voltages
echo "750 750 600 600" > /sys/devices/virtual/misc/customvoltage/iva_voltages
echo "850 850 800" > /sys/devices/virtual/misc/customvoltage/core_voltages
So I did, but voltages are not set and it keeps overheating.
Does anyone have a better idea or know what's wrong here?
Thanks
try this one. don't forget to change the permission into 777 (rwxrwxrwx)
Code:
#!/system/bin/sh
echo "1250 1225 1175 775 750 750 725 700" > /sys/devices/virtual/misc/customvoltage/mpu_voltages
echo "750 750 600 600" > /sys/devices/virtual/misc/customvoltage/iva_voltages
echo "850 850 800" > /sys/devices/virtual/misc/customvoltage/core_voltages
kurotsugi said:
try this one. don't forget to change the permission into 777 (rwxrwxrwx)
Code:
#!/system/bin/sh
echo "1250 1225 1175 775 750 750 725 700" > /sys/devices/virtual/misc/customvoltage/mpu_voltages
echo "750 750 600 600" > /sys/devices/virtual/misc/customvoltage/iva_voltages
echo "850 850 800" > /sys/devices/virtual/misc/customvoltage/core_voltages
Click to expand...
Click to collapse
Thanks! running smooth!

Underclocking app for SD 625

What good app you preffer for underclocking SD625? I want an app thar can underclock and if posible undervolt CPU and turn off some cpu cores. I have RR 5.8.5 with Electrablue 7 kernel.
If you are after an app, then Kernel Adiutor should do some of what you want.
However, if you want full manual control, then you can run commands from a root terminal, or use a script - eg
Code:
# reduce max freq to 1.68ghz
echo "1689600" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
# reduce cores running foreground operations
echo "0-3" > /dev/cpuset/foreground/cpus # default=0-6
echo "0-3" > /dev/cpuset/foreground/boost/cpus # default=0-6
# reduce cores running background operations
echo "0" > /dev/cpuset/background/cpus # default=0-1
echo "0-1" > /dev/cpuset/system-background/cpus # default=0-3
# turn off the last 4 cores
echo "0" > /sys/devices/system/cpu/cpu7/online
echo "0" > /sys/devices/system/cpu/cpu6/online
echo "0" > /sys/devices/system/cpu/cpu5/online
echo "0" > /sys/devices/system/cpu/cpu4/online
DarthJabba9 said:
If you are after an app, then Kernel Adiutor should do some of what you want.
However, if you want full manual control, then you can run commands from a root terminal, or use a script - eg
Code:
# reduce max freq to 1.68ghz
echo "1689600" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
# reduce cores running foreground operations
echo "0-3" > /dev/cpuset/foreground/cpus # default=0-6
echo "0-3" > /dev/cpuset/foreground/boost/cpus # default=0-6
# reduce cores running background operations
echo "0" > /dev/cpuset/background/cpus # default=0-1
echo "0-1" > /dev/cpuset/system-background/cpus # default=0-3
# turn off the last 4 cores
echo "0" > /sys/devices/system/cpu/cpu7/online
echo "0" > /sys/devices/system/cpu/cpu6/online
echo "0" > /sys/devices/system/cpu/cpu5/online
echo "0" > /sys/devices/system/cpu/cpu4/online
Click to expand...
Click to collapse
Very nice commands, these remain after reboot?
Do you know the command for checking current cpu speed and current number of cores online? Or better, one command to show all running cores with their speed.
nikkky said:
Very nice commands, these remain after reboot?
Do you know the command for checking current cpu speed and current number of cores online? Or better, one command to show all running cores with their speed.
Click to expand...
Click to collapse
The commands are not persistent. If you want them to be applied automatically after reboots, you need to put them in a script that is executed via init.d (see https://forum.xda-developers.com/re...o-initd-ad-blocking-bad-audio-videos-t3626661).
To see the values, simply run "cat" on each of the files being written to in the above examples - eg
Code:
cat /sys/devices/system/cpu/cpu7/online
DarthJabba9 said:
The commands are not persistent. If you want them to be applied automatically after reboots, you need to put them in a script that is executed via init.d (see https://forum.xda-developers.com/re...o-initd-ad-blocking-bad-audio-videos-t3626661).
To see the values, simply run "cat" on each of the files being written to in the above examples - eg
Code:
cat /sys/devices/system/cpu/cpu7/online
Click to expand...
Click to collapse
Do you know the command for changing governors?
nikkky said:
Do you know the command for changing governors?
Click to expand...
Click to collapse
Unfortunately, no.
DarthJabba9 said:
If you are after an app, then Kernel Adiutor should do some of what you want.
However, if you want full manual control, then you can run commands from a root terminal, or use a script - eg
Code:
# reduce max freq to 1.68ghz
echo "1689600" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
# reduce cores running foreground operations
echo "0-3" > /dev/cpuset/foreground/cpus # default=0-6
echo "0-3" > /dev/cpuset/foreground/boost/cpus # default=0-6
# reduce cores running background operations
echo "0" > /dev/cpuset/background/cpus # default=0-1
echo "0-1" > /dev/cpuset/system-background/cpus # default=0-3
# turn off the last 4 cores
echo "0" > /sys/devices/system/cpu/cpu7/online
echo "0" > /sys/devices/system/cpu/cpu6/online
echo "0" > /sys/devices/system/cpu/cpu5/online
echo "0" > /sys/devices/system/cpu/cpu4/online
Click to expand...
Click to collapse
When I try for example echo "0" > /sys/devices/system/cpu/cpu6/online I got permission denied. I used Material Terminal app.
Edit:
It worked by tiping su before, to convert $ to # for becoming root.
nikkky said:
Edit:
It worked by tiping su before, to convert $ to # for becoming root.
Click to expand...
Click to collapse
Yes. Running the "su" command is what converts your terminal session into a root terminal session

Categories

Resources