Advertisement
Perka

ElinROM init tweaks

Sep 19th, 2011
404
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 45.04 KB | None | 0 0
  1. init tweaks
  2.  
  3. S01sysctl
  4.  
  5. #!/system/bin/sh
  6. sysctl -p
  7.  
  8. S70zipalign
  9.  
  10. #!/system/bin/sh
  11. # Automatic ZipAlign by Wes Garner
  12. # ZipAlign files in /data that have not been previously ZipAligned (using md5sum)
  13. # Thanks to oknowton for the changes
  14.  
  15. # Changelog:
  16. # 1.1 (12/1/09) Switched to zipalign -c 4 to check the apk instead of MD5 (oknowton)
  17. # 1.0 (11/30/09) Original
  18.  
  19. LOG_FILE=/data/zipalign.log
  20. if [ -e $LOG_FILE ]; then
  21. rm $LOG_FILE;
  22. fi;
  23.  
  24. echo "Starting Automatic ZipAlign $( date +"%m-%d-%Y %H:%M:%S" )" | tee -a $LOG_FILE;
  25. for apk in /data/app/*.apk ; do
  26. zipalign -c 4 $apk;
  27. ZIPCHECK=$?;
  28. if [ $ZIPCHECK -eq 1 ]; then
  29. echo ZipAligning $(basename $apk) | tee -a $LOG_FILE;
  30. zipalign -f 4 $apk /cache/$(basename $apk);
  31. if [ -e /cache/$(basename $apk) ]; then
  32. cp -f -p /cache/$(basename $apk) $apk | tee -a $LOG_FILE;
  33. rm /cache/$(basename $apk);
  34. else
  35. echo ZipAligning $(basename $apk) Failed | tee -a $LOG_FILE;
  36. fi;
  37. else
  38. echo ZipAlign already completed on $apk | tee -a $LOG_FILE;
  39. fi;
  40. done;
  41. for apk in /system/app/*.apk ; do
  42. zipalign -c 4 $apk;
  43. ZIPCHECK=$?;
  44. if [ $ZIPCHECK -eq 1 ]; then
  45. echo ZipAligning $(basename $apk) | tee -a $LOG_FILE;
  46. zipalign -f 4 $apk /cache/$(basename $apk);
  47. if [ -e /cache/$(basename $apk) ]; then
  48. cp -f -p /cache/$(basename $apk) $apk | tee -a $LOG_FILE;
  49. rm /cache/$(basename $apk);
  50. else
  51. echo ZipAligning $(basename $apk) Failed | tee -a $LOG_FILE;
  52. fi;
  53. else
  54. echo ZipAlign already completed on $apk | tee -a $LOG_FILE;
  55. fi;
  56. done;
  57. echo "Automatic ZipAlign finished at $( date +"%m-%d-%Y %H:%M:%S" )" | tee -a $LOG_FILE;
  58.  
  59. S97SD
  60.  
  61. #!/system/bin/sh
  62. if [ -e /sys/devices/virtual/bdi/179:0/read_ahead_kb ]
  63. then
  64. /system/xbin/echo "2048" > /sys/devices/virtual/bdi/179:0/read_ahead_kb;
  65. fi;
  66.  
  67. S98screenstate_scaling
  68.  
  69. #!/system/bin/sh
  70. #
  71. # mod version V49
  72. # screenstate_scaling - switch CPU frequency governor on screen state change
  73. # [email protected] (FloHimself)
  74. # modifications by zacharias.maladroit and 'well.heeled.man'
  75. # modifications & ideas taken from: ckMod SSSwitch by voku1987 and "battery tweak" (collin_ph@xda)
  76. # for Changelog and experimental settings: see bottom part of this file
  77.  
  78.  
  79. # =========
  80. # Memory tweaks for non-screenstate-scaling usage
  81. # =========
  82. # (currently none)
  83. # =========
  84.  
  85.  
  86.  
  87. # =========
  88. # Description, howto:
  89. # =========
  90.  
  91. # for uncommenting settings remove the preceding diamond/rhomb-sign (#) at the beginning of the line
  92. # and remember to comment the other settings otherwise they will fight with each other and you might
  93. # see inconsistent results
  94.  
  95.  
  96. # ==============================================================
  97. # ==============================================================
  98. # Description of the governors:
  99. # ==============================================================
  100. # ==============================================================
  101.  
  102. # =========
  103. # (1) battery-saving
  104. # =========
  105. # [might be laggy and slow- problems during wake-up/phone-answering or when screen is unlocked - due to powersave governor]
  106. # =========
  107. # choose conservative or ondemand governor with aggressive powersaving settings - while screen is ON
  108. # choose powersave governor - while is OFF
  109. # =========
  110.  
  111. # =========
  112. # (2) interactive #
  113. # =========
  114. # [phone gets warm faster and experience is not overall consistent,
  115. # interactive governor tweaked for power savings but still consuming more battery
  116. # staying longer at higher frequencies]
  117. # =========
  118. # combine with conservative governor while screen is off ! [recommended]
  119. # =========
  120.  
  121. # =========
  122. # (3) smartass #
  123. # =========
  124. # [best compromise between super-smooth operation and battery savings while screen is off
  125. # when idle while screen is on the battery consumption might be a tad bit high]
  126. # =========
  127. # combine with conservative governor while screen is off ! [recommended]
  128. #
  129. # can also be used while screen is ON and screen is OFF [AWAKE and SLEEP governor] - might result
  130. # in higher battery consumption but smoother overall experience (fast wakeup when unlocking
  131. # and answering the phone - might have some stability-issues though and "hang" at high
  132. # frequencies for some time)
  133. # =========
  134.  
  135. # =========
  136. # (4) interactiveX #
  137. # =========
  138. # [phone gets warm faster and experience is not overall consistent,
  139. # the phone might be consuming more battery
  140. # staying longer at higher frequencies - this governor is suited as "one governor for all"
  141. # to be used when screen is ON and when screen is OFF - AWAKE & SLEEP governor]
  142. # =========
  143.  
  144. # =========
  145. # (5) conservative #
  146. # =========
  147. # [multi-purpose governor - very battery-saving with default settings
  148. # can be tweaked to jump to high frequencies fast while leaving out mid-frequencies
  149. # when tweaked to be *very* aggressive & resulting in higher
  150. # quadrant scores than with ondemand & acceptable experience still with
  151. # power-efficiency in mind - in my opinion more consistent experience
  152. # less micro-lags & thought-time than with ondemand governor]
  153. # =========
  154. # combine with conservative governor while screen is off ! [recommended]
  155. # =========
  156.  
  157. # =========
  158. # (6) ondemand #
  159. # =========
  160. # [kernel default and multi-purpose governor
  161. # can be tweaked to be fast & power efficient
  162. # it quickly jumps from lowest to highest frequency and meanwhile
  163. # also uses mid-frequencies when applicable
  164. # gets more attention from the upstream kernel devs and is continually optimised
  165. # its "flaw" from my experience: it's not really smooth enough in demanding GUIs
  166. # such as MIUI, TouchWiz, even ADWLauncher might show "micro lags"]
  167. # =========
  168. # combine with conservative governor while screen is off ! [recommended]
  169. # =========
  170.  
  171.  
  172. # ==============================================================
  173. # ==============================================================
  174. # step [1] choose AWAKE governor while screen is ON
  175. # ==============================================================
  176. # ==============================================================
  177. # selection of AWAKE Governors:
  178. # =========
  179. # only keep ONE governor uncommented at a time !!!!:
  180. # =========
  181.  
  182. #AWAKE_GOVERNOR="conservative"
  183. AWAKE_GOVERNOR="ondemand" # [no additional settings required, tweaking done in kernel-source]
  184. #AWAKE_GOVERNOR="ondemandX"
  185. #AWAKE_GOVERNOR="interactive"
  186. #AWAKE_GOVERNOR="interactiveX"
  187. #AWAKE_GOVERNOR="smartass"
  188.  
  189.  
  190. # ==============================================================
  191. # ==============================================================
  192. # step [2] choose SLEEP governor while screen is OFF
  193. # ==============================================================
  194. # ==============================================================
  195. # selection of SLEEP Governors:
  196. # =========
  197. # only keep ONE governor uncommented at a time !!!!:
  198. # =========
  199.  
  200. SLEEP_GOVERNOR="conservative"
  201. #SLEEP_GOVERNOR="ondemand" # [no additional settings required, tweaking done in kernel-source]
  202. #SLEEP_GOVERNOR="interactive" # NOT recommended
  203. #SLEEP_GOVERNOR="interactiveX"
  204. #SLEEP_GOVERNOR="smartass"
  205. #SLEEP_GOVERNOR="powersave" # [no additional settings required, powersave only stays at 100 MHz]
  206.  
  207.  
  208.  
  209.  
  210.  
  211.  
  212.  
  213.  
  214.  
  215.  
  216.  
  217.  
  218. # ==============================================================
  219. # ==============================================================
  220. # beginning of the screenstate-scaling loop
  221. # ==============================================================
  222. # ==============================================================
  223.  
  224.  
  225. (while [ 1 ]
  226. do
  227.  
  228.  
  229. # ==============================================================
  230. # ==============================================================
  231. # ==============================================================
  232. # settings for while the screen is on / usage
  233. # ==============================================================
  234. # ==============================================================
  235. # ==============================================================
  236.  
  237. AWAKE=`cat /sys/power/wait_for_fb_wake`
  238. if [ $AWAKE = "awake" ]; then
  239. sleep 2 && echo $AWAKE_GOVERNOR > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
  240.  
  241.  
  242.  
  243.  
  244. # ==============================================================
  245. # ==============================================================
  246. # step [3] tweaks to the governor while screen is ON (phone in use)
  247. # ==============================================================
  248. # ==============================================================
  249. # ==============================================================
  250. # limiting the max/min frequencies [not used by default]
  251. # ==============================================================
  252. # =========
  253. # set maximum & minimum frequency to 100 & 1000 MHz (1 GHz)
  254. # =========
  255. #echo "1000000" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
  256. #echo "100000" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq
  257.  
  258.  
  259. # =========
  260. # (3) smartass #
  261. # =========
  262. # Smartass settings (slightly more battery friendly than Glitch Kernel defaults - peformance penalty unclear)
  263. # =========
  264.  
  265. # echo "50" > /sys/devices/system/cpu/cpu0/cpufreq/smartass/max_cpu_load # 76 # 47
  266. # echo "35" > /sys/devices/system/cpu/cpu0/cpufreq/smartass/min_cpu_load # 30 # 39
  267. # echo "800000" > /sys/devices/system/cpu/cpu0/cpufreq/smartass/up_min_freq
  268. # echo "400000" > /sys/devices/system/cpu/cpu0/cpufreq/smartass/sleep_max_freq
  269.  
  270.  
  271. # =========
  272. # (5) conservative aka "One governor to rule them all"
  273. # =========
  274. # =========
  275. # Conservative settings [SavagedZen governor-like] (recommended)
  276. # =========
  277.  
  278. # echo "50" > /sys/devices/system/cpu/cpufreq/conservative/up_threshold # 50 # 76 # 76
  279. # echo "35" > /sys/devices/system/cpu/cpufreq/conservative/down_threshold # 35 # 12 # 30 (higher will lead to noticable lags) # 35
  280. # echo "50" > /sys/devices/system/cpu/cpufreq/conservative/freq_step # more aggressive ramping up (50)
  281. ###### echo "280000" > /sys/devices/system/cpu/cpu0/cpufreq/conservative/sampling_rate # 375000 # 500000
  282.  
  283.  
  284.  
  285.  
  286.  
  287.  
  288.  
  289.  
  290.  
  291. # =========
  292. # (1) max battery # [with ondemand & powersave while phone in "sleep" [screen off] mode]
  293. # =========
  294. # [might have lags during wake-up/phone-answering or when screen is unlocked]
  295. # =========
  296.  
  297. #SLEEP_GOVERNOR="powersave" # [no additional settings required, powersave only stays at 100 MHz]
  298.  
  299. # =========
  300. # (1) max battery # [with conservative & powersave while phone in "sleep" [screen off] mode]
  301. # =========
  302. # Conservative settings [all frequencies using, noticably laggy when used while screen is on - needs time to ramp up] (compromise between speed/lags)
  303. # =========
  304.  
  305. # echo "70" > /sys/devices/system/cpu/cpufreq/conservative/up_threshold # 50 # 76 # 76
  306. # echo "30" > /sys/devices/system/cpu/cpufreq/conservative/down_threshold # 35 # 12 # 30 (higher will lead to noticable lags)
  307. # echo "10" > /sys/devices/system/cpu/cpufreq/conservative/freq_step # more aggressive ramping up (50)
  308.  
  309.  
  310. #SLEEP_GOVERNOR="conservative"
  311.  
  312. #AWAKE_GOVERNOR="smartass"
  313. #SLEEP_GOVERNOR="conservative"
  314.  
  315.  
  316. # =========
  317. # (4) ondemand #
  318. # =========
  319. # [default governor but tweaked in preparation for BFS usage, should be smooth
  320. # scales through all frequencies and might consume equally or even less
  321. # than conservative governor
  322. # while screen is off - conservative governor]
  323. # =========
  324.  
  325. #AWAKE_GOVERNOR="ondemand"
  326. #SLEEP_GOVERNOR="conservative"
  327.  
  328.  
  329. # =========
  330. # (5) One governor to rule them all aka all the way conservative [good trade-off between responsiveness and power-saving features]
  331. # =========
  332.  
  333. #AWAKE_GOVERNOR="conservative"
  334. #SLEEP_GOVERNOR="conservative"
  335.  
  336.  
  337.  
  338.  
  339.  
  340.  
  341. # =========
  342. # dirty_ratio & vfs_cache_pressure: too high (dirty_ratio) and too low values (vfs_cache_pressure) might fill up the RAM too much and end up triggering the OOM killer
  343. # =========
  344.  
  345. # =========
  346. # stuff moved to the system_tweak script
  347. # =========
  348.  
  349. # log -p i -t screenstate_scaling "*** awake ***: switching CPU frequency governor to -> $AWAKE_GOVERNOR"
  350. AWAKE=
  351. fi
  352.  
  353.  
  354.  
  355.  
  356.  
  357.  
  358.  
  359.  
  360.  
  361.  
  362.  
  363.  
  364.  
  365.  
  366.  
  367. # ==============================================================
  368. # ==============================================================
  369. # ==============================================================
  370. # settings for while the screen is off
  371. # ==============================================================
  372. # ==============================================================
  373. # ==============================================================
  374.  
  375. SLEEPING=`cat /sys/power/wait_for_fb_sleep`
  376. if [ $SLEEPING = "sleeping" ]; then
  377. sleep 2 && echo $SLEEP_GOVERNOR > /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor
  378.  
  379.  
  380. # ==============================================================
  381. # ==============================================================
  382. # step [4] tweaks to the governor while screen is OFF (phone in idle or doing its thing on its on)
  383. # ==============================================================
  384. # ==============================================================
  385. # ==============================================================
  386. # limiting the max/min frequencies [not used by default]
  387. # ==============================================================
  388. # =========
  389. # set maximum & minimum frequency to 100 & 400 MHz - that should hopefully be enough for DSP effects & prevent buggy apps from draining the battery too much
  390. # =========
  391. #echo "400000" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
  392. #echo "100000" > /sys/devices/system/cpu/cpu0/cpufreq/scaling_min_freq
  393.  
  394.  
  395.  
  396.  
  397. # =========
  398. # (2) interactive, (3) smartass, (4) ondemand, (5) conservative #
  399. # =========
  400.  
  401. # =========
  402. # Conservative settings [SavagedZen governor-like] (recommended when screen on, might consume more battery when screen off since it does not scale through all frequencies)
  403. # settings for screen off (can be more aggressive)
  404. # =========
  405.  
  406. echo "50" > /sys/devices/system/cpu/cpufreq/conservative/up_threshold # 50 # 76 # 76 # screen off: # 90 (probably too high) # 76 (sound stuttering with EQ and some apps) ## 50
  407. echo "35" > /sys/devices/system/cpu/cpufreq/conservative/down_threshold # 35 # 12 # 30 (higher will lead to noticable lags) # 35 # screen off: # 50 ## 35
  408. echo "5" > /sys/devices/system/cpu/cpufreq/conservative/freq_step # more aggressive ramping up (50) # screen off: # 10
  409.  
  410.  
  411.  
  412. # =========
  413. # dirty_ratio & vfs_cache_pressure: too high (dirty_ratio) and too low values (vfs_cache_pressure) might fill up the RAM too much and end up triggering the OOM killer
  414. # =========
  415.  
  416. # =========
  417. # stuff moved to the system_tweak script
  418. # =========
  419.  
  420. # log -p i -t screenstate_scaling "*** sleeping ***: switching CPU frequency governor to -> $SLEEP_GOVERNOR"
  421. SLEEPING=
  422. fi
  423. done &)
  424.  
  425.  
  426.  
  427.  
  428.  
  429.  
  430.  
  431.  
  432. # ==============================================================
  433. # ==============================================================
  434. # ==============================================================
  435. # Changelog
  436. # ==============================================================
  437. # ==============================================================
  438. # ==============================================================
  439.  
  440. # CFS stuff commented out and moved to 89system_tweak; tweaks to conservative governor
  441. # conservative governor with different values; tweaked conservative governor some more
  442. # more conservative tweaks
  443. # conservative for more power savings; behavior similar to SavagedZen governor
  444. # more tweaking & testing
  445. # One governor to rule them all; state-dependent memory tweaks (V22); disabled log; ramping at 10
  446. #
  447. # switch to ondemand governor (experience from users & me has shown that this one should be the optimal
  448. # governor for fast frequency-switching and battery savings in usage)
  449. #
  450. # switched to smartass governor as default governor while screen is on - when 600 MHz is undervolted by -225 mV (where possible)
  451. # idle comes at the same cost like 400 MHz so is acceptable
  452. #
  453. # tweak the conservative governor (while screen is off) a little to make it less aggressive with ramping up but higher threshold values
  454. # V28: add min & max frequencies and tweak the conservative governor
  455. # V29: remove the raised sampling rate for conservative governor (screen off) - since that potentially lead to lags
  456. # while screen is on (less often polling - no sampling rate set - so the same like it was with screen off). Higher wasn't better in this case
  457. # V30: tweaked conservative governor some more
  458. # V31: switch to SavagedZen for default governor (while screen is on)
  459. # V32: switched back to smartass for default
  460. # V33: tweaks to smartass governor, added aggressive conservative powersaving options [uncommented - might lead to stuttering in sound playback]
  461. # V34: tweak smartass governor previous tweaks were too conservative - non-smooth GUI
  462. # V35: some minor tweaks to screen-off conservative governor
  463. # V36: config for forked & optimized Talon Kernel
  464. # V37: even more tweaks to memory settings & governors
  465. # V38: reduce the waiting time to apply the governor to 2 seconds (from 5)
  466. # V39: do some more tweaks to the page-cache & dirty_ratio [thanks to Juwe11 for some ideas on how to tweak it properly !]
  467. # V40: working around the issue that PowerAmp and other players consume too much cpu power & sound lags (less min-max like behavior)
  468. # V41: conservative governor (screen on) back to old (smoother) behavior
  469. # V42: switched to ondemand governor (screen on)
  470. # V43: moved stuff around and added some tags to make things more clear
  471. # V44: added some more settings
  472. # V45: some more descriptions
  473. # V46: added explanation to powersave governor
  474. # V47: Documentation part rewrite (not finished yet)
  475. # V48: moved stuff to the system_tweak script
  476. # V49: pre-set governors: awake_governor ondemand, sleep_governor conservative
  477.  
  478.  
  479.  
  480.  
  481.  
  482.  
  483.  
  484.  
  485.  
  486.  
  487.  
  488.  
  489.  
  490. # ==============================================================
  491. # ==============================================================
  492. # ==============================================================
  493. # test settings for while screen is on
  494. # ==============================================================
  495. # ==============================================================
  496. # ==============================================================
  497.  
  498.  
  499.  
  500. # =========
  501. # Ondemand settings [more aggressive power savings]
  502. # =========
  503.  
  504. # echo "98" > /sys/devices/system/cpu/cpufreq/ondemand/up_threshold
  505. #### echo "300000" > /sys/devices/system/cpu/cpu0/cpufreq/conservative/sampling_rate
  506.  
  507. # =========
  508. # Ondemand settings [experimental] (max frequency at 800 MHz,
  509. # more aggressive up- and down-sampling while staying longer at higher frequencies during load)
  510. # =========
  511.  
  512. # echo "100" > /sys/devices/system/cpu/cpufreq/ondemand/sampling_down_factor
  513. # echo "200" > /sys/devices/system/cpu/cpufreq/ondemand/powersave_bias
  514. # echo "100000" > /sys/devices/system/cpu/cpufreq/ondemand/sampling_rate
  515.  
  516. # VM parameters;
  517.  
  518.  
  519.  
  520.  
  521.  
  522. # ==============================================================
  523. # ==============================================================
  524. # ==============================================================
  525. # test settings for while screen is off
  526. # ==============================================================
  527. # ==============================================================
  528. # ==============================================================
  529.  
  530.  
  531.  
  532. # =========
  533. # Conservative settings [very conservative](conservative SLEEP_GOVERNOR)
  534. # =========
  535. # echo "90" > /sys/devices/system/cpu/cpufreq/conservative/up_threshold
  536. # echo "50" > /sys/devices/system/cpu/cpufreq/conservative/down_threshold
  537. # echo "10" > /sys/devices/system/cpu/cpufreq/conservative/freq_step
  538. # echo "500000" > /sys/devices/system/cpu/cpu0/cpufreq/conservative/sampling_rate
  539.  
  540.  
  541. # tweaking up- and down_threshold for power efficiency (only up_threshold exists with ondemand !)
  542. # echo "98" > /sys/devices/system/cpu/cpufreq/ondemand/up_threshold
  543. # echo "76" > /sys/devices/system/cpu/cpufreq/conservative/up_threshold # 76
  544. # echo "30" > /sys/devices/system/cpu/cpufreq/conservative/down_threshold # 30
  545. # echo "20" > /sys/devices/system/cpu/cpufreq/conservative/freq_step
  546. # VM parameters;
  547.  
  548.  
  549. # =========
  550. # Conservative settings [SavagedZen governor-like] (recommended when screen on, might consume more battery when screen off since it does not scale through all frequencies)
  551. # settings for screen off (can be more aggressive)
  552. # =========
  553.  
  554. # echo "50" > /sys/devices/system/cpu/cpufreq/conservative/up_threshold # 50 # 76 # 76 # screen off: # 90 (probably too high) # 76 ## 50
  555. # echo "35" > /sys/devices/system/cpu/cpufreq/conservative/down_threshold # 35 # 12 # 30 (higher will lead to noticable lags) # 35 # screen off: # 50 ## 35
  556. # echo "50" > /sys/devices/system/cpu/cpufreq/conservative/freq_step # more aggressive ramping up (50) # screen off: # 10
  557. ###### echo "400000" > /sys/devices/system/cpu/cpu0/cpufreq/conservative/sampling_rate # 375000 # 500000 # 80000 # screen off: # 400000 (test)
  558.  
  559. S98system_tweak
  560.  
  561. #!/system/bin/sh
  562. #
  563. # 89system_tweak V54
  564. # by zacharias.maladroit
  565. # modifications and ideas taken from: ckMod SSSwitch by voku1987 and "battery tweak" (collin_ph@xda)
  566. # OOM/LMK settings by Juwe11
  567. # network security settings inspired by various security, server guides on the web
  568.  
  569.  
  570.  
  571.  
  572.  
  573. # ==============================================================
  574. # ==============================================================
  575. # ==============================================================
  576. # One-time tweaks to apply on every boot
  577. # ==============================================================
  578. # ==============================================================
  579. # ==============================================================
  580. # =========
  581. STL=`ls -d /sys/block/stl*`;
  582. BML=`ls -d /sys/block/bml*`;
  583. MMC=`ls -d /sys/block/mmc*`;
  584.  
  585. # set the cfq scheduler as default i/o scheduler (Samsung ROMs)
  586. #for i in $STL $BML $MMC;
  587. #do
  588. # echo "noop" > $i/queue/scheduler;
  589. #done;
  590.  
  591. # Optimize non-rotating storage;
  592. for i in $STL $BML $MMC;
  593. do
  594. echo 0 > $i/queue/rotational;
  595. echo 1 > $i/queue/iosched/back_seek_penalty;
  596. echo 1 > $i/queue/iosched/low_latency;
  597. echo 3 > $i/queue/iosched/slice_idle; # previous: 1
  598. echo 1 > $i/queue/iosched/fifo_batch; # deadline scheduler specific
  599. echo 16 > $i/queue/iosched/quantum;
  600. echo 1024 > $i/queue/iosched/nr_requests; # for starters: keep it sane
  601. done;
  602.  
  603. #disable iostats to reduce overhead
  604. for k in $STL $BML $MMC;
  605. do
  606. echo "0" > $k/queue/iostats
  607. done
  608.  
  609. # Optimize for read- & write-throughput;
  610.  
  611. for i in $STL $BML $MMC;
  612. do
  613. # echo "2048" > $i/queue/read_ahead_kb # yes - I know - this is evil ^^, might help with battery runtime still (in certain workloads)
  614. echo "1" > $i/queue/rq_affinity
  615. done;
  616. ## /bin/echo "0" > $i/queue/nomerges
  617. # echo "128" > $i/queue/max_sectors_kb
  618.  
  619.  
  620. # =========
  621. # TWEAKS: raising read_ahead_kb cache-value for sd card to 2048 [not needed with above tweak but just in case it doesn't get applied]
  622. # =========
  623. #echo "2048" > /sys/devices/virtual/bdi/179:0/read_ahead_kb
  624.  
  625. # improved approach of the readahead-tweak:
  626.  
  627.  
  628. if [ -e /sys/devices/virtual/bdi/179:0/read_ahead_kb ]
  629. then
  630. /system/xbin/echo "1024" > /sys/devices/virtual/bdi/179:0/read_ahead_kb;
  631. fi;
  632.  
  633. if [ -e /sys/devices/virtual/bdi/179:8/read_ahead_kb ]
  634. then
  635. /system/xbin/echo "1024" > /sys/devices/virtual/bdi/179:8/read_ahead_kb;
  636. fi;
  637.  
  638. if [ -e /sys/devices/virtual/bdi/default/read_ahead_kb ]
  639. then
  640. /system/xbin/echo "128" > /sys/devices/virtual/bdi/default/read_ahead_kb;
  641. fi;
  642.  
  643.  
  644.  
  645. # ==============================================================
  646. # ==============================================================
  647. # ==============================================================
  648. # VFS, VM settings
  649. # ==============================================================
  650. # ==============================================================
  651. # ==============================================================
  652.  
  653. # =========
  654. # TWEAKS: MEMORY SETTINGS for general operation + zcache/zram usage
  655. # =========
  656.  
  657. # optimizing the system for zcache & zram usage [Samsung ROMs only (for now)]
  658.  
  659. #echo 0 > /proc/sys/vm/swappiness # 70 for zram, Talon # 0 for CM7 / MIUI (no zram yet)
  660. #echo 3 > /proc/sys/vm/page-cluster # when swapping then hesitate to swap out pages & pull them in again in a fast manner
  661.  
  662. #echo 20 > /proc/sys/vm/vfs_cache_pressure; # 100 while screen off # 200 # 50
  663. #echo 50 > /proc/sys/vm/vfs_cache_pressure; # same value for both: screen on & off - needs some testing due to RAM filling and OOM killer triggering # 20 (on talon)
  664.  
  665. # make sure we don't use laptop-mode
  666. echo 0 > /proc/sys/vm/laptop_mode
  667.  
  668.  
  669.  
  670. # echo 60 > /proc/sys/vm/swappiness; # 20 # 70
  671. # echo 10 > /proc/sys/vm/page-cluster; # 12
  672. echo 0 > /proc/sys/vm/laptop_mode; # do not omit syncing
  673. echo 700 > /proc/sys/vm/dirty_expire_centisecs; # 2000 # 700 is long enough [stability testing]
  674. echo 500 > /proc/sys/vm/dirty_writeback_centisecs; # 1000 # 500 is long enough [stability testing]
  675. echo 10 > /proc/sys/vm/dirty_background_ratio; # 15 # 10 # 50
  676. echo 80 > /proc/sys/vm/dirty_ratio; # 40 # 90
  677. echo 20 > /proc/sys/vm/vfs_cache_pressure; # 100 while screen off # 200 # 50 # 20 [less reclaim]
  678.  
  679.  
  680. # =========
  681. # TWEAKS: adding zram swap in RAM
  682. # =========
  683.  
  684. #insmod /system/modules/zram.ko num_devices=1
  685. #echo $((96*1024*1024)) > /sys/block/zram0/disksize
  686. #mknod /dev/zram0 b 253 0
  687. #mkswap /dev/zram0
  688. #swapon /dev/zram0
  689.  
  690.  
  691.  
  692.  
  693.  
  694. # ==============================================================
  695. # ==============================================================
  696. # ==============================================================
  697. # network speed and throughput
  698. # ==============================================================
  699. # ==============================================================
  700. # ==============================================================
  701.  
  702.  
  703.  
  704. # =========
  705. # TWEAKS: for TCP read/write
  706. # =========
  707. echo 0 > /proc/sys/net/ipv4/tcp_timestamps;
  708. echo 1 > /proc/sys/net/ipv4/tcp_tw_reuse;
  709. echo 1 > /proc/sys/net/ipv4/tcp_sack;
  710. echo 1 > /proc/sys/net/ipv4/tcp_dsack;
  711. echo 1 > /proc/sys/net/ipv4/tcp_tw_recycle;
  712. echo 1 > /proc/sys/net/ipv4/tcp_window_scaling;
  713. echo 5 > /proc/sys/net/ipv4/tcp_keepalive_probes;
  714. echo 30 > /proc/sys/net/ipv4/tcp_keepalive_intvl;
  715. echo 30 > /proc/sys/net/ipv4/tcp_fin_timeout;
  716. echo 524288 > proc/sys/net/core/wmem_max;
  717. echo 524288 > proc/sys/net/core/rmem_max;
  718.  
  719.  
  720. # increase Linux auto tuning TCP buffer limits
  721. # min, default, and max number of bytes to use
  722. # set max to at least 4MB, or higher if you use very high BDP paths
  723. #echo "524280" > /proc/sys/net/core/rmem_default # default:
  724. #echo "524280" > /proc/sys/net/core/wmem_default # default:
  725. # Increase the maximum total TCP buffer-space allocatable
  726. sysctl -w net.ipv4.tcp_mem="57344 57344 65536"
  727.  
  728. echo 1 > /proc/sys/net/ipv4/tcp_moderate_rcvbuf # enabled by default
  729. # removes an odd behavior in the 2.6 kernels, whereby the kernel stores the slow start threshold for a client between TCP sessions. This can cause undesired results, as a single period of congestion can affect many subsequent connections.
  730.  
  731. echo 256960 > /proc/sys/net/core/rmem_default;
  732. echo 256960 > /proc/sys/net/core/wmem_default;
  733. echo 4096 16384 404480 > /proc/sys/net/ipv4/tcp_wmem;
  734. echo 4096 87380 404480 > /proc/sys/net/ipv4/tcp_rmem;
  735. setprop net.tcp.buffersize.default 4096,87380,256960,4096,16384,256960;
  736. setprop net.tcp.buffersize.wifi 4095,87380,256960,4096,16384,256960;
  737. setprop net.tcp.buffersize.umts 4094,87380,256960,4096,16384,256960;
  738.  
  739.  
  740. # Increase the tcp-time-wait buckets pool size
  741. #sysctl -w net.ipv4.tcp_max_tw_buckets="1440000"
  742. # default: 180000
  743.  
  744. # Increase the maximum amount of option memory buffers
  745. #sysctl -w net.core.optmem_max="57344"
  746. # default: 20480
  747.  
  748. # disable ECN
  749. # enable it - since it's needed for SFB to work properly/optimally
  750. # echo "0" > /proc/sys/net/ipv4/tcp_ecn # default at 2
  751. # explicitly disable it since there's still buggy routers and other stations involved that break networking
  752.  
  753.  
  754.  
  755. # ==============================================================
  756. # ==============================================================
  757. # ==============================================================
  758. # network security related settings
  759. # ==============================================================
  760. # ==============================================================
  761. # ==============================================================
  762.  
  763.  
  764.  
  765.  
  766. # disables IP source routing (for ipv4)
  767.  
  768. #for i in /proc/sys/net/ipv4/conf/*; do
  769. # /bin/echo "0" > $i/accept_source_route
  770. #done # does not get applied - FIXME
  771.  
  772. ## echo "1" > /proc/sys/net/ipv4/conf/all/accept_source_route ## fix wifi, networking issues # leave at default
  773.  
  774.  
  775. #for i in /proc/sys/net/ipv6/conf/*; do
  776. # /bin/echo "0" > $i/accept_source_route
  777. #done # does not get applied - FIXME
  778.  
  779. ## echo "1" > /proc/sys/net/ipv6/conf/all/accept_source_route ## fix wifi, networking issues # leave at default
  780.  
  781. # These commands configure the server to ignore redirects from machines that are listed as
  782. # gateways. Redirect can be used to perform attacks, so we only want to allow them from
  783. # trusted sources:
  784.  
  785. #for i in /proc/sys/net/ipv4/conf/*; do
  786. # /bin/echo "1" > $i/secure_redirects
  787. #done
  788.  
  789. ## echo "0" > /proc/sys/net/ipv4/conf/all/secure_redirects ## fix wifi, networking issues # leave at default
  790.  
  791. #for i in /proc/sys/net/ipv6/conf/*; do
  792. # /bin/echo "1" > $i/secure_redirects
  793. #done
  794.  
  795. # disables IP redirects (for ipv4)
  796. #for i in /proc/sys/net/ipv4/conf/*; do
  797. # /bin/echo "0" > $i/accept_redirects
  798. #done # does not get applied - FIXME
  799.  
  800. # echo "1" > /proc/sys/net/ipv4/conf/all/accept_redirects ## fix wifi, networking issues # leave at default
  801.  
  802. #for i in /proc/sys/net/ipv6/conf/*; do
  803. # /bin/echo "0" > $i/accept_redirects
  804. #done # does not get applied - FIXME
  805.  
  806. # echo "1" > /proc/sys/net/ipv6/conf/all/accept_redirects ## fix wifi, networking issues # leave at default
  807.  
  808. # If this server does not act as a router, it does not have to send redirects, so they can be
  809. # disabled:
  810.  
  811. #for i in /proc/sys/net/ipv4/conf/*; do
  812. # /bin/echo "0" > $i/send_redirects
  813. #done # does not get applied - FIXME
  814.  
  815. # echo "1" > /proc/sys/net/ipv4/conf/all/send_redirects ## fix wifi, networking issues # # leave at default
  816.  
  817. # Configure the server to ignore broadcast pings and smurf attacks:
  818. # (smurf-attacks)
  819.  
  820. echo "1" > /proc/sys/net/ipv4/icmp_echo_ignore_broadcasts # default
  821.  
  822. echo "1" > /proc/sys/net/ipv6/icmp_echo_ignore_broadcasts # default
  823.  
  824. # Ignore all kinds of icmp packets or pings:
  825.  
  826. echo "1" > /proc/sys/net/ipv4/icmp_echo_ignore_all # default: 0
  827.  
  828. echo "1" > /proc/sys/net/ipv6/icmp_echo_ignore_all # default: 0
  829.  
  830. # Some routers send invalid responses to broadcast frames, and each one generates a
  831. # warning that is logged by the kernel. These responses can be ignored:
  832.  
  833. echo "1" > /proc/sys/net/ipv4/icmp_ignore_bogus_error_responses
  834.  
  835. echo "1" > /proc/sys/net/ipv6/icmp_ignore_bogus_error_responses
  836.  
  837. # When the server is heavily loaded or has many clients with bad connections with high
  838. # latency, it can result in an increase in half-open connections. This is common for Web
  839. # servers, especially when there are a lot of dial-up users. These half-open connections are
  840. # stored in the backlog connections queue. You should set this value to at least 4096. (The
  841. # default is 1024.)
  842. # Setting this value is useful even if your server does not receive this kind of connection,
  843. # because it can still be protected from a DoS (syn-flood) attack.
  844.  
  845. echo 4096 > /proc/sys/net/ipv4/tcp_max_syn_backlog # default: 128
  846.  
  847. echo 2 > /proc/sys/net/ipv4/tcp_synack_retries # default: 5
  848.  
  849. # Increase the number of outstanding syn requests allowed.
  850. # Note: some people (including myself) have used tcp_syncookies to handle the problem of too many legitimate outstanding SYNs.
  851.  
  852. echo "2500" > /proc/sys/net/core/netdev_max_backlog # default: 1000
  853. echo "1" > /proc/sys/net/ipv4/tcp_window_scaling # default
  854.  
  855. # While TCP SYN cookies are helpful in protecting the server from syn-flood attacks, both
  856. # denial-of-service (DoS) or distributed denial-of-service (DDoS), they could have an
  857. # adverse effect on performance. We suggest enabling TCP SYN cookies only when there is
  858. # a clear need for them.
  859.  
  860. # enabling syncookies
  861. echo "1" > /proc/sys/net/ipv4/tcp_syncookies # default
  862.  
  863. #echo "0" > /proc/sys/net/ipv6/tcp_syncookies
  864.  
  865. # We have also learned that window scaling can be an option to enlarge the transfer
  866. # window. However, benchmarks have shown that window scaling is not suited for systems
  867. # experiencing very high network load. Additionally, some network devices do not follow the
  868. # RFC guidelines and could cause window scaling to malfunction. We suggest disabling
  869. # window scaling and manually setting the window sizes.
  870.  
  871. # sysctl -w net.ipv4.tcp_window_scaling=1
  872. echo "1" > /proc/sys/net/ipv4/tcp_window_scaling # default
  873.  
  874. # log and drop "martian" packets
  875.  
  876. #for i in /proc/sys/net/ipv4/conf/*; do
  877. # /bin/echo "1" > $i/log_martians
  878. #done # does not get applied - FIXME
  879.  
  880. # echo "1" > /proc/sys/net/ipv4/conf/all/log_martians
  881.  
  882. # enable reverse path-filtering [prevents IP-Spoofing]
  883. #for i in /proc/sys/net/ipv4/conf/*; do
  884. # /bin/echo "1" > $i/rp_filter
  885. #done # does not get applied - FIXME
  886.  
  887. #echo "1" > /proc/sys/net/ipv4/conf/all/rp_filter # not enabled by default # uncomment for enhanced security & NOT using VPN (breaks VPN functionality)
  888.  
  889. # disable IP dynaddr
  890. echo "0" > /proc/sys/net/ipv4/ip_dynaddr # default
  891.  
  892.  
  893.  
  894.  
  895. # ==============================================================
  896. # ==============================================================
  897. # ==============================================================
  898. # general phone/RIL-related settings
  899. # ==============================================================
  900. # ==============================================================
  901. # ==============================================================
  902. # =========
  903. # TWEAKS: optimized for 3G/Edge speed
  904. # =========
  905. setprop ro.ril.hsxpa 2; # disabling HSPA does not work so make full use of it
  906. setprop ro.ril.gprsclass 12;
  907. setprop ro.ril.hep 1;
  908. #setprop ro.ril.enable.dtm 1; # potential fix for disappearing data connection on GSM phones
  909. setprop ro.ril.hsdpa.category 8;
  910. setprop ro.ril.enable.a53 1;
  911. setprop ro.ril.enable.3g.prefix 1;
  912. setprop ro.ril.htcmaskw1.bitmask 4294967295;
  913. setprop ro.ril.htcmaskw1 14449;
  914. setprop ro.ril.hsupa.category 7;
  915.  
  916. # =========
  917. # TWEAKS: optimized for 2G security [not sure if it works]
  918. # =========
  919. ro.ril.enable.gea3=1
  920.  
  921. # =========
  922. # TWEAKS: agps [network assisted gps] stuff optimizations
  923. # =========
  924. setprop ro.ril.def.agps.feature=1 # also default ?
  925. setprop ro.ril.def.agps.mode=2 # default value
  926.  
  927. # For HSDPA low throughput
  928. # setprop ro.ril.disable.power.collapse = 1
  929.  
  930. # =========
  931. # TWEAKS: overall
  932. # =========
  933. setprop ro.telephony.call_ring.delay 100; # let's minimize the time Android waits until it rings on a call
  934. setprop ro.ril.disable.power.collapse 0;
  935. #setprop pm.sleep_mode 0;
  936. #setprop dalvik.vm.startheapsize 8m;
  937. #setprop dalvik.vm.heapsize 64m; # leave that setting to cyanogenmod settings or uncomment it if needed
  938. setprop wifi.supplicant_scan_interval 60; # higher is not recommended, scans while not connected anyway so shouldn't affect while connected
  939. setprop windowsmgr.max_events_per_sec 60; # smoother GUI
  940. #echo 64000 > /proc/sys/kernel/msgmni;
  941. echo 500 512000 64 2048 > /proc/sys/kernel/sem; # allow more semaphores
  942. #echo 5000 > /proc/sys/kernel/threads-max;
  943. echo 0 > /proc/sys/kernel/hung_task_timeout_secs;
  944.  
  945.  
  946. #media.stagefright.enable-player=true
  947. #media.stagefright.enable-meta=true
  948. #media.stagefright.enable-scan=true
  949. #media.stagefright.enable-http=true
  950.  
  951.  
  952. # ==============================================================
  953. # ==============================================================
  954. # ==============================================================
  955. # Optimize SQlite databases of apps
  956. # ==============================================================
  957. # ==============================================================
  958. # ==============================================================
  959. # =========
  960. for i in \
  961. `find /data -iname "*.db"`;
  962. do \
  963. sqlite3 $i 'VACUUM;';
  964. done;
  965.  
  966.  
  967. # ==============================================================
  968. # ==============================================================
  969. # ==============================================================
  970. # TWEAKS: improve handling & reactivity of the CFS cpu scheduler
  971. # ==============================================================
  972. # ==============================================================
  973. # ==============================================================
  974. # =========
  975.  
  976. if [ -e /proc/sys/kernel/rr_interval ];
  977. then
  978. # BFS;
  979. echo 6 > /proc/sys/kernel/rr_interval;
  980. echo 100 > /proc/sys/kernel/iso_cpu;
  981. else
  982. # CFS
  983. # following 2 settings are to be handled with care - could lead to bootlooping phone or other issues if too low !
  984. echo 100000 > /proc/sys/kernel/sched_latency_ns; # 1000000 # 18000000 # 1000000 # 100000 ## new
  985. echo 500000 > /proc/sys/kernel/sched_wakeup_granularity_ns ; # 500000 # 3000000 # 25000 # 0 (?)
  986. echo 750000 > /proc/sys/kernel/sched_min_granularity_ns; # 1000000 # 1500000 # 100000 # 1000000 ## 750000 (upstream)
  987. #echo -1 > /proc/sys/kernel/sched_rt_runtime_us;
  988. #echo 100000 > /proc/sys/kernel/sched_rt_period_us;
  989. #echo 95000 > /proc/sys/kernel/sched_rt_runtime_us; # default: 950000; very small values in sched_rt_runtime_us can result in an unstable system when the runtime is so small
  990. # the system has difficulty making forward progress (the migration thread and kstopmachine both are real-time processes)
  991. fi;
  992.  
  993.  
  994. # =========
  995. # TWEAKS: new scheduler performance settings (test)
  996. # =========
  997.  
  998. #echo "now disabling GENTLE_FAIR_SLEEPERS"
  999. echo "NO_GENTLE_FAIR_SLEEPERS" > /sys/kernel/debug/sched_features
  1000. #cat /sys/kernel/debug/sched_features
  1001. #echo "done"
  1002. #echo ""
  1003. #echo "now disabling FAIR_SLEEPERS"
  1004. echo "NO_NEW_FAIR_SLEEPERS" > /sys/kernel/debug/sched_features
  1005. #cat /sys/kernel/debug/sched_features
  1006. #echo "done"
  1007. #echo "now disabling NORMALIZED_SLEEPERS"
  1008. echo "NO_NORMALIZED_SLEEPER" > /sys/kernel/debug/sched_features
  1009. #cat /sys/kernel/debug/sched_features
  1010. #echo "done"
  1011. echo "24319" > /proc/sys/kernel/sched_features
  1012.  
  1013. # =========
  1014. # TWEAKS: raise throughput & responsiveness [reboots & instability ?!]
  1015. # =========
  1016.  
  1017. #echo "now disabling FAIR_SLEEPERS"
  1018. #echo "NO_NEW_FAIR_SLEEPERS" > /sys/kernel/debug/sched_features
  1019. #cat /sys/kernel/debug/sched_features
  1020. #echo "done"
  1021. #echo ""
  1022. #echo "now disabling START_DEBIT"
  1023. #echo "NO_START_DEBIT" > /sys/kernel/debug/sched_features
  1024. #cat /sys/kernel/debug/sched_features
  1025. #echo "done"
  1026. #echo ""
  1027. #echo "now disabling LB_BIAS"
  1028. #echo "NO_LB_BIAS" > /sys/kernel/debug/sched_features
  1029. #cat /sys/kernel/debug/sched_features
  1030. #echo "done"
  1031. #echo ""
  1032.  
  1033. #echo "now disabling NEXT_BUDDY"
  1034. #echo "NO_NEXT_BUDDY" > /sys/kernel/debug/sched_features
  1035. #cat /sys/kernel/debug/sched_features
  1036. #echo "done"
  1037. #echo ""
  1038.  
  1039. #echo "now enabling sched_child_runs_first"
  1040. #echo "1" > /proc/sys/kernel/sched_child_runs_first
  1041. #cat /proc/sys/kernel/sched_child_runs_first
  1042. #echo "done"
  1043. #echo ""
  1044.  
  1045.  
  1046. # =========
  1047. # TWEAKS: low-latency features [issues with auto-rotation & stuff]
  1048. # =========
  1049.  
  1050. #echo "now enabling the low-latency functionality of CFS provided by"
  1051. #echo "Mathieu Desnoyers & Peter Zijlstra, sponsored by Nokia"
  1052.  
  1053. #for opt in DYN_MIN_VRUNTIME \
  1054. # NO_FAIR_SLEEPERS FAIR_SLEEPERS_INTERACTIVE FAIR_SLEEPERS_TIMER \
  1055. # INTERACTIVE TIMER \
  1056. # INTERACTIVE_FORK_EXPEDITED TIMER_FORK_EXPEDITED;
  1057. #do echo $opt > /sys/kernel/debug/sched_features;
  1058. #done
  1059.  
  1060. #echo "low-latency for CFS activated ..."
  1061. #echo "done"
  1062.  
  1063.  
  1064.  
  1065. # ==============================================================
  1066. # ==============================================================
  1067. # ==============================================================
  1068. # remove lag when answering phone calls
  1069. # ==============================================================
  1070. # ==============================================================
  1071. # ==============================================================
  1072. # =========
  1073. #MAX_PHONE()
  1074. #{
  1075. #pidphone=`pidof com.android.phone`;
  1076. #if [ $pidphone ]; # Wait for com.android.phone to start;
  1077. #then#
  1078. # echo -17 > /proc/$pidphone/oom_adj; # exclude com.android.phone from oom-killer;
  1079. # renice -20 $pidphone; # set highest nice level for com.android.phone;
  1080. ## log -p i -t SSSwitch_v0.8 "*** MAX phone *** set oom_adj(-17) and nice(-20) for com.android.phone";
  1081. # exit;
  1082. #else
  1083. # sleep 5;
  1084. # MAX_PHONE;
  1085. #fi;
  1086. #}
  1087.  
  1088.  
  1089.  
  1090. # =========
  1091. # Background process to optimize dialer process
  1092. # =========
  1093. #(while [ 1 ];
  1094. #do
  1095. # sleep 10;
  1096. # MAX_PHONE;
  1097. #done &);
  1098.  
  1099.  
  1100.  
  1101.  
  1102. # ==============================================================
  1103. # ==============================================================
  1104. # ==============================================================
  1105. # renicing kswapd (useful on non-swap phones)
  1106. # ==============================================================
  1107. # ==============================================================
  1108. # ==============================================================
  1109. # =========
  1110. #KSWAPD_RENICE()
  1111. #{
  1112. #pidkswapd=`pidof kswapd0`;
  1113. #if [ $pidkswapd ]; # Wait for kswapd to be available;
  1114. #then
  1115. # renice 19 $pidkswapd; # set kswapd lowest nice level possible;
  1116. # exit;
  1117. #else
  1118. # sleep 5;
  1119. # KSWAPD_RENICE;
  1120. #fi;
  1121. #}
  1122.  
  1123.  
  1124.  
  1125. # =========
  1126. # Background process to keep priority of kwapd low
  1127. # =========
  1128. #(while [ 1 ];
  1129. #do
  1130. # sleep 10;
  1131. # KSWAPD_RENICE;
  1132. #done &);
  1133.  
  1134.  
  1135.  
  1136.  
  1137.  
  1138.  
  1139. # =========
  1140. # Changelog
  1141. # =========
  1142.  
  1143.  
  1144. # sdcard reading fix by brainmaster
  1145. # moved CFS cpu scheduler tweaks from 90screenstate_scaling to here; tweaks to read & write
  1146. # trying out CFS scheduler with lower refresh rate for more throughput & performance [fine]
  1147. # enable low-latency features and allow higher throughput
  1148. # disable readhead for other partitions (overhead) but keep write improvements enabled
  1149. # less tight scheduler timings
  1150. # fix disappearing data connection on GSM phones
  1151. # corrected paths for write tweak (thanks nexxx85 !)
  1152. # V21: stricter scheduler timings to make the phone operation smoother [needs stability & function testing]
  1153. # V22: fixed network security settings (some did not get applied)
  1154. # V23: disabled the ICMP parts
  1155. # V24: add notes for VPN users:
  1156. # set 'echo "1" > /proc/sys/net/ipv4/conf/all/rp_filter'
  1157. # to
  1158. # 'echo "0" > /proc/sys/net/ipv4/conf/all/rp_filter'
  1159. # V27: re-enable scheduler settings @ Quorra pre-11_test3; false reports about phone reboots
  1160. # V28: set "deadline" as default i/o scheduler
  1161. # V29: enable read_ahead_kb optimization globally (testing)
  1162. # V30: keep stock scheduler settings
  1163. # V31: re-enable ICMP security measures
  1164. # V32: improved approach of the SD-card (readhaead) speed-fix; implementation by Darkyy (included in DarkyROM 10.1)
  1165. # V33: switch to cfq for Samsung GB ROMs (due to latency and lack of writeback-improvements [can't be applied - leads to reboot / non-boot])
  1166. # V34: fix some minor typos
  1167. # V35: moved some tweaks from the screenstate_scaling script here (for Samsung ROMs)
  1168. # V36: moved vfs_cache_pressure here
  1169. # V37: added memory tweaks by Juwe11
  1170. # V38: switch to deadline for CM7/MIUI base; swappiness at 0 (for now - no zram yet)
  1171. # V39: do not log martians (no dmesg / printk so no use for it)
  1172. # V40: add some scheduler tweaks from upstream
  1173. # V41: tweak the deadline ioscheduler some more (fifo_batch)
  1174. # V42: moved changelog to bottom to make things more clear
  1175. # V43: add some background processes to make the phone more reliable and responsive (phone dialer & kswapd0) [testing]
  1176. # V44: added some descriptions to make it hopefully more clear and easy to use
  1177. # V45: disable kswapd and phone background processes
  1178. # V46: set the wifi scanning interval back to 60 (180 was too much, if it doesn not scan often enough got to -> settings -> wireless & network -> wifi settings -> and it will scan immediately or use a wifi widget)
  1179. # V47: just leave the trouble-causing network-settings commented out and thus at default, might work better that way
  1180. # V48: made the script BFS & CFS cpu scheduler aware
  1181. # V49: some more scheduler performance settings (test)
  1182. # V50: disabling iostats to reduce overhead (thanks to kodos96 !)
  1183. # V51: some readahead tweaks - thanks to corgar !
  1184. # V52: inherited stuff from the screenstate_scaling script
  1185. # V53: more tweaks in several areas
  1186. # V54: some more tweaks & explanations
  1187.  
  1188.  
  1189. s99acidext4tweak
  1190.  
  1191. #!/system/bin/sh
  1192. mount -o remount,nobh,noatime,barrier=0 /system /system
  1193. mount -o remount,nobh,noatime,barrier=0 /cache /cache
  1194. mount -o remount,nobh,noatime,barrier=0 /data /data
  1195.  
  1196. S99complete
  1197.  
  1198. #!/system/bin/sh
  1199.  
  1200. sync;
  1201. setprop cm.filesystem.ready 1;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement