yashsingh1/xdaforums huggingface dataset:
[Galaxy S Advance I9070 Original Android Developmen] ChronoMonochrome:
Not sure if it is enabled.

The problem is that mentioned things (like killing those apps) sometimes happens in real life. In order to be sure that it won't happen, for me easier just keep zram enabled...

BTW, how do you think, might be hotunplug feature useful? I know, it's not helpful, when implemented by "traditional" methods, but I think that it might save power, if we hot-unplug CPU1 when at lowest freq and only if load is not high. I was inspired when saw how it works on Moto G - it hotplugs all CPUs before it makes input boost. I tried to do it that way, but it seems buggy https://github.com/ChronoMonochrome/Chrono_Kernel/compare/a43b804527...fda88fed892259

and in kmsg occurs messages

<3>[ 723.191070] BUG: scheduling while atomic: irq/474-bt404_t/871/0x00000003
<4>[ 723.191131] Modules linked in: dhd zram(C) cpufreq_zenx cpufreq_ondemandplus cpufreq_interactive cpufreq_dynamic bthid param(P) j4fs(P) f2fs
<4>[ 723.191375] [<c00be9f4>] (unwind_backtrace+0x0/0xec) from [<c056e1e0>] (__schedule+0x4e4/0x78c)
<4>[ 723.191436] [<c056e1e0>] (__schedule+0x4e4/0x78c) from [<c056eac4>] (schedule_timeout+0x180/0x204)
<4>[ 723.191528] [<c056eac4>] (schedule_timeout+0x180/0x204) from [<c056da58>] (wait_for_common+0xa0/0x158)
<4>[ 723.191589] [<c056da58>] (wait_for_common+0xa0/0x158) from [<c0100d0c>] (kthread_create_on_node+0x74/0xd4)
<4>[ 723.191680] [<c0100d0c>] (kthread_create_on_node+0x74/0xd4) from [<c00fa688>] (create_worker+0xb0/0x188)
<4>[ 723.191772] [<c00fa688>] (create_worker+0xb0/0x188) from [<c055e29c>] (workqueue_cpu_callback.isra.28+0xa8/0x20c)
<4>[ 723.191864] [<c055e29c>] (workqueue_cpu_callback.isra.28+0xa8/0x20c) from [<c010654c>] (notifier_call_chain+0x44/0x84)
<4>[ 723.191925] [<c010654c>] (notifier_call_chain+0x44/0x84) from [<c0568f50>] (_cpu_up+0x84/0x13c)
<4>[ 723.191986] [<c0568f50>] (_cpu_up+0x84/0x13c) from [<c0569078>] (cpu_up+0x70/0x8c)
<4>[ 723.192077] [<c0569078>] (cpu_up+0x70/0x8c) from [<bf044b28>] (hotplug+0x48/0x50 [cpufreq_dynamic])
<4>[ 723.192169] [<bf044b28>] (hotplug+0x48/0x50 [cpufreq_dynamic]) from [<bf044c48>] (hotplug_input_event+0x118/0x124 [cpufreq_dynamic])
<4>[ 723.192291] [<bf044c48>] (hotplug_input_event+0x118/0x124 [cpufreq_dynamic]) from [<c0342cd4>] (input_pass_event+0xe8/0xf4)
<4>[ 723.192352] [<c0342cd4>] (input_pass_event+0xe8/0xf4) from [<c0344a40>] (input_event+0x60/0x70)
<4>[ 723.192443] [<c0344a40>] (input_event+0x60/0x70) from [<c0345c94>] (input_mt_report_slot_state+0x74/0xa0)
<4>[ 723.192504] [<c0345c94>] (input_mt_report_slot_state+0x74/0xa0) from [<c034a6a8>] (bt404_ts_interrupt+0x534/0x874)
<4>[ 723.192596] [<c034a6a8>] (bt404_ts_interrupt+0x534/0x874) from [<c01226d0>] (irq_thread+0x158/0x220)
<4>[ 723.192657] [<c01226d0>] (irq_thread+0x158/0x220) from [<c0100e74>] (kthread+0x84/0x88)
<4>[ 723.192718] [<c0100e74>] (kthread+0x84/0x88) from [<c00b9228>] (kernel_thread_exit+0x0/0x8)

For some reason it hot-unplugs CPU1 only when going to lowest freq from higher, and sometimes doesn't hotplug CPU1 even if load > HOTUNPLUG_LOAD. Although I'm not familiar with governors and probably I missed something.
[Galaxy S Advance I9070 Original Android Developmen] ace2nutzer:
same here.. i use zRam on the full amount of RAM .. not only 100MB .. this + changed minfree Values make it possible to run the Game Real Racing 3 in Multiplayer mode (online) smooth and fast.

Also i suggest to don't use KSM .... even with or without + check pages.. the Ram management is much badly.. also i suggest to don't use the option: allow purging of assets .. this also make the Phone running much badly.

But the "swap" itself i've never tried it.. because i think that will damage the sdcard or mmc flash if we use it as ram...

Also i can confirm that memory management (LMK) is not working fully efficiently.. sometimes the System go in out of memory (OOM) with no reason .. because the swap (zRam) is enough free... actually with upsoulutely full load i've never seen more then 300MB used for zRam .. (totally is 642000kb (627MB)

But anyway.. the best multitasking is with this Values:

(Copied from my init.d script)

# Set custom Minfree Values (Memory Management for Multitasking)

echo 5120,6400,7680,8960,10240,11520 > /sys/module/lowmemorykiller/parameters/minfree

and for Gaming:

# Set custom Minfree Values (Memory Management for Gaming)

# echo 3840,5120,6400,154880,156160,157440 > /sys/module/lowmemorykiller/parameters/minfree

I hope i did help a bit :)
[Galaxy S Advance I9070 Original Android Developmen] ChronoMonochrome:
This

might be a reason for quotation above. For now use only 200 Mb zram - I think there's no need more (with compressing ratio 1:3, even 200 MB gives effect which is similar to 600 MB of free RAM). Don't know if it's helpful - I also use two zram devices instead of only one + tweaked swappiness to let zram devices be used a bit faster:

#!system/bin/sh
set -x

SIZE=100

insmod /system/lib/modules/zram.ko num_devices=2
echo $(($SIZE * 1024 * 1024)) > /sys/devices/virtual/block/zram0/disksize
echo $(($SIZE * 1024 * 1024)) > /sys/devices/virtual/block/zram1/disksize

mkswap /dev/block/zram0
mkswap /dev/block/zram1
swapon -p 10 /dev/block/zram0
swapon -p 10 /dev/block/zram1

echo 75 > /proc/sys/vm/swappiness

P.s. you've to compile zram as module for script above or edit zram sources to enable two zram devices.
[Galaxy S Advance I9070 Original Android Developmen] cocafe:
I dont use zram or swap, it makes phone freeze more likely

从我的 iPhone 发送，使用 Tapatalk
[Galaxy S Advance I9070 Original Android Developmen] SinWei97:
I'm using cm10.2 and I would like to try this kernel out...do I need to flash something else? Or straight kernel
[Galaxy S Advance I9070 Original Android Developmen] mkaluza:
Not flash, just copy. Read the readme in ramdisks folder - it's all written there. And post here if you succeeded ;)
[Galaxy S Advance I9070 Original Android Developmen] mkaluza:
thanks for the input guys :) Those are interesting things :) I'll probably just do two release builds then - swap and noswap.

[MENTION=389932]Ace2[/MENTION]nuter - how/when do you reprogram lmk? automatically or manually? Because that's another thing that could be done with something like per-app system performance profiles.

You're right about ksm - the implementation from our kernel is not efficient for android, though I suppose that backporting it from original kk kernel might help since for kk it's officialy recommended for low mem devices. But it uses quite a lot of cputime (in our kernel)

[MENTION=5695278]ChronoMonochrome[/MENTION] I don't think having two zram devices differs in anything from having one twice as big... where did you found it?

btw if you use zram, set /proc/sys/vm/page_cluser to 0 - I've found somewhere that it's recommended for zram (or the other way - not necessary to have it == 3, which is the default).
[Galaxy S Advance I9070 Original Android Developmen] mkaluza:
Hotplugging cpus on arm is useful only in big.LITTLE architecture. Otherwise I doubt it is beneficial at all (and it does add overhead to up and down the cpu)

This is the reason for oops

<3>[ 723.191070] BUG: scheduling while atomic: irq/474-bt404_t/871/0x00000003

Something in cpu_up/down calls a function that might sleep (looking at the oops it's the hotplug code) and you are in interrupt context (which is also atomic) - see the end-3 line. Go read the LDD3 book - it'll make much more sense to you then.

run hotplug functions as jobs that are scheduled from checkcpu to avoid the oops (see dynamic gov code input boost - it's used there and few other places as well).
[Galaxy S Advance I9070 Original Android Developmen] ChronoMonochrome:
Don't remember, where it's :) But you're right, it makes no difference here, but probably it's useful only on PC.

Thanks for explanation :)

p.s. tried a bit with hotplugging - but it only unnecessarily cause huge load on CPU, and of course, everything then getting messed :/

Seems it makes sense only when CPU has at least 4 cores.
[Galaxy S Advance I9070 Original Android Developmen] mkaluza:
I'm running 200m zram swap now with those enabled

CONFIG_RESOURCE_COUNTERS=y

CONFIG_CGROUP_MEM_RES_CTLR=y

CONFIG_CGROUP_MEM_RES_CTLR_SWAP=y

CONFIG_CGROUP_MEM_RES_CTLR_SWAP_ENABLED=y

page-cluster set to 1 and I must say that it feels better. And I opened maps, gmail, skype, viber, docs, keep and then returned to maps and they were still alive ;)

What's more - the swap is only 28% used with a compression ratio of 44%, so it saves me 33M of memory.

Enabling those res* options costs 2,5M of ram, but I can live with it for now. Will see how's battery life affected... [MENTION=5840412]ace2nutzer[/MENTION] - if you're experiencing strange lmk behaviour, enable those settings (assuming you're using kk, I don't know if jb can use them) [MENTION=5695278]ChronoMonochrome[/MENTION] - I know what 2 swaps are for - it's 1 for each cpu, so they can be used in parallel. But I'm not sure if it's a good idea... if that would make any difference, that means you're seriously out of memory anyway...

The only downside I've noticed is that there's nearly no disk cache left. But will try to do sth about it.

Later I'll try to cherry-pick lz4 from chrono - this should save some cpu cycles and I think it has zcache enabled and actually being used, so will test it as well.
[Galaxy S Advance I9070 Original Android Developmen] SinWei97:
okay im not very sure....i have read the readme.txt. in the ramdisk folder....a little bit confuse....should i extract the boot.cpio.gz into the /efs? or should not

and after i put the file into /efs ,i flash the kernel...if it boot...its okay?

well if it was not booting up....i should do it in the recovery? follwing the step?

(To create an image for your current rom, login via adb as root and run:

cd /

find . -xdev | cpio -o -Hnewc | gzip -9 > /efs/boot.cpio.gz

To verify what's in the archive, run

zcat /efs/boot.cpio.gz | cpio -t)
[Galaxy S Advance I9070 Original Android Developmen] mkaluza:
Hi :) thanks for the input :)

You almost got it right, but not in this order ;) There's no ramdisk for cm10.2, so you need to make one yourself. Login with adb and run

cd /
find . -xdev | cpio -o -Hnewc | gzip -9 > /efs/boot.cpio.gz

this will produce the /efs/boot.cpio.gz file - check if it's there (ls -l /data/boot.cpio.gz)

you can list it's contents with

zcat /efs/boot.cpio.gz | cpio -t
[/cod]e

and then flash my kernel and it should boot.

if you wanted to use one of the ramdisks provided (but there's no ramdisk for 10.2...), you just need to download it, rename to boot.cpio.gz and move into /efs. Than flash the kernel and that's it ;)

