[Galaxy S I9000 Q&A, Help & Troubleshooting] broodplank1337:
Edit: For some strange reason it suddenly works after posting this topic.. :') Delete please

Ok so this is the deal, I'm currently working on broodKernel v1.2 (yes not 1.1 but 1.2) and I've noticed that sysctl.conf isn't loaded in any way, I tried loading it with "sysctl -p" and also with su -c "sysctl -p", both tried it in the kernel itself and in init.d scripts, for some reason it doesn't load on boot, but when I load it myself with "su -c "sysctl -p" it works correctly :silly:

mode is: 644, also tried to chown it to system and/or root, both didn't work. then I question myself. is my init.d method correct? Is it running in root mode? I use this:

service initd /system/bin/logwrapper /system/xbin/busybox run-parts /system/etc/init.d
oneshot

doesn't it need a "user root" at the bottom?, I feel kinda like this emoticon ":silly:" to ask such question, but I really don't know why it's not running correctly, anyhow the sysctl values from the latest thunderbolt seem so unrealistic?:

vm.dirty_expire_centisecs = 3000
vm.dirty_writeback_centisecs = 500

But ok that's the thunderbolt settings, also I'm not sure if this really improves the system, I've noticed that the first few benchmarks score pretty high but then suddenly the sdcard read/write speed gets screwed by something.

Anyway, here are the scripts (so far):

/system/etc/init.d/00broodkernel:

#!/system/bin/sh
# Created by broodplank1337
# broodKernel v1.2

# =================================== #
# broodKernel v1.2 Configuration File #
# =================================== #

# =================================== #
# >>> Available Settings <<< #
# =================================== #
#
# - Set I/O Scheduler
# - Set SDCARD Readahead
# - Enable/Disable Error Reporting
# - Enable/Disable sysctl.conf file
# - See 01screenstatescaling for (advanced) CPU Settings / Tweaks
#
# =================================== #

# =================================== #
#
# >>> I/O Scheduler <<<
#
SCHEDULER="noop"; # noop/cfq
#
# =================================== #
#
# >>> Set SDCard Read Ahead <<<
#
SDCARDREADAHEAD="1024"; # 128/256/512/1024/2048/3072/4096
#
# =================================== #
#
# >>> Google Error Reporting <<<
#
ERRORREPORTING="disabled"; # enabled/disabled
#
# =================================== #
#
# >>> Sysctl.conf Support <<<
#
SYSCTLSUPPORT="enabled"; # enabled/disabled
#
# =================================== #

# Execute Settings:

echo $SCHEDULER > /sys/block/mmcblk0/queue/scheduler
echo $SCHEDULER > /sys/block/mmcblk1/queue/scheduler

# Error Reporting
if [[ "$ERRORREPORTING" == "enabled" ]]
then
setprop profiler.force_disable_err_rpt 0
setprop profiler.force_disable_ulog 0
setprop ro.config.nocheckin 0
else
setprop profiler.force_disable_err_rpt 1
setprop profiler.force_disable_ulog 1
setprop ro.config.nocheckin 1
fi;

# Sysctl.conf
if [[ "$SYSCTLSUPPORT" == "enabled" ]]
then
sysctl -p
else
busybox mv /system/etc/sysctl.conf /system/etc/sysctl.conf.disabled
fi;

# Readahead
echo $SDCARDREADAHEAD > /sys/devices/virtual/bdi/179:0/read_ahead_kb;
echo "256" > /sys/devices/virtual/bdi/179:32/read_ahead_kb;
echo "256" > /sys/devices/virtual/bdi/default/read_ahead_kb;

/system/etc/init.d/01screenstatescaling: (really like this one :))

#!/system/bin/sh
# Credits to pikachu01 and FloHimself for governor tweaks / screenstatescaling script
# Edited by broodplank1337 to fit broodKernel v1.2

# Mount
mount -o remount rw /system

# =====================================================================================
# >>> broodKernel v1.2 CPU Configuration File / Screenstatescaling Script >>> #
# =====================================================================================

# >>> Notes <<<
#
# - This script manages the cpu settings for awake and sleep state.
# - Be sure not to set the max frequency lower then the min frequency.
# - Please only use existing governors to prevent boot problems.
# - Additional governor tweaks can be enabled for a better battery life,
# the governor tweaks may lower performance (only theoretical, like cpu score in Antutu)
# - You can choose to use this file only for CPU Settings,
# this will modify the /system/etc/init.qcom.post_boot.sh file to not set a governor,
# when enabled and 01screenstatescaling is absent, your system will not boot properly
# settings can be restored by place this line:

# =====================================================================================
# >>> Basic CPU Settings <<<	# Please only use the values below as settings
# =====================================================================================
# Awake CPU Settings
AWAKE_GOVERNOR="ondemand"; # ondemand/performance/conservative/userspace
MIN_SPEED_AWAKE="245760"; # 122880/245760/368640
MAX_SPEED_AWAKE="1401600";	# 768000/806400/1024000/1200000/1401600

# Sleep CPU Settings
SLEEP_GOVERNOR="ondemand"; # ondemand/conservative/powersave
MIN_SPEED_SLEEP="122880"; # 122880/245760/368640
MAX_SPEED_SLEEP="245760"; # 122880/245760/368640

# Governor Tweaks
ENABLE_ONDEMAND_TWEAKS="no"; # yes/no
ENABLE_CONSERVATIVE_TWEAKS="no"; # yes/no
# =====================================================================================

# =====================================================================================
# >>> Advanced CPU Settings << # Use at own risk, don't change if inexperienced.
# =====================================================================================
# Use 01screenstatescaling as primary CPU Management script
DISABLE_POSTBOOT_CPU="no";	# yes/no (only enable if you know what you're doing!)
# =====================================================================================

# Execute Settings

# Disable Postboot CPU Management
if [[ "$DISABLE_POSTBOOT_CPU" == "no" ]]
then
if [ -e /system/etc/init.qcom.post_boot.sh.bak ]; then
busybox cp -f /system/etc/init.qcom.post_boot.sh.bak /system/etc/init.qcom.post_boot.sh
else
sleep 1
fi;
else
if [ -e /system/etc/init.qcom.post_boot.sh.bak ]; then
sleep 1
else
busybox cp -f /system/etc/init.qcom.post_boot.sh /system/etc/init.qcom.post_boot.sh.bak
sed '33d' /system/etc/init.qcom.post_boot.sh > /sdcard/temp.sh # Remove line that sets governor
busybox mv -f /sdcard/temp.sh /system/etc/init.qcom.post_boot.sh
chmod 644 /system/etc/init.qcom.post_boot.sh
chown root:root /system/etc/init.qcom.post_boot.sh
fi;
fi;

# Ondemand Tweaks
if [[ "$ENABLE_ONDEMAND_TWEAKS" == "yes" ]]
then
if [ -e /sys/devices/system/cpu/cpu0/cpufreq/ondemand/up_threshold ]; then
echo "95" > /sys/devices/system/cpu/cpu0/cpufreq/ondemand/up_threshold;
echo "5" > /sys/devices/system/cpu/cpu0/cpufreq/ondemand/down_differential;
#echo "0" > /sys/devices/system/cpu/cpu0/cpufreq/ondemand/io_is_busy;
echo "1" > /sys/devices/system/cpu/cpu0/cpufreq/ondemand/sampling_down_factor;
echo "100000" > /sys/devices/system/cpu/cpu0/cpufreq/ondemand/sampling_rate;
fi;
if [ -e /sys/devices/system/cpu/cpufreq/ondemand/up_threshold ]; then
echo "95" > /sys/devices/system/cpu/cpufreq/ondemand/up_threshold;
echo "5" > /sys/devices/system/cpu/cpufreq/ondemand/down_differential;
#echo "0" > /sys/devices/system/cpu/cpufreq/ondemand/io_is_busy;
echo "1" > /sys/devices/system/cpu/cpufreq/ondemand/sampling_down_factor;
echo "100000" > /sys/devices/system/cpu/cpufreq/ondemand/sampling_rate;
fi;
else
sleep 1
fi;

# Conservative Tweaks
if [[ "$ENABLE_CONVERVATIVE_TWEAKS" == "yes" ]]
then
if [ -e /sys/devices/system/cpu/cpu0/cpufreq/conservative/up_threshold ]; then
echo "95" > /sys/devices/system/cpu/cpu0/cpufreq/conservative/up_threshold;
echo "90" > /sys/devices/system/cpu/cpu0/cpufreq/conservative/down_threshold; # 35 # 12 # 30 (higher will lead to noticable lags) # 35 # screen off: # 50 ## 35
echo "20" > /sys/devices/system/cpu/cpu0/cpufreq/conservative/freq_step; # more aggressive ramping up (50) # screen off: # 10
echo "1" > /sys/devices/system/cpu/cpu0/cpufreq/conservative/sampling_down_factor;
echo "100000" > /sys/devices/system/cpu/cpu0/cpufreq/conservative/sampling_rate;
fi;
if [ -e /sys/devices/system/cpu/cpufreq/conservative/up_threshold ]; then

echo "95" > /sys/devices/system/cpu/cpufreq/conservative/up_threshold;
echo "90" > /sys/devices/system/cpu/cpufreq/conservative/down_threshold; # 35 # 12 # 30 (higher will lead to noticable lags) # 35 # screen off: # 50 ## 35
echo "20" > /sys/devices/system/cpu/cpufreq/conservative/freq_step; # more aggressive ramping up (50) # screen off: # 10
echo "1" > /sys/devices/system/cpu/cpufreq/conservative/sampling_down_factor;
echo "100000" > /sys/devices/system/cpu/cpufreq/conservative/sampling_rate;
fi;
else
sleep 1
fi;

# Screenstatescaling loop

(while [ 1 ];
do

# ==============================================================
# settings for while the screen is on / usage
# ==============================================================

AWAKE=`cat /sys/power/wait_for_fb_wake`;
if [ $AWAKE = "awake" ]; then
sleep 2
log -p i -t screenstate_scaling "State: Awake, switching CPU governor to -> $AWAKE_GOVERNOR"
echo $AWAKE_GOVERNOR > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor;
echo $MIN_SPEED_AWAKE > /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq;
echo $MAX_SPEED_AWAKE > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq;
fi;

# ==============================================================
# settings for while the screen is off
# ==============================================================

SLEEPING=`cat /sys/power/wait_for_fb_sleep`;
if [ $SLEEPING = "sleeping" ]; then
sleep 2
log -p i -t screenstate_scaling "State: Sleeping, switching CPU governor to -> $SLEEP_GOVERNOR"
echo $SLEEP_GOVERNOR > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor;
echo $MIN_SPEED_SLEEP > /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq;
echo $MAX_SPEED_SLEEP > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq;
fi;

done &);

/system/etc/sysctl.conf:

vm.page-cluster = 3
vm.laptop_mode = 0
vm.dirty_expire_centisecs = 3000
vm.dirty_writeback_centisecs = 500
vm.dirty_background_ratio = 40
vm.dirty_ratio = 80
vm.vfs_cache_pressure = 10
vm.overcommit_memory = 1
vm.oom_kill_allocating_task = 0
vm.min_free_kbytes = 4096
net.ipv4.tcp_timestamps = 0
net.ipv4.tcp_tw_reuse = 1
net.ipv4.tcp_sack = 1
net.ipv4.tcp_dsack = 1
net.ipv4.tcp_tw_recycle = 1
net.ipv4.tcp_window_scaling = 1
net.ipv4.tcp_keepalive_probes = 5
net.ipv4.tcp_keepalive_intvl = 30
net.ipv4.tcp_fin_timeout = 30
net.ipv4.tcp_moderate_rcvbuf = 1
kernel.sem = "500 512000 100 2048"
kernel.shmmax = 268435456
kernel.msgmni = 1024