Not a member yet? Why not Sign up today
Create an account  

  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
 
Xan kernel issues / solutions for Laptops

#1
Hi!

I would like to share my experience with Xan kernel on laptops and I encourage the rest to do this, so we have a thread which contain essential info on this topic Smile

User Tropic may remember, that I had some problems with Xan kernel which was BFS based, so basically after couple of days of using computer it will just hang up, usually that was watching Youtube, so the workflow was: work, suspend, work, Youtube, work, Youtube, hang.
Then I tried Xan kernel based on Liquorix/zen, but that was not giving me a good battery life and then there was something else which I don't remember anymore Smile

Also, I appreciate that there is overall description of features posted on the first page of xanmod.org, but as I'm technical, I lack a bit more specific details about it. For instance, it says "x86_64 advanced instructions set support", which essentially meant not much to me, as I checked the kernel is build with "Generic" processor features, as well as there is no information on HZ values used, of course I can install the kernel and check the values (or download and extract config from it and check out), but as I suggested earlier, it would be good to point meaningful information for the user about exact features that differ from whatever the kernel is based on.

Anyhow, I set up my own kernel with minimal, but essential features for me:
a) vanilla kernel + full liquorix patch (which includes BFQ - important for me)
b) HZ is left at 1000
c) I configured it as full tickless kernel (CONFIG_NO_HZ_FULL + CONFIG_NO_HZ_FULL_ALL)
d) used graysky's optimization patch and set processor features from "Generic" to "Ivy Bridge"

Results are surprisingly good - lower temperatures, performance is good and most importantly stability is very good, 7 days - no issues. I have not run any benchmarks at all as I don't compile things much on this machine, don't run we server, etc.

Other modifications which I did was tunables:
a) intel_pstate=disable pcie_aspm=force i915.enable_fbc=1 i915.enable_rc6=7 i915.enable_psr=1
b) echo 50 | sudo tee /sys/devices/system/cpu/cpufreq/ondemand/sampling_down_factor
c) echo 98 | sudo tee /sys/devices/system/cpu/cpufreq/ondemand/up_threshold
d) echo 25000 | sudo tee /sys/devices/system/cpu/cpufreq/ondemand/sampling_rate
e) echo 1 | sudo tee /sys/devices/system/cpu/cpufreq/ondemand/ignore_nice_load

I tried setting reasonable values for these, they work for me, but may not work for You, on laptop currently I'm very satisfied with the results, although I didn't experiment with these values and maybe I'm just missing smth.

HW: Dell XPS 15, 16GB RAM, Ivy Bridge (i7-3612QM), SSD + HDD, Intel HD4000 in use, nVidia disabled with bbswitch.

regards
Mjasnik
Reply

#2
What is the reason for not using Intel's pstate governor?

Pstate "powersave" governor (which is NOT an equivalent to CPUFreq's "powersave" governor) is a much more advanced governor than ondemand and by most accounts is generally 'better'.
Reply

#3
Hi!

Unpredicted higher frequency, I have encountered this before and do not want to risk yet, will wait for couple of releases more. This raises temps and drains battery quicker.
From the tests from Phoronix, there is small difference between the cpufreq and pstate. And at least with cpufreq, I may change some tunables which do not change performance much but saves battery.
Of course, in specific cases, which are very rare, I may want to set cpufreq powersave governor not for how effectively work will be done, but just to extend battery life as mush as possible still doing some work (lowest frequency available), with pstate there is no way of doing it at all.

regards
Mjasnik
Reply

#4
Hello Mijasnik! Smile I'm glad that you have found some tuning method for your system to run properly as you wish. Some of your tweaks were proposed some time ago in the 'Short ideas' section so I'm glad that them have been useful for you too. However, the most important tunable imho is the 'a) intel_pstate=disable pcie_aspm=force i915.enable_fbc=1 i915.enable_rc6=7 i915.enable_psr=1', what contributes mainly to speed, stability and energy saving -- probably, as you said, not for all the systems as them would have been certain issues. The other tunables seem good for overall systems also but I think that 'c) echo 98 | sudo tee /sys/devices/system/cpu/cpufreq/ondemand/up_threshold' should be set at maximum '90' because in a normal workload behaviour scenario '98' has no statistical distance from '100'. Finally, I think that beyond 625Hz the battery cost should be really high -- or even 750Hz for the most hard scenarios under very high I/O. Probably a new development trend has been opened here with your ideas, so thank you very much and congratulations again! Big Grin
"(...) the grandest occasion the past or present has seen, or the future can hope to see." -- Cervantes.
Reply

#5
Personally I think the most of what I wanted is achieved by 1K HZ + full tickless kernel (Fedora does tickless by default), I think the rest contributes quite few %, for instance up_threshold is there just to lower temperatures even more, but just by one degree or so, psr + rc6 is very small improvement as well, I added them recently, there is very small difference before and after, which may suggest that my system automagically enabled those or very similar levels by default.
I didn't apply any patch with custom Hz values, but if there is an easy way (or patch) already made ready for 500Hz, please write where I can get it. On some future builds, not in near future though, I may enable 500Hz for even more savings / balanced performance.
Reply

#6
Xan published the 500Hz patch two months ago in this forum -- I recommend you to come here more often if possible, because some ideas and useful tweaks are offered day after day.
http://xanmod.org/forum/index.php/topic,...tml#msg521

Edit: Xanmod sources:
https://sourceforge.net/projects/xanmod/files/sources/
Edit2: Cumulative features of Xanmod:
http://xanmod.org/forum/index.php/topic,66.0.html
Smile


Attached Files
.hz   Kconfig.hz (Size: 1.98 KB / Downloads: 134)
"(...) the grandest occasion the past or present has seen, or the future can hope to see." -- Cervantes.
Reply

#7
(21-04-2016, 08:08 AM)Mjasnik link Wrote: Hi!

I would like to share my experience with Xan kernel on laptops and I encourage the rest to do this, so we have a thread which contain essential info on this topic Smile

User Tropic may remember, that I had some problems with Xan kernel which was BFS based, so basically after couple of days of using computer it will just hang up, usually that was watching Youtube, so the workflow was: work, suspend, work, Youtube, work, Youtube, hang.
Then I tried Xan kernel based on Liquorix/zen, but that was not giving me a good battery life and then there was something else which I don't remember anymore Smile

Also, I appreciate that there is overall description of features posted on the first page of xanmod.org, but as I'm technical, I lack a bit more specific details about it. For instance, it says "x86_64 advanced instructions set support", which essentially meant not much to me, as I checked the kernel is build with "Generic" processor features, as well as there is no information on HZ values used, of course I can install the kernel and check the values (or download and extract config from it and check out), but as I suggested earlier, it would be good to point meaningful information for the user about exact features that differ from whatever the kernel is based on.

Anyhow, I set up my own kernel with minimal, but essential features for me:
a) vanilla kernel + full liquorix patch (which includes BFQ - important for me)
b) HZ is left at 1000
c) I configured it as full tickless kernel (CONFIG_NO_HZ_FULL + CONFIG_NO_HZ_FULL_ALL)
d) used graysky's optimization patch and set processor features from "Generic" to "Ivy Bridge"

Results are surprisingly good - lower temperatures, performance is good and most importantly stability is very good, 7 days - no issues. I have not run any benchmarks at all as I don't compile things much on this machine, don't run we server, etc.

Other modifications which I did was tunables:
a) intel_pstate=disable pcie_aspm=force i915.enable_fbc=1 i915.enable_rc6=7 i915.enable_psr=1
b) echo 50 | sudo tee /sys/devices/system/cpu/cpufreq/ondemand/sampling_down_factor
c) echo 98 | sudo tee /sys/devices/system/cpu/cpufreq/ondemand/up_threshold
d) echo 25000 | sudo tee /sys/devices/system/cpu/cpufreq/ondemand/sampling_rate
e) echo 1 | sudo tee /sys/devices/system/cpu/cpufreq/ondemand/ignore_nice_load

I tried setting reasonable values for these, they work for me, but may not work for You, on laptop currently I'm very satisfied with the results, although I didn't experiment with these values and maybe I'm just missing smth.

HW: Dell XPS 15, 16GB RAM, Ivy Bridge (i7-3612QM), SSD + HDD, Intel HD4000 in use, nVidia disabled with bbswitch.

regards
Mjasnik

Thanx a bunch for that thread , it s my issue also on my 2 laptops . I knew that their was something weird but didn t had your knowledge to fix these issues .

The kernel s not much geared toward laptops I guess . Some versions work great , other ones run too hot to my taste .
Reply

#8
(21-04-2016, 10:31 AM)Mjasnik link Wrote: Personally I think the most of what I wanted is achieved by 1K HZ + full tickless kernel (...)

Personally I think that mainline kernel recompiled at 2000Hz should be enough by itself to get enough performance and stability for everything without tweaking or tuning at all -- obviously it wouldn't be applied for mobile devices because the battery life will become too short. That's why some patches are merged and some tuning is done here to build a kernel with optimized relationship between performance, stability and battery life for near all the computers. The keywords are 'Hz' and 'battery life': if no battery is needed, just push up Hz as you wish and of course until you are able to boot. Thank you for your feedback. Smile
http://xanmod.org/forum/index.php/topic,32.0.html
"(...) the grandest occasion the past or present has seen, or the future can hope to see." -- Cervantes.
Reply

#9
I'll build a version with 500Hz today, hopefully, I'll report back how that works... If anyone would like to try out my build, I can try to upload kernel to some space where one can get it, but my build will be Ivy Bridge, which may not work if one has older machine.

P.S. Haha, I just realized that I installed kernel for Ivy Bridge on MacBook laptop which has Sandy Bridge and it works like a charm Smile
Reply

#10
Cool , I have an Intel Core i7-2670QM , wonder if it s too old , it s my newest laptop. Shoot , It is based on the Sandy Bridge architecture based on what I saw in the web. Wonder if it would do the job anyways. & if we can do it somehow.

Would be glad to test if it fits .

Will have to learn how Hz are working & how to change it , seems so easy from you guys.

Edit: typo & added stuff .
Reply

#11
(21-04-2016, 01:21 PM)altman link Wrote: Will have to learn how Hz are working & how to change it , seems so easy from you guys.

This patch shows how to add an interrupt frequency.
https://github.com/manjaro/packages-core...rnel.patch

Remember you still need to set it in your .config (though, it will prompt)
Reply

#12
(21-04-2016, 01:33 PM)Rob link Wrote: [quote author=altman link=topic=74.msg1526#msg1526 date=1461244917]
Will have to learn how Hz are working & how to change it , seems so easy from you guys.

This patch shows how to add an interrupt frequency.
https://github.com/manjaro/packages-core...rnel.patch

Remember you still need to set it in your .config
[/quote]

Appreciated the comeback Rob . Thanx. Will read it .
Reply

#13
Please guys, just notice that own personalized kernels 'always' fit better with own computers because them are made according to one's needs or just only the required features are merged -- or also them are enhancing and increasing one particular feature in most the cases. Wink Obviously, mostly the main base is the same for all and then some minor or major tweaks are added as needed or required by the user -- however, this never implies that the own kernel is better or worst than the original one or other possible kernels because you are just building your own kernel for your own computer. Despite of this, the tricky question has been always to build a kernel useful for mostly all the available users, what implies merging some stable patches in order to provide more performance, speed and stability. An own personalized kernel will never fit to whole computers as one that is optimized and tested in some computers as Xanmod is before a new release. Smile

Edit: of course I will install and test Mijasnik's kernel when available.
"(...) the grandest occasion the past or present has seen, or the future can hope to see." -- Cervantes.
Reply

#14
Understand your point Tropic , our  notebooks look similar , he s got twice the memory & a different Intel cpu , but I guess that you want to educate people on which kernel might or not might work on computers right .

It would ve been faster & easier to have it all in one shot . lol

Typo
Reply

#15
Altman, there is no kernel as your 'own' kernel, but nobody will compile millions of kernels just for everyone's computer I guess, so main building concepts should be clearly exposed before just to avoid some misunderstanding issues -- I'm pretty sure that modern computers will run flawlessly with any kernel or even any OS system inside for all the common users. By the way, it doesn't mean either that everybody has a newer computer or that they haven't highly required computing needs that are solved by kernels with some merging patches, tunings and tweakings in some continuous development tasks -- just for that reason us all are helping together to get some solutions and common benefits. Tongue
"(...) the grandest occasion the past or present has seen, or the future can hope to see." -- Cervantes.
Reply

#16
Yep I know mate .
Reply

#17
Ok, kernel is ready and I'm using it, buuuuut, when I was compiling it (with 600hz, actually, thanks Tropic for links), my trusty 8 days uptime went to halt and system freezed! That was unexpected, You may guess when, but I'll spoil you the fun part - I was watching YouTube Big Grin
So, I disabled psr, rc6 (which noone recommends to set to 7, coz it's buggy on most hw) and aspm force, the first two may have influenced crash or crash is elsewhere, only time will tell.
If this build will be fine, I'll upload it somewhere, although it's not as power efficient as previous one, dunno why (yet).
If someone wants to test it before, please tell, I'll upload it anyway.

Build is: 4.5.2 + lqx + 600Hz + full tickless + ivybridge optimizations + 32 cpu max
Reply

#18
Mjasnik, I will be so happy to test it as soon as possible to see how it works. Smile
Edit: the 600Hz patch has been provided by Rob in other post, if I'm not wrong.
Edit2: I would suggest 625Hz -- or even 750Hz for laptops and mobile devices with high capacity batteries, also non exact jiffy value indeed. IMHO the Hz limit for normal mobile devices should be 625Hz with exact value of 0.0016 jiffies (1/625).
"(...) the grandest occasion the past or present has seen, or the future can hope to see." -- Cervantes.
Reply

#19
Which are the whole features of the kernel? Which of them are included from Xanmod? ???
"(...) the grandest occasion the past or present has seen, or the future can hope to see." -- Cervantes.
Reply

#20
Hi,

So as promised I'll uploaded by build of my interpretation of stable and energy efficient but yet performant enough kernel.
It's not a kernel tailored just for my use or so, it has all the standard modules built in etc., so I'd like to call it kernel for laptops which does not make them very hot Smile
I gave it a fair bit (couple of days of active usage) testing before upload...

LINK: https://failiem.lv/u/248sdvsp

So, the kernel is different from mainline with this:
  • based on liquorix patchset with their config
  • HZ set to 625 (I don't know why I even bothered with exact 625) for this version
  • optimizations (graysky's kernel patch) is set to Ivy Bridge, but this happily runs on Sandy Bridge as well (at least on MacBook Pro 2011)
  • BFQ is the default elevator
  • FULL tickless kernel (for this to work, in this particular version of my build, You have to set full tickless CPUs via kernel command line: go to /etc/default/grub, find a line which reads GRUB_CMDLINE_LINUX and change it by adding nohz_full=1-<total vCPUs You have (taking into account HT)>
    Afer chaning this, please run update-grub to reflect the changes!
My kernel command line looks like this:
Code:
GRUB_CMDLINE_LINUX="intel_pstate=disable pcie_aspm=force i915.enable_fbc=1 i915.enable_rc6=3 i915.enable_psr=1 nohz_full=1-7"
Please note that all i915 features set may crash your system (mine works fine), please disable them if system becomes unstable.

> Other features: low CPU temperature, low CPU hop while idle and increased battery life.
* [edited] -- tropic.

I do this as well to (hopefully help even more with energy consumption sacrificing a bit of performance):
  • Runtime tunables
Code:
echo 50 | sudo tee /sys/devices/system/cpu/cpufreq/ondemand/sampling_down_factor
echo 98 | sudo tee /sys/devices/system/cpu/cpufreq/ondemand/up_threshold
echo 25000 | sudo tee /sys/devices/system/cpu/cpufreq/ondemand/sampling_rate
echo 1 | sudo tee /sys/devices/system/cpu/cpufreq/ondemand/ignore_nice_load
  • not a kernel config, but intel_pstate is disabled via kernel command line

if someone wants to benchmark this, please share the results Smile
If something here is obviously wrong or there is a room for small, but nice improvements, please tell me, but please remember I'm here for balanced setup.

P.S if You don't like this or don't trust my build, please don't use it, it even may kill your kitten with a fork... In short use at your own risk Smile
Reply



[-]
Quick Reply
Message
Type your reply to this message here.

Image Verification
Please enter the text contained within the image into the text box below it. This process is used to prevent automated spam bots.
Image Verification
(case insensitive)

Forum Jump:


Users browsing this thread:
1 Guest(s)