I hope it's more clear now :) later I'll try to improve the readme as well
[Galaxy S Advance I9070 Original Android Developmen] ace2nutzer:
Thank u for the tweak.. i'll test it soon.. and then i'll tell u if it helps.

Minfree Values are ROM related.. i've searched the full Kernel sources and Ramdisk.. but nothing...

I use CM 11 by TC.. and the default minfree Values are:

40

50

60

70

80

100MB

and i use the following Values for normal Usage.. (Multitasking)

20

25

30

35

40

45MB

and for Gaming, very aggressively Values:

15

20

25

615

620

625MB

Actually i use the aggressive Values only for one Game: Real Racing 3 ... and i use to switching between normal and aggresive values TASKER .. .. it works automatically.. (very nice app .. i do much things with it.. wakelock for BLN ..... blinking for BLN... and BLN with no blinking when the Battery is full )

@ KSM

i found this in Ramdisk.. in init.cm.rc:

# allow system to modify ksm control files
chown root system /sys/kernel/mm/ksm/pages_to_scan
chmod 0664 /sys/kernel/mm/ksm/pages_to_scan
chown root system /sys/kernel/mm/ksm/sleep_millisecs
chmod 0664 /sys/kernel/mm/ksm/sleep_millisecs
chown root system /sys/kernel/mm/ksm/run
chmod 0664 /sys/kernel/mm/ksm/run
write /sys/kernel/mm/ksm/sleep_millisecs 500
write /sys/kernel/mm/ksm/pages_to_scan 100
write /sys/kernel/mm/ksm/deferred_timer 1

and @ LMK in init.rc:

on early-init
# Set init and its forked children's oom_adj.
write /proc/1/oom_adj -16

and in the same file:

# Create cgroup mount point for memory
mount tmpfs none /sys/fs/cgroup mode=0750,uid=0,gid=1000
mkdir /sys/fs/cgroup/memory 0750 root system
mount cgroup none /sys/fs/cgroup/memory memory
write /sys/fs/cgroup/memory/memory.move_charge_at_immigrate 1
chown root system /sys/fs/cgroup/memory/tasks
chmod 0660 /sys/fs/cgroup/memory/tasks
mkdir /sys/fs/cgroup/memory/sw 0750 root system
write /sys/fs/cgroup/memory/sw/memory.swappiness 100
write /sys/fs/cgroup/memory/sw/memory.move_charge_at_immigrate 1
chown root system /sys/fs/cgroup/memory/sw/tasks
chmod 0660 /sys/fs/cgroup/memory/sw/tasks

is there something to debug / optimize ???

Thanks i'll try it...

or cherry-pick this: (the same)

https://github.com/ace2nutzer/Samsung_STE_Kernel/commit/63c51319567fcec2737de05b72abd7c5e2db1220

But i don't understand what does zCache .. i believe it's not activated.. on my defconfig .. (i'll check it later)
[Galaxy S Advance I9070 Original Android Developmen] SinWei97:
A little question here....I installed this kernel on cm10.1.And it boot successful into the OS

Now.... since novathor setting are not compatible with android 4.2.2. So what apps should we use to tune / modifi the kernel? :confused:

thank for the kernel for our beloved phone :highfive:
[Galaxy S Advance I9070 Original Android Developmen] gianfrinico:
You can adapt this kernel to a this AOSP?

http://xdaforums.com/showthread.php?t=2581768
[Galaxy S Advance I9070 Original Android Developmen] mkaluza:
No
[Galaxy S Advance I9070 Original Android Developmen] TPD-21:
Hello ... [MENTION=3329816]mkaluza[/MENTION], here I just want to leave a feedback (attached). Well, I will give feedback to the next if something had happened to my janice. ;) Btw, good job, man. Thanks very much. :good:

PS. Bugs : Frequency lowest CPU is at 400Mhz . And can not be lowered again to 100Mhz . ( It's like I 've ever experienced on the build of the previous TC , forget which version ).
[Galaxy S Advance I9070 Original Android Developmen] SinWei97:
Guys...for everyone who using cm10.2 i have created a ramdisk for the rom to make the kernel boot into system....mine succesful booted into system , so i'm just sharing my file to you guys :)
[MENTION=3329816]mkaluza[/MENTION] thank for teaching me what to do with the command :)
[Galaxy S Advance I9070 Original Android Developmen] mkaluza:
Next time it happens pm me with the contents of /sys/kernel/debug/prcmu-qos/arm_requirements

Another thing - do you have touchboost enabled? This one via touchscreen driver? If yes, change

/sys/kernel/mxt224e/touchboost_freqto 100000 and see if the problem continues to appear (remember to set it at each reboot, init.d/boot.d script would be best)
[Galaxy S Advance I9070 Original Android Developmen] mkaluza:
[MENTION=4471434]Force[/MENTION] did you test stock jb ramdisk? You wanted this kernel for stock...
[Galaxy S Advance I9070 Original Android Developmen] #Henkate:
I didnt because i dont had time. Im sorry. I will do it tomorrow as im on jb right now.
[Galaxy S Advance I9070 Original Android Developmen] mkaluza:
Do you use f2fs? If yes, on what partition?
[Galaxy S Advance I9070 Original Android Developmen] TPD-21:
[MENTION=3329816]mkaluza[/MENTION] : I'm really sorry, if my post has violated your protocols ( without me knowing it ). But, to be honest I just wanted to try and prove directly that :

your kernel's can work well for my current ROM. :angel: Oh yeah, I also do not use "touchscreen driver" . My current ROM without many settings, also for NovaThor setting . So I just use the " Deep Sleep level 4 " and the CPU : I / O Sched : Abbysplug and Noop ( 100Mhz - 1000Mhz ). That it's.

Anyway, I 'll try it later and will tell you later . Thanks in advance. :)
[Galaxy S Advance I9070 Original Android Developmen] mkaluza:
Did I say something wrong? I didn't mean to... I didn't know I have any protocols either:) (except maybe common sense). I'm very happy you like the kernel, but I've been hunting that bug you mentioned for some time now and I can't find a way to reproduce the bastard and maybe that's the reason I focused on it so much... Purpose of my post was to help you fix this... ;) But this is my known bug ;P I'm too direct sometimes...

That's cool - I'll add it to compat list:)

Basically nothing you mentioned could cause min freq bug... More and more I'm starting to suspect that NT messes things up (I removed it - it was messing with my gpu uv). This means I need to get going with my kernel tuner app :P Or there's still some kind of subtle bug with arm requirements handler, but it never happened to me since I last fixed it... anyway - if it happens again, check that file - it'll tell us if my suspicions are correct or not.

Ok :)

Try the cpu settings that are described on wiki. And through the weekend I'll try to add descriptions how to use f2fs and lvm, because you can do quite a few tricks with this kernel :)
[Galaxy S Advance I9070 Original Android Developmen] mkaluza:
[MENTION=5709952]TPD-21[/MENTION]

I've looked through the source code and 400MHz is also the default boost freq for mmc and wifi - if either of them is loaded, it'll boost cpu frequency. The reason I'm writing this is that at boot media scanner is causing a lot of IO and it may cause mmc to stay above boost threshold permanently for quite few minutes, which may give the impression that it's stuck there (cpufreq settings are overriden by freq requirements) for no particular reason (high IO load may not be visible on some cpu load monitors - use plain old "top" for that to see what's going on). So if this happens, check that requirements file for mmc or wlan set to 400000 (or any other for that matter). If nothing's there, check again min cpu freq - it should be back to normal.
[Galaxy S Advance I9070 Original Android Developmen] TPD-21:
[MENTION=3329816]mkaluza[/MENTION] : No, not that I mean guys. :D maybe in my place was called ethics. :) Yes, I should first communicate to you in a PM. Next time I will do it. I'm happy if the communication between devs and users are more familiar. Yes, like you. :good: All right, I'll try the next few days, because at the moment I only have a short time, my friend. I had to gather "valuable papers" to remain lit a fire in my kitchen, this time. :)
[Galaxy S Advance I9070 Original Android Developmen] mkaluza:
Thanks :) I'm happy you made it ;) I made a few minor modifications to it and uploaded it to ramdisks folder. The most important thing I changed is the removal of swap. Your original ramdisk created swap in place of preload partition, which is a bad thing for at least two reasons:

- swap for android < 4.4 is a bad thing in general, because android can't use it in the right way (and using it in a wrong way causes more lags than it eliminates)

- creating swap on any flash is a bad thing, because it can cause it to wear quickly and fail, and therefore creating it on internal flash is a very bad thing to do (you can at least replace sd card if it fails... replacing internal flash might be a bit more difficult...)

if you _really_ need swap, use zram - I'll soon post some description/script on how to enable it on this kernel

No problem :) I hope it'll encourage you to learn more about android :)
[Galaxy S Advance I9070 Original Android Developmen] TPD-21:
[MENTION=3329816]mkaluza[/MENTION] ;) thanks.

Well, here I only give additional information related to what I have done just as you suggest.

1. I have the value (default) of "touchboost_freq" from 400000 to 100000. Of course after a reboot.

2. Then I check the CPU settings, and exactly what you said that it could be lowered to 100MHz. :good:

3. Then I reboot once again (to prove only if cpu fixed at a value fixed at 100MHz or 400MHz) and the results are as expected. :good:

Note: I have noticed the value of the cpu (after reboot) could fluctuate, sometimes 400, sometimes 100. But finally fixed at a value of 100. :confused: A bit odd I think. But, by the way it works. :angels:
[Galaxy S Advance I9070 Original Android Developmen] mkaluza:
This is ok - it's the mmc/wlan boost and it should work this way. As long as it's not stuck forever (like more than 15 minutes of screen on), it's fine.
[Galaxy S Advance I9070 Original Android Developmen] TPD-21:
Well, btw my battery indicator has been transformed into a blue, as well as setting the "touchboost_freq" which has been changed to 100000, is now back again to 400000.

Yes, it is indeed interesting.

Oh yeaa, what about the battery life settings? Any arrangements necessary to enable it to more than 1000 years :confused: (Edit: more than 1x24 hours :highfive: ).

Honestly, I'm not too interested in the OC / OV. I prefer the default settings.

Thanks, anyway. :)
[Galaxy S Advance I9070 Original Android Developmen] mkaluza:
that's not my fault ;P

this is normal - it doesn't remember it between reboots. But don't worry - I'm pretty sure the bug you experienced is in fact mmc/wlan boost

Well, it's already there :) I regularly have 5h Screen On Time and up to 4 days standby (although it the phone was just lying around, it could stay on one charge for over 10 days). That's why I told you to check the wiki - it's about dynamic governor and how to set it depending on your expectations (in fact, just enabling it will be a good start because it has reasonable defaults set)

OC/UV is a competely different story (esp UV). But with dynamic gov oc is ok if you use turbo boost delay param (and increase max cpu freq) - this way you don't oc your phone permanently, but it gets much more responsive - I have it set to 1500ms and max freq to 1200MHz and now I can't imagine the phone without it.

As for UV, I'll try to develop some method 'for dummies' - that is one that gives good (=stable) results while not requiring any in-depth "why?" knowledge.

PS

Concening one of your previous posts - any bug/problem report (except security related bugs maybe) should be public, not via pm. At least for two reasons:

- anyone from the community can help you (and if there are more devs - any of them) - you don't force the dev to fix your phone and he(they) can spend his time developing

- announcing a problem may attract other people with the same problem that didn't report it before, which in turn can give more input to the devs and help them fix it

And if anybody feels bad about you telling him that he messed sth up in public than he's not a dev - he's a *****... :P

I keep forgeting that this forum has attachments - in case of min freq bug happening again you can also attach the files here (just don't paste them)
[HTC Desire 510] Igor2906:
Hi Folks!

Need stock recovery for Sprint HTC!

Can't install update((

Thanks for all guys!!!
[HTC Desire 510] Igor2906:
Anybody help me?