yashsingh1/xdaforums huggingface dataset:
[Google Pixel 2 XL ROMs, Kernels, Recoveries, & Oth] def-g:
I've noticed a difference in certain problem areas in my house. The wake up speed and how fast this Kernel is astounding. Now battery life is on par with Flash. Kudos Sultan.
[Google Pixel 2 XL ROMs, Kernels, Recoveries, & Oth] sublimaze:
[MENTION=4800121]Sultanxda[/MENTION] thanks for sharing this kernel.

Does it have wakelock control? If not, will you consider adding it?
[Google Pixel 2 XL ROMs, Kernels, Recoveries, & Oth] arvylas:
I clean flashed sept update and run stock for a day before i flash sultan kernel. I noticed a lot of hiccups compared to stock. Maybe something with new LMK?
[Google Pixel 2 XL ROMs, Kernels, Recoveries, & Oth] xFirefly93:
Yes, it is because of the new Low Memory Killer.

But Sultan is working on fixing it.
[Google Pixel 2 XL ROMs, Kernels, Recoveries, & Oth] def-g:
I also kept stock for awhile. But only had a slight lag when things where setting up. Flawless since.
[Google Pixel 2 XL ROMs, Kernels, Recoveries, & Oth] Sultanxda:
I will never consider adding this.
[Google Pixel 2 XL ROMs, Kernels, Recoveries, & Oth] arvylas:
I can't see the point of this feature. Maybe in older phones/os but right now the idle drain is less than 0,5%/h. I lose 2% overnight with everything enabled and 5 messaging apps and 3 email accounts active.
[Google Pixel 2 XL ROMs, Kernels, Recoveries, & Oth] sublimaze:
Wakelock control is a bad thing? Just curious why you are so opposed to it.

My P2XL loses ~2% overnight as well. But I've had as low as 0.5-0.6% on other devices, with no loss in functionality. I'm pretty sure wakelock control/mods had something to do with that.
[Google Pixel 2 XL ROMs, Kernels, Recoveries, & Oth] Sultanxda:
Wakelocks exist to make code that requires the CPU to stay online work correctly. When you disable a wakelock, you are quite literally breaking something that would've otherwise worked. For example, if you like blocking wakelocks, then you should know of the wlan rx wakelock; blocking this wakelock prevents your CPU from being able to stay awake to process packets received over WiFi while the screen is off, so you'll miss notifications by blocking it.
[Google Pixel 2 XL ROMs, Kernels, Recoveries, & Oth] xFirefly93:
So blocking wakeblock should only be done if you basically know what you are doing? Shouldn't battery life during idle improve if kernel wakelocks are blocked and are tamed and "forbidden" from waking up the phone?

What is your opinion on that [MENTION=4684315]flar2[/MENTION] and Franco achieves a lot of their respective battery idle magic by disabling (restricting?) kernel wakelocks at kernel space during kernel build process?
[Google Pixel 2 XL ROMs, Kernels, Recoveries, & Oth] Sultanxda:
Wakelocks should never be blocked by users. If a wakelock is working incorrectly (e.g., it is never released), then it should be properly fixed.

Also, wakelocks don't wake up your phone; they only keep your phone awake. Your phone is woken up by interrupts that have been configured to wake up your phone upon receipt. In other words, your phone is woken up when certain hardware peripherals (such as the wlan) fire off an interrupt.

What battery idle magic? Battery life might improve a little bit while your screen is off and phone is in deep sleep if you literally break some of your phone's functionality by disabling important wakelocks.
[Google Pixel 2 XL ROMs, Kernels, Recoveries, & Oth] praveen6585:
[MENTION=4800121]Sultanxda[/MENTION]

I have been using the Flash kernel and recently switched to your kernel for your LMK drivers which are working very well for me. All working as expected and smoothly.

I just wanted to check with you that one of the most common updates that [MENTION=6842057]nathanchance[/MENTION] does is update to the latest stable Linux version (currently 4.4.154).. is this something that affects performance and stability to be on the latest? As i noticed that the Sultan kernel is currently on 4.4.116?
[Google Pixel 2 XL ROMs, Kernels, Recoveries, & Oth] Sultanxda:
Android kernels are heavily modified Linux kernels and thus differ greatly from their respective upstream Linux counterparts. If you were to download the official 4.4.116 Linux kernel source code and compare it to my kernel's source code, you would find differences amounting to well over one million lines of code.

Because of this, applying upstream Linux kernel updates results in many code conflicts being generated that must be resolved. On top of this, since the update from 4.4.116 to 4.4.154 changes code in thousands of files, there is no way for a single person such as myself to actually guarantee that an update will be applied correctly and not create any bugs. I'm sure that even Google and Qualcomm have trouble with this, and extensively test their kernels after applying upstream Linux updates to ensure that nothing is broken.

Therefore, in order to ensure that my kernel remains stable, I have decided to not apply upstream Linux updates to it.
[Google Pixel 2 XL ROMs, Kernels, Recoveries, & Oth] praveen6585:
Understood. Thank you for providing such a detailed explanation. This also helped me understand why many big manufacturers also lag behind in terms of the kernel version - too much testing involved and a higher probability of something breaking.
[Google Pixel 2 XL ROMs, Kernels, Recoveries, & Oth] xFirefly93:
So blocking wakeblocks (both partial and kernel wakelocks) are only creating close to semi-placebo improvements in the long run when the phone is idling and not being moved around ("dozing") if I get your statement, and input, right?

EDIT: And one more thing..

How is [MENTION=6842057]nathanchance[/MENTION] being able to upstream with such good results, if the manufacturers/big giant OEM:s can't do the same thing that have the "work force" of maybe 2500-3000 longtime technical experienced developers and what not at their disposal?
[Google Pixel 2 XL ROMs, Kernels, Recoveries, & Oth] sublimaze:
Thanks for the info. I understand the purpose of wakelocks, and I don't restrict mission-critical wakelocks pertaining to phone, alarm clock, messaging app, or email. But I don't need other services waking up my phone (or keeping it awake) during the night while I am sleeping.

I guess my real question is how to get better control of Google Play Services. Better Battery Stats shows hundreds of GPS wakeups during the day. I don't want GPS constantly pinging and chewing up battery. I haven't found a way to restrict GPS since updating to Android Pie. On Oreo, I was able to reduce the number of GPS wakeups & alarms, with no loss in functionality, and my battery seemed to be a little better.

This kernel is your project, and I understand if you don't want to add something that you feel is not useful and potentially detrimental. But it would be a nice extra for users who want to experiment.
[Google Pixel 2 XL ROMs, Kernels, Recoveries, & Oth] Sultanxda:
Most of the time that wakelocks are held is actually while the screen is turned on. The duration of many wakelocks while the screen is turned off is lower than you think.

Although nathanchance has put a lot of effort into ensuring that his upstream Linux patches are applied correctly and don't cause regressions, I don't trust them since there's no way for him to guarantee that they are actually correct.

Big companies only apply upstream Linux patches before they embark on heavily testing their software for a month or longer. Applying upstream Linux patches to a kernel after all of this testing is performed would invalidate the efforts of an army of test engineers who worked for a long time to ensure that the kernel was stable. That's a huge waste of money to a company for something with little gain.

How many of these wakeups bothering you occur for a significant duration while the screen is off for, say, 10 minutes? I'm betting on not many.
[Google Pixel 2 XL ROMs, Kernels, Recoveries, & Oth] sublimaze:
10 minutes' worth of wakelocks don't make a difference in battery life over the span of a battery cycle. But over a period of hours/days, the number of wakelocks DO make a difference. And not all wakelocks are critical for a phone to work as a phone. When I am asleep, I couldn't care less how many tweets need my attention, or about traffic or the weather, or how many app updates are available. I can check all of that when I wake up. During the day, I don't need most apps using CPU cycles in the background. Those are the wakelocks that I want to control.

Anyhoo, I appreciate the discussion about wakelocks and their intent. I always learn something new when I visit xda, and I appreciate you being responsive to questions. It is always good to get developers' perspective. Whether you make changes per user suggestion is entirely your prerogative, and whether or not wakelock control is implemented won't deter me from using this kernel because it is solid and stable, which is paramount :good:
[Google Pixel 2 XL ROMs, Kernels, Recoveries, & Oth] Sultanxda:
Take a screenshot of your wakelock data as the last thing you do on your phone for the day, and then turn off the screen. When you wake up, as soon as you turn on your phone's screen, take a another screenshot of the wakelock data. Compare before and after to see the real significance of wakelocks while your phone's screen is off. Don't plug in your charger when you do this.

What I'm trying to say is, most of the wakelock statistics you're looking at occur while the screen is on and you're using the phone; the wakelocks do nothing to your battery life while the screen is on.
[Google Pixel 2 XL ROMs, Kernels, Recoveries, & Oth] nathanchance:
It's not really fair to compare an amateur kernel hacker with nothing to lose if something goes wrong to an OEM lol.

Just for the record, I don't disagree. Just two points though:

1. There have been two times where I have caught blatantly incorrect things before they were released

* https://lore.kernel.org/lkml/20180805140301.GA17056@kroah.com/ (fix)

* https://www.spinics.net/lists/stable/msg237492.html (never merged)

2. I have gone through the merges that have been done in Qualcomm's initial Pie branch for msm8998 and kernel/common and all of my merges have solved conflicts in the exact same way (so at least I'm bug compatible with those trees). In fact, I caught a mismerge with the latest update (comments and patch).

So while I can't verify that every single patch is relevant or correct (I mean not even Greg can do that), I can make sure that any conflicts are resolved properly then go from there.
[Google Pixel 2 XL ROMs, Kernels, Recoveries, & Oth] def-g:
I like how Nathan and Sultan have different approaches. But produce Killa Kernels. I can't choose a favorite. I jump back and forth constantly. So much so I check a few times daily to see what's new. Good job answering our mostly Noob questions and constantly updating these bad boys. Blessings
[Google Pixel 2 XL ROMs, Kernels, Recoveries, & Oth] arvylas:
About the wakelocks the only one that causes a measurable drain is the GPS one since the hardware involved is power hungry. When I say drain I mean with screen on or off. The only thing you can do to tame it is disabling GPS and leaving only the network location on. When maps for example want to use it you get a popup too turn it on after that I have a quick tile from shortcutter to disable it again.
[Google Pixel 2 XL ROMs, Kernels, Recoveries, & Oth] xFirefly93:
It wasn't meant to be a oranges-to-apples comparison in a rude, insulting or unfair way, Nathan. That was not even my point or what I meant.

My point is that I really admire your work/development and what you have contributed with so far to both the first Pixel series as well as this generation of Pixel devices. Specially how hard you dedicate yourself into upstreaming the 4.4 kernel and still gives us a kernel that is so bugfree and stable for more than just daily usage that FlashKernel actually is.

Sorry if I offended you somehow, and sorry that I went to far off-topic with this post, [MENTION=4800121]Sultanxda[/MENTION].

My apologies!
[Google Pixel 2 XL ROMs, Kernels, Recoveries, & Oth] nathanchance:
I didn't take it as such! Was just making a comment.

I don't know about that one :silly:
[Google Pixel 2 XL ROMs, Kernels, Recoveries, & Oth] praveen6585:
[MENTION=4800121]Sultanxda[/MENTION] I faced an issue today about the System UI stopping to respond. What happened was that I was updating a few apps in playstore and i switched to Opera Mini where I was browsing XDA. All of a sudden, the scrolling became very laggy and it stopped responding completely after it splashed the error that System UI has stopped responding. The screen went black and I had to unlock the phone again and then everything was working fine.

I have attached the logs and the issue happened at after 6:00 as per the timezone in the log.
[Google Pixel 2 XL ROMs, Kernels, Recoveries, & Oth] MrBrady:
+1 same here. Phone never gets to the point if self reboot but often lags to the point it's unusable for about 30 seconds.
[Google Pixel 2 XL ROMs, Kernels, Recoveries, & Oth] Sultanxda:
Yeah, I know. Simple LMK isn't complete yet it seems. I'm hoping to iron it all out once and for all this weekend, but this isn't very easy so it's taking time.
[Google Pixel 2 XL ROMs, Kernels, Recoveries, & Oth] def-g:
Sultan you ever consider putting in the codes so once you flash your Kernel you don't have to reflash MAGISK?
[Google Pixel 2 XL ROMs, Kernels, Recoveries, & Oth] Sultanxda:
New build is up with all of the LMK issues finally fixed. Simple LMK is golden :victory:
[Google Pixel 2 XL ROMs, Kernels, Recoveries, & Oth] MrBrady:
Does this work on DP3 or just 8.1?
[Google Pixel 2 XL ROMs, Kernels, Recoveries, & Oth] ram4ufriends:
Anybody flashed this kernel on Android P beta?
[Google Pixel 2 XL ROMs, Kernels, Recoveries, & Oth] Badger50:
Give it a try and let us know ?
[Google Pixel 2 XL ROMs, Kernels, Recoveries, & Oth] lonton:
I'm currently on Nitrogen OS with Flash Kernel, and my phone goes straight to bootloader mode after flash your kernel. Are there any steps that I need to do before flashing your kernel ? [MENTION=4800121]Sultanxda[/MENTION]

Thank you!
[Google Pixel 2 XL ROMs, Kernels, Recoveries, & Oth] Badger50:
If you read the OP carefully, he stated that this is for the P2XL and P2 "stock rom" That may be your problem ?
[Google Pixel 2 XL ROMs, Kernels, Recoveries, & Oth] lonton:
Oh, my bad. Thanks a lot. :p
[Google Pixel 2 XL ROMs, Kernels, Recoveries, & Oth] BadBromance:
Kernel

Dear Sultan,

Is it safe to flash this over flash kernel or do I need to flash stock first?
[Google Pixel 2 XL ROMs, Kernels, Recoveries, & Oth] Sultanxda:
Yeah, you can flash this over Flash.
[Google Pixel 2 XL ROMs, Kernels, Recoveries, & Oth] Sultanxda:
Does any other custom kernel here have that?
[Google Pixel 2 XL ROMs, Kernels, Recoveries, & Oth] HACK3DANDR0ID:
Not that I know of which is why I am pressing the issue....
[Google Pixel 2 XL ROMs, Kernels, Recoveries, & Oth] joedajoester:
Running great on DP3, screen wake is pretty fast.

[MENTION=4800121]Sultanxda[/MENTION] I remember back from the nexus 6p that the big cores had a major impact on wake speed( if you were underclocked, the screen would take a lot longer to wake ), does this kernel allow the cpu to exceed the limit set by the underclock when waking or is it not necessary anymore? I saw this commit but I can't tell if it is only maxing to 1958 mhz when waking or if its hitting the phones normal max clock speed.

Also, is there any way to change the max frequency from 1958 to something a little higher? If I use an app to change it, it gets reverted instantly.

Thank you!
[Google Pixel 2 XL ROMs, Kernels, Recoveries, & Oth] Sultanxda:
I don't think I'll be adding this in. Sorry.

When exiting suspend, the 1958 MHz limit is bypassed and the full speed is used for the 20 ms boost in the commit you linked to.

If you can show me that performance is insufficient at the 1958 MHz limit, then I'll reconsider the underclock.
[Google Pixel 2 XL ROMs, Kernels, Recoveries, & Oth] joedajoester:
I'm sorry I wasn't asking you to change your kernel, it's entirely your choice what you want to do with it, I was just asking if there's a way for us to change the max clock speed on our own. I'm currently casting my phone's display to my Chromecast and whenever I launch an app, the animation is super laggy on my phone and the stream lags freezes and the audio cuts out. In normal use (not casting) I find apps take a lot longer to launch where they used to launch almost instantly. Even Google's messages app has a over a full second pause at the White screen when it never used to. Google photos used to launch so fast that the splash screen would be gone almost instantly and now there is a 2 second delay.
[Google Pixel 2 XL ROMs, Kernels, Recoveries, & Oth] Sultanxda:
Here's a build without the underclock:

Let me know if this fixes the lag.

New build is up with the underclock removed.
[Google Pixel 2 XL ROMs, Kernels, Recoveries, & Oth] Ramone360:
I got error msg "internal hardware problem and I should contact the manufacturer" after flashing kernel. Is this normal for this kernel?
[Google Pixel 2 XL ROMs, Kernels, Recoveries, & Oth] Sultanxda:
Yes. I'm going to look into getting rid of this message.
[Google Pixel 2 XL ROMs, Kernels, Recoveries, & Oth] Badger50:
Yup :cool:

https://xdaforums.com/pixel-2-xl/development/kernel-sultan-kernel-t3802152/post76773179
[Google Pixel 2 XL ROMs, Kernels, Recoveries, & Oth] zacharias.maladroit:
[MENTION=4800121]Sultanxda[/MENTION]

can you please give a few details what changes you made to achieve this ? (dtsi, dts, etc.)

the most similar device family (LG V30*) might be possible to benefit from it, too

Awesome kernel !

Many thanks in advance
[Google Pixel 2 XL ROMs, Kernels, Recoveries, & Oth] Sultanxda:
https://github.com/sultanxda/androi...mmit/88af7f1b329b2843860cb8e7b6807192b71bc4e8
[Google Pixel 2 XL ROMs, Kernels, Recoveries, & Oth] zacharias.maladroit:
Many thanks :cowboy:
[Google Pixel 2 XL ROMs, Kernels, Recoveries, & Oth] lllluzhnan:
Golden？

Thanks for your work man. You are golden. I:good::good::good::good:
[Google Pixel 2 XL ROMs, Kernels, Recoveries, & Oth] praveen6585:
I'm facing the same slow down issues as before.. in fact it's more often now :(

Log attached
[Google Pixel 2 XL ROMs, Kernels, Recoveries, & Oth] praveen6585:
I'm facing the same issues of slow down as before.. in fact it's more often now :(

Log attached
[Google Pixel 2 XL ROMs, Kernels, Recoveries, & Oth] kerymercury:
Have you factory reset your phone yet? i experienced the slow down as well previously. Decided to factory reset my device and flash the previous build kernel. Since then, my device is back to snappy and fast again. Including this newly build kernel. Thanks to our almighty [MENTION=4800121]Sultanxda[/MENTION] :good::good:
[Google Pixel 2 XL ROMs, Kernels, Recoveries, & Oth] praveen6585:
I have not factory reset after the Pie update. I was using Flash kernel before this and never had any slowdown issues.. only memory management issues. So i switched to Sultan kernel for LMK and faced a few slowdowns with the earlier version.. this has increased with today's version so i switched back to Flash Jebel to check and all is smooth again.
[Google Pixel 2 XL ROMs, Kernels, Recoveries, & Oth] kerymercury:
Mine im not sure on which kernel i started to experienced the slow downs cuz i've been switching back and forth between these two. Even after the reset and configured with Flash kernel (version 3.04 if im not mistaken) i was still experiencing some minor slow downs but not really obvious one, until i switched to Sultan's 4th September build that my phone started to become snappy again.
[Google Pixel 2 XL ROMs, Kernels, Recoveries, & Oth] Sultanxda:
Thanks for the log. Try this kernel: View attachment Sultan-kernel-wahoo_20180909-lmktest1.zip
[Google Pixel 2 XL ROMs, Kernels, Recoveries, & Oth] praveen6585:
Downloaded and testing.. Will revert if i face issues
[Google Pixel 2 XL ROMs, Kernels, Recoveries, & Oth] Sultanxda:
Simple LMK probably just needs some of its parameters adjusted for your insanely high memory pressure phone usage, since its algorithm is definitely good now. FWIW, I tested Darkness Rises several times with the new build and couldn't get any freezes.

Also, if/when you get a freeze next time, post a kernel log (dmesg) too so I can see what Simple LMK was doing.
[Google Pixel 2 XL ROMs, Kernels, Recoveries, & Oth] praveen6585:
Sure. Since the last 1-2 hours ive not had any slowdowns so things seem to have settled well for now.

Surprisingly i do not use anything too memory intensive and never play any games on my phone. The primary apps i use are Opera Mini, Facebook, Tweetcaster Pro, etc.

I'll report back in any case in few more hours
[Google Pixel 2 XL ROMs, Kernels, Recoveries, & Oth] :
I don't use Facebook but doesn't it use a lot of memory :confused:
[Google Pixel 2 XL ROMs, Kernels, Recoveries, & Oth] MrBrady:
Just tried 9/8 as well as Sultan-kernel-wahoo_20180909-lmktest1.zip and am getting pretty massive lag w/o any gaming. Just using the device for standard use - scrolling, changing settings, Gmail, Chrome.

It seems like many people bounce between Flash kernel and Sultan kernel (I'm one of them). I've noticed since the LMK was released, when I flash Flash kernel or restore the stock kernel, I still get massive lag. This lag wasn't present until trying Sultan. Not complaining here, just helping other's who may experience the same issue. I'm sure once LMK is dialed-in, it will be killer!

It's not until I flash the factory image without -w that the device behaves normal again. Is this normal/expected?

Should note that I'm on the September Android 9 security release. No Magisk. Just TWRP.
[Google Pixel 2 XL ROMs, Kernels, Recoveries, & Oth] Sultanxda:
I think this bout of lag is because Simple LMK's performance hinges on the performance of a core kernel process called kswapd. kswapd has to do a lot of work when the system runs out of memory, and Simple LMK is designed to let the system run out of memory as much as possible in order to maximize memory usage. In other words, Simple LMK is constantly forcing kswapd to do a lot of work.

Since kswapd isn't normally expected to constantly do boatloads of work on Android devices, it currently runs as a normal-priority process on the little CPU cluster. I think the remaining lag will disappear if I give kswapd a significant boost in the resources it can use.

On the bright side though, this lag is different from the lag in the previous builds. The lag from previous builds was caused by a fatal flaw in Simple LMK, which has been fixed in this build (:
[Google Pixel 2 XL ROMs, Kernels, Recoveries, & Oth] Reechings:
Really appreciate the experimentation and testing you are doing, I think you may be on to something really beneficial for all of us. Sorry to harp on this but if you can add more granular controls to vibration level adjustment (at least 5% increments would be great) I would really like to run this as my daily kernel. Thanks!
[Google Pixel 2 XL ROMs, Kernels, Recoveries, & Oth] praveen6585:
[MENTION=4800121]Sultanxda[/MENTION] so after a few hours of the test kernel, im happy to report that i couldn't replicate any of the earlier issues. I tried all the cases where it would start slowing down but the kernel managed it perfectly. But like you mentioned giving that task higher priority might future proof it better as others might be using it more intensively.
[Google Pixel 2 XL ROMs, Kernels, Recoveries, & Oth] Sultanxda:
Streaming video playback seems to be a good way to reproduce the freezes. I got freezes with the test kernel I gave you, and have made the appropriate tweaks to kswapd to hopefully fix the freezes once and for all.
[Google Pixel 2 XL ROMs, Kernels, Recoveries, & Oth] praveen6585:
You are right.. was watching YouTube and switching to Opera mini and scrolling became very slow . Not stopped completely but a lot of stuttering. Will check in the next version.

Logs attached just in case.. issue was at the very end of the log