yashsingh1/xdaforums huggingface dataset:
[Nexus 9 Original Android Development] USBhost:
new script

# i know of 3 things that like to kill battery
# com.google.android.gms:snet :: cpu usage of this process is lowish but can get high also uses a good amount of I/O
# and shoots cpu frequency to the max speed.
# com.google.android.gms.persistent :: this is known to go bad but its rarely and when it does everyone knows it
# com.google.android.gms.unstable :: this seems to only go bad if snet is killed/frozen and you will know when it goes bad

L=/data/kill.log;
PS=/system/etc/BB/ps;
date >> /data/kill.log;
while true;
do
$PS -A -o %cpu,cmd | grep com.google.android.gms | grep -v grep | while read percent process;
do
cpu_usage=${percent%.*}
if [ "$cpu_usage" -ge "20" ]; then
if [ "$process" == "com.google.android.gms:snet" ]; then
echo "Freezing: $process CPU:$cpu_usage% $(date "+%H:%M:%S")" >> $L;
killall -SIGSTOP "$process";
elif [ "$cpu_usage" -ge "80" ]; then
echo "Killing: $process CPU:$cpu_usage% $(date "+%H:%M:%S")" >> $L;
killall -9 "$process";
fi
fi
done
sleep 5;
done

Sat Sep 10 20:04:04 PDT 2016
20:05:00
Killing: com.google.android.gms.unstable CPU:60%
22:36:59
Killing: com.google.android.gms.unstable CPU:56%
01:08:34
Killing: com.google.android.gms.unstable CPU:54%
02:40:31
Freezing: com.google.android.gms:snet CPU:56%
02:44:46
Killing: com.google.android.gms.unstable CPU:54%
02:44:51
Killing: com.google.android.gms.unstable CPU:73%
05:23:14
Freezing: com.google.android.gms:snet CPU:117%
08:40:33
Freezing: com.google.android.gms:snet CPU:75%
11:55:18
Killing: com.google.android.gms.unstable CPU:62%
17:53:24
Killing: com.google.android.gms.unstable CPU:62%
22:58:14
Killing: com.google.android.gms.unstable CPU:51%
23:19:15
Killing: com.google.android.gms.ui CPU:52%
23:19:21
Killing: com.google.android.gms.ui CPU:69%

to day in my findings

unstable and other things are being killed for no reason.

so rise limit to 80 and lower base to 20 for snet because

that thing can somehow run around 25% can still shoot cpu up

and slow things down a lot if your multitasking

-----------------------------------------------------------------------------------------

Sorry guys for this long test for like a week and a half :angel:

if you want to help us test here you go!!

and if you could give me "/data/kill.log" at the end of your day that would be vary nice :laugh:
[Nexus 9 Original Android Development] jolinnard:
Flashing now. Will report the log :)
[Nexus 9 Original Android Development] jolinnard:
Kill log:

Mon Sep 12 23:55:14 CEST 2016
Killing: com.google.android.gms.unstable CPU:98% 00:01:02
Killing: com.google.android.gms.unstable CPU:112% 00:15:55
Freezing: com.google.android.gms:snet CPU:66% 02:41:06
Freezing: com.google.android.gms:snet CPU:33% 02:41:11
Freezing: com.google.android.gms:snet CPU:22% 02:41:16
Freezing: com.google.android.gms:snet CPU:58% 05:56:13
Freezing: com.google.android.gms:snet CPU:23% 05:56:19
Tue Sep 13 18:49:52 CEST 2016
Tue Sep 13 19:13:39 CEST 2016
Tue Sep 13 19:14:39 CEST 2016
Killing: com.google.android.gms.persistent CPU:104% 19:15:40

Freezes while playing games (Real Racing 3 for instance) are still happening. But I see that process eu.chainfire.supersu was at 100% cpu... So maybe something is wrong with supersu and it's not something related to kernel... Or maybe not. I'm still checking.

Other suggestion, perhaps you should add a sleep at the beginning of /init.roguegms.sh (a couple of minutes maybe...). Script start early in the system and maybe gms cpu% are higher for a while.
[Nexus 9 Original Android Development] USBhost:
Here's the new test...

on property:init.svc.bootanim=stopped
service roguegms /system/bin/sh /init.roguegms.sh

# i know of 3 things that like to kill battery
# com.google.android.gms:snet :: cpu usage of this process is lowish but can get high also uses a good amount of I/O
# and shoots cpu frequency to the max speed.
# com.google.android.gms.persistent :: this is known to go bad but its rarely and when it does everyone knows it
# com.google.android.gms.unstable :: this seems to only go bad if snet is killed/frozen and you will know when it goes bad

L=/data/kill.log;
PS=/system/etc/BB/ps;
date >> /data/kill.log;
while true;
do
$PS -A -o %cpu,cmd | grep com.google.android.gms | grep -v grep | while read percent process;
do
cpu_usage=${percent%.*}
if [ "$cpu_usage" -ge "20" ]; then
if [ "$process" == "com.google.android.gms:snet" ]; then
echo "Freezing: $process CPU:$cpu_usage% $(date "+%H:%M:%S")" >> $L;
killall -SIGSTOP "$process";
elif [ "$cpu_usage" -ge "150" ]; then
echo "Killing: $process CPU:$cpu_usage% $(date "+%H:%M:%S")" >> $L;
killall -9 "$process";
fi
fi
done
sleep 5;
done

I moved to 150

going by the 200% scale

and made the script run when the boot image is done

also with some tweaks to lmk

[MENTION=2002216]jolinnard[/MENTION] you where right system freezes still happened.

so hopefully this will fix it! (But it's a cheap fix)

it seemed when the system invoked oom killer (when lmk failed to work)

every so often it would freeze. look in 01afterboot for the change
[Nexus 9 Original Android Development] jolinnard:
Ok. Will look 01afterboot....

Also, to avoid kill dex2oat, you can add, after "grep -v grep", a simple " | grep -v dex2oat | ". Just to make sure.

About bootanimation solution, seems good to me :)
[Nexus 9 Original Android Development] USBhost:
I will be rebasing the kernel tonight

And I will be dropping those GPU updates that was on K10.4.0

I needed to do a rebase anyway.

[MENTION=2002216]jolinnard[/MENTION] will do.
[Nexus 9 Original Android Development] TaintedByte:
Thanks for such an awesome kernel, it really improves the N9 by a lot. Just wondering if anyone else is trying to run Magisk with this kernel? Because it just gets stuck on the boot animation for me, but works on stock kernel.
[Nexus 9 Original Android Development] USBhost:
Thanks :o

Also thanks for the report will look into it
[Nexus 9 Original Android Development] USBhost:
ok hopefully the last test

rebase is done

LMK is working a lot better now

[MENTION=1790051]TaintedByte[/MENTION] ok it should be fixed now please test it

well it does not bootloop anymore
[Nexus 9 Original Android Development] TaintedByte:
Can confirm Magisk is working perfectly, thanks!
[Nexus 9 Original Android Development] jolinnard:
All seems to be in the right place :) Thanks
[Nexus 9 Original Android Development] USBhost:
here's a new test...

Another try to fix a random freeze that lasts a long time because of a dex2oat crash. (back to -mtune=cortex-a57)

Added stress tool. "flounder:/ $ stress"

Does anyone put stuff in "/system/etc/FI.d/" ?
[Nexus 9 Original Android Development] zamula:
I don't put any new files in Fl.d, but I do modify some of the values in 01afterboot. Will install the latest M version and report any issues. Appreciate your work as always!
[Nexus 9 Original Android Development] USBhost:
edit: testing: (i lost count...)

.....

o well guys here's another test

let me know if you get freezes...

Edit: today's 9/20 build has debugging enabled

only flash it if you want to help test and report

So far I ruled out all the main and recent changes.

But... Linux 3.10.103 is looking like the culprit....

The freeze problem only happens once per day and at night for me.

It seems to be completely random thing that happens at night.

Debugging this will take a long time.

Edit: I was so close to getting a log but.... My battery died and the log got lost ....

Gerr...... O well I'll try again

EDIT:

log got! now.....

http://pastebin.com/xy9gNJKp

EDIT: i had adb running at the right time

and i got something interesting "chromium: [ERROR:gpu_watchdog_thread.cc(359)] The GPU process hung. Terminating after 10000 ms."

also its no longer happing only at night

http://pastebin.com/1V2YtNLu

well anyway i just reverted 3.10.103 is see what happens

EDIT: looks like that was not it....

new testing branch https://github.com/USBhost/FIRE-ICE/commits/testing

that's basically stock but with the bare essentials....

i know 3.10.103 is not it (it was just ruled out today)

3.10.102 is not it (we had it a long time with no problems)

f2fs is not it (same no problems for a long time)

but that repository/android-tegra-3.10 merge.... that's like the only thing left that can be the problem.

it may vary will be google's problem from the very beginning.... well anyway that ends my report for to night.
[Nexus 9 Original Android Development] USBhost:
nvm...
[Nexus 9 Original Android Development] jolinnard:
:good: I've a couple of freezes today while playing... Can't get any log (was on the train). It's very weird that your freezes are at night. Like you said, f2fs is not the problem (I have ext4 only), the minor kernel updates doesn't seem either. Are there any vendor files that are used by GPU that changed in Nougat?
[Nexus 9 Original Android Development] USBhost:
idk....

but it seems it was not google's fault after all....

its starting to look like the compilers fault..... well graphite...

so here's a build without it... debugging is now disabled because i got what i needed.

sorry no marshmallow builds.... (ATM)

Edit: In today's build I removed all gpu changes

Since the compiler is just fine, no problems...

The thing I don't understand is that there have not been any new features since K10.3x

only updates from Google and some small things (by all means should not cause freezes).

Something happened in the last Google update from K10.4.2.

I may have an idea but... I'm not to sure.

If today's build is fine then we know something happened in K10.4.2.

If you do please just tell me if you do get freezes, logs are not needed just tell me if you get freezes. :fingers-crossed:

Edit: today's build failed...

gerr........ o well im starting from square one. i will be docing everything.

[MENTION=2002216]jolinnard[/MENTION] when did you get your first freeze?

https://drive.google.com/open?id=1jllrIC8mnx5cm4uNTJRFnD0rg8hmIl_jAnIdam6xKY8 log of what im testing

Edit: new build today

testing vmscan to see if its the problem... see log

[MENTION=2002216]jolinnard[/MENTION]

Edit: nop that did not do it

see log what this build is testing

i will be testing deadline in the next build
[Nexus 9 Original Android Development] jolinnard:
Always happens when I'm playing... But not always. It seems random.

Will flash FIRE-ICE_N_K10.5_09-24-2016 and report tomorrow (today I will not play)
[Nexus 9 Original Android Development] jolinnard:
I'll flashed FIRE-ICE N K10.5 09-25-2016.zip, Nougat 7.0 stock. fiops as scheduler. I got logs running 3D Mark, Sling Shot test, using ES 3.1... No freezes at all... Will test again later. You can see full dmesg and logcat here:

https://drive.google.com/open?id=0B2639_Ld271WcU5qZVlwcEN1TTg
[Nexus 9 Original Android Development] USBhost:
see new build i got a freeze this morning...

keep testing with the fiops scheduler let me know if anything happens
[Nexus 9 Original Android Development] jolinnard:
Had a freeze now.... Can't capture logs though :( /proc/last_kmsg is missing too :silly:
[Nexus 9 Original Android Development] USBhost:
With the 25 build?

PS it's at /sys/fs/pstore/something
[Nexus 9 Original Android Development] jolinnard:
Yes.

https://drive.google.com/open?id=0B2639_Ld271WXzQ4aFpYTTltMkU
[Nexus 9 Original Android Development] USBhost:
now thats something i never seen... N9 wifi only?

try the 26 build.
[Nexus 9 Original Android Development] jolinnard:
Yes, wifi only... Flashing now.
[Nexus 9 Original Android Development] USBhost:
well... another freeze so... im reverting the android-tegra-3.10 merge

to see if that did it... (please be it)(i want to move on...)

my debug log https://drive.google.com/open?id=1jllrIC8mnx5cm4uNTJRFnD0rg8hmIl_jAnIdam6xKY8

This post is going to be updated as i get freezes so stay tuned and check here often :fingers-crossed:

Edit: google is in the clear....

to day i cleanup some commits that did nothing ....

let's see if that did it.... ... .

Question: does the freezes happen on MM to?

Edit:

https://github.com/USBhost/FIRE-ICE/commits/TESTING_._._somthing

new test is up

When I find out if its was the ROMs fault....

Edit: this one is now build with google's gcc...

lets see if thats the problem....

Edit: that did not do it...

i think i tried everything...

https://github.com/USBhost/FIRE-ICE/commits/TESTING_._._somthing2

complete barebone... just (f2fs + Linux 3.10.103 + google updates + SELinux permissive) that's all [MENTION=2002216]jolinnard[/MENTION] try to get this build to crash :)

if this build crashes.... then it's something i can't understand....
[Nexus 9 Original Android Development] jolinnard:
Do you still have freezes? I've been running 09-26 and it seems ok... I can't test much, but yesterday and today all seems ok
[Nexus 9 Original Android Development] tamjan:
I run CM13 with this kernel, and it freezes as well. Once a day. Sometimes twice.
[Nexus 9 Original Android Development] USBhost:
Yep I still get them. I was able to get it pretty regularly watching about 5h or so of YouTube

And still same old error that's I the kernel log about dirty pages what not.

You tried that version? And it booted up on CM13?

With no bootloops?

Edit: o ok thanks so its not MM only
[Nexus 9 Original Android Development] Bryanx86:
What's the difference in this kernel and your simple stream kernel?@ usbhost. Other than this one is obviously newer.
[Nexus 9 Original Android Development] USBhost:
Simple Stream is currently on hold. so it's very old.... but it will be restarted when i have more time.:good:

but to answer your question "Simple Stream" was basically all stock

but with updates from f2fs,google,linux
[Nexus 9 Original Android Development] USBhost:
Well guys one part of the freeze was fixed (the one that made the kernel crash log)(SO FAR!!...)

but... there's still freezing that happens every 8+ hours or so (memory leak?) and i only started getting it after the nougat SEP update. I updated to the SEP build around SEP 12+. i never noticed the freeze right away because i was testing a kill script and i was rebooting a good amount a day. Currently my recent freezes did not have any kernel crash logs, it just froze, adb still worked but very slowly and the kernel showed nothing wrong. Also i did some googling and we are not exactly the only ones getting it, some others are getting freezes on the Nexus 6p.... so my theory does have some weight to it.

So to test my theory i'll downgrade to AUG nougat build.

if i'm all good there then my Kernel will be cleared and K10.5 will be released.

Edit: not so good news

The bad news I still got freezes

The good news I'm about 80% sure it's not my kernel

The freezes only started coming after the NDP5...

Remember I was testing a kill script? The reason why I started it

was because I was getting big lag spikes that lasted about 20-30s

that some Google process made. So I just killed it a bunch of times

then I got freezes, I thought it was because of the process I killed so I didn't mind much.

But after a few weeks of script testing I got obvious something was wrong... It

was not because of the killing or it would have stopped when the script did not run.

So this is my new theory....

Something happened after NDP5 that caused freezing.

It can be the kernel update from NDP5 to stable or

the ROM.

I will have a new build tomorrow night without the changes from NDP5 to stable.

https://github.com/USBhost/FIRE-ICE/commit/7bcdbdd28f869c9517fce70b1497bbb8a616feaa looks interesting...

Edit no build tonight...

I'm testing this month's security update....
[Nexus 9 Original Android Development] tamjan:
Well, as I previously noted I'm running this kernel on CM13, the MM version of course, and I have freezes as well. :) I wonder if these freezes occur with other kernels as well. Might be worth trying...
[Nexus 9 Original Android Development] USBhost:
Right... Blame it on lack of sleep lol 1am ATM here ;)

I don't think so... Because I hacked/made the kernel work on MM :angel:

So the ROM is cleared(maybe) it can also be the security update...

That can affect both N and MM.
[Nexus 9 Original Android Development] Vartom:
Hello! Have you seen this patch? Maybe because of his problem? https://android.googlesource.com/de...13224197ef3609ec2e95590f47815435d0dde41^!/#F0
[Nexus 9 Original Android Development] USBhost:
hmm... thanks!

in my recent build... i decided not to build NVMAP_PAGE_POOLS into the kernel

but that did not help. i'm trying all stock kernel again to see if those freezes continue

but i'm really out of ideas.... i tested everything i can think of....

it all seems to be the ROM's fault.
[Nexus 9 Original Android Development] jolinnard:
Yep... NVMAP on TESTING_._._somthing branch give me a bad feeling today. I will build a new test for myself now with latest debug options and report if I see something.

On the other side, somebody follow or tried what happens with ElementalX/Sublime/stock kernels? Freezes are still there?
[Nexus 9 Original Android Development] USBhost:
Huh? Wait! there's other kernels?..... HAHA JK :laugh:

but no i'm not keeping up with them maybe i should.... it's just my time is not much...

i wonder... if this freeze problem was the one i got back in k10.2 older....:confused:

but i did find other things to test fingers-crossed ;) :fingers-crossed:

P.S. It would be nice if i could get the freeze sooner than 10+h of uptime......

so far my freezes has been on around 18h, 17h, 14h uptime
[Nexus 9 Original Android Development] jolinnard:
I mean... it was a message for others :) There are people that like to try different versions every day... Or maybe there are people using other kernels that are reading us.

Yes, we should try to force it.... But it seems random :silly:
[Nexus 9 Original Android Development] tamjan:
I've switched to ElemantalX just to try it, and after three days there are no issues. Has to be the fire-ice kernel. I'm still running the same CM13 ROM.
[Nexus 9 Original Android Development] USBhost:
Thats what im getting at...

up time is at 22h now... STOCK FIRE-ICE....

being STOCK is so boring....

SO thats Good news!

it's just a matter of time now until fixed.

ROM is now cleared!

Kernel will be fixed soon!
[Nexus 9 Original Android Development] jolinnard:
Very good job [MENTION=5501864]USBhost[/MENTION] in stage1, 2 and 3. No problems in my daily use. Will build stage4 now :D
[Nexus 9 Original Android Development] USBhost:
https://github.com/USBhost/FIRE-ICE/commit/e7ac1054717f2e3cce63f11492d32804ca4b6dc6

we are on stage5 now stage 4 failed

Edit stage6 now

Edit stage7 now (i'm getting close!)

Edit stage 3 now (testing to see if it's the last stable version)
[Nexus 9 Original Android Development] fleischbanane:
Stucks at

10-13 21:37:36.546 195 195 I ServiceManager: Waiting for service media.camera.proxy...
[Nexus 9 Original Android Development] USBhost:
What superuser are you using?
[Nexus 9 Original Android Development] fleischbanane:
I just downloaded UPDATE-SuperSU-v2.46.zip from download.chainfire.eu/696/supersu

Edit: Ok, found SR1-SuperSU-v2.78-SR1-20160915123031.zip and will update now!

Edit2: Thanks a lot, booted fine now. Will report if I get a freeze or not.

Edit3: First impression is amazing. Seems much faster but can be placebo.
[Nexus 9 Original Android Development] liang512:
Flashed Fire&Ice N 10-13. Running super smooth. Will report back if freeze happens tomorrow.
[Nexus 9 Original Android Development] Vartom:
Hey. How do you test the stability and the absence of a freeze?
[Nexus 9 Original Android Development] USBhost:
There's really no sure way...

In my testing I have found:

Stuff that make a lot of I/O :: YouTube.... (But that can be the side effect)

Stuff that dirtys memory a lot :: watching videos etc...

That helps cause the freeze...

But on today's note I have been using "stress"

And that helped me get a freeze sooner... Try it out :good:

It's the same one as "sudo apt install stress" I got in our N9

After installing FIRE-ICE just type "stress" in any terminal adb etc...

"stress -m 1 --vm-bytes 300M --vm-keep --vm-hang 1 --timeout 5m"

And to know if it's stable:

If you have been using your tablet for like 5-7h in one go or

Heavy usage all day and if your uptime goes over 20h it's a safe

bet it won't freeze on you. So far all my freezes happened under 18h of uptime.

Stage 4 had an uptime of 27h with no freezes (heavy usage)

Then I rebooted to test stage 5

PS stage 7 failed.

I'm going back to stage 3 to see what happens

edit: another way to know when a freeze is near, is when stuff just start getting lagy...

high I/O usage....
[Nexus 9 Original Android Development] liang512:
I just got a freeze with N 10-13 in about 13 hours. I had to force reboot.
[Nexus 9 Original Android Development] USBhost:
stage 3 or stage 7
[Nexus 9 Original Android Development] ericplatham:
That is what I figured. I will play around a little more when I get home to see if there are any issues.
[Nexus 9 Original Android Development] Vinzie:
Thanks (again) for your quick reply... Patiently waiting for the mirror:)
[Nexus 9 Original Android Development] USBhost:
https://copy.com/GJMnqAQyUpLCnrML
[Nexus 9 Original Android Development] Vinzie:
Beta 2.1 works fine so far...my games are working again :D
[Nexus 9 Original Android Development] USBhost:
there will be an update today

for recovery and kernel

so stay tuned
[Nexus 9 Original Android Development] USBhost:
k3 is up

recovery test R4 is up

how does it work for you

i think i may have fixed the decrypt problem
[Nexus 9 Original Android Development] zanoli99:
installed r4 recovery and kernel and all is well here. Thanks.
[Nexus 9 Original Android Development] Magoggles:
I'm afraid I'm still having trouble decrypting, is their something I should be wiping or doing before flashing new recovery?
[Nexus 9 Original Android Development] USBhost:
Nop you should not have to

What was the last working version for you?

Hmm...

Looks like i have to change one thing at a time

until I find out what's causing this lol

Ok guys get rdy for some recovery flashing
[Nexus 9 Original Android Development] Magoggles:
R2 is working for me, R3 and R4 haven't.
[Nexus 9 Original Android Development] USBhost:
Ok thank you

Will work on this

tomorrow
[Nexus 9 Original Android Development] jonahmt21:
installed r4 over latest twrp and recovery wont start. the teamwin splash screen just flickers on and off.
[Nexus 9 Original Android Development] bruce2662:
Everything is good so far

Thermal throttling is still an issue

while playing real racing 3, it keeps lowering the cpu frequency and make the game so laggy

thermal throttling starts at a frigging 50 degree celcius!!!!!!:( Hope to be fixed through disabling it or raising up the threshold temperature (i.e. 80C)

I have been tried working on /d/tegra_throttle but it's not really working
[Nexus 9 Original Android Development] Skid71:
I've found after flashing a recovery, booting to the OS first before entering recovery is required.
[Nexus 9 Original Android Development] nmalready:
I'm having the same problem
[Nexus 9 Original Android Development] USBhost:
Hmm TWRP must be vary picky when it comes to kernels

i just dont understand it

i just dont

how can it work for some and not others...

???

i need to get to the bottom of this!
[Nexus 9 Original Android Development] buffalo_guy:
r4 working

I have 2 nexus 9 tablets. Installed r4 with flashify with no problems. Running r3 of kernel as well.
[Nexus 9 Original Android Development] _KP:
Same here installed R4 with flashify and running R3 kernel with no problems .
[Nexus 9 Original Android Development] USBhost:
Sorry guys i have not been doing any updates for a few days

school you know finals
[Nexus 9 Original Android Development] ericplatham:
That is why the word "Priority" has been coined. Thanks for all you have done to date.