FS#47086 - [linux] consider increasing the tick rate from 300 to 1000 in the kernel config

Attached to Project: Arch Linux
Opened by John (graysky) - Monday, 16 November 2015, 20:23 GMT
Last edited by Doug Newgard (Scimmia) - Thursday, 01 March 2018, 14:41 GMT
Task Type Feature Request
Category Packages: Testing
Status Closed
Assigned To Tobias Powalowski (tpowa)
Architecture All
Severity Medium
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 23
Private No

Details

Increase the timer frequency from 300 Hz to 1000 Hz in the kernel package. The help in the kernel docs in the nconfig suggest that the default should be 1000 per my read:

"It is customary to have the timer interrupt run at 1000 Hz but 100 Hz may be more beneficial for servers and NUMA systems that do not need to have a fast response for user interaction and that may experience bus contention and cacheline bounces as a result of timer interrupts."

It also seems that the 300 Hz tick rate is to blame for problems associated with higher power consumption on Sandy and Haswell chips whereas a setting of 1000 Hz fixes these problems. See references below. Thanks.

1. https://bbs.archlinux.org/viewtopic.php?id=193983
2. http://ubuntuforums.org/showthread.php?t=2266297&page=3
This task depends upon

Closed by  Doug Newgard (Scimmia)
Thursday, 01 March 2018, 14:41 GMT
Reason for closing:  Implemented
Comment by Arup Roy Chowdhury (Arup) - Tuesday, 17 November 2015, 00:21 GMT
How about 250MHz that works out as a good compromise?
Comment by John (graysky) - Tuesday, 17 November 2015, 09:44 GMT
Guess I would default back to the recommended option from the nconfig help. Majority of Arch users are not running servers and linux-lts has CONFIG_HZ_100=y so that crowd can use that package set if server tick rate is a concern.
Comment by Arup Roy Chowdhury (Arup) - Thursday, 19 November 2015, 04:00 GMT
Apart from tick issues and high frequency, temps in both Ubuntu 15.10 which uses 4.2 kernel and Arch remain same for similar loads. Same with Ubuntu LTS 14.04.3 that uses kernel 3.19 So my guess would be that the high frequency is not causing power drain.
Comment by Damien (Farika) - Thursday, 19 November 2015, 16:41 GMT
Same issue for me on I7 4770K.

Hibernation level is the same (C7)

But this is clearly not the same frequencies.

I think it is difficult to see the differences in consumption just when watching temperature in idle. Maybe the motherboard fan speeds to compensate or the temperature difference is too small to be seen.

I think the difference in power usage is ~10W.
Comment by Arup Roy Chowdhury (Arup) - Sunday, 22 November 2015, 12:59 GMT
Since its been conclusively proven that the tick rate is the culprit it would be a good idea to bring the tick rate up to 1000MHz as John suggests. Btw the CPU fan rpm remains the same in both Ubuntu and Arch even though at idle the former is running at around 900MHz as compared to Arch's turbo frequency.
Comment by (Stefano.) - Saturday, 19 December 2015, 00:20 GMT
The cause doesn't seems to be the tick rate but the intel_pstate driver.

"My recollection (suspect) as to how all this played out was that the 300 Kernel tick rate used by Arch linux as a culprit was a red herring.
The root cause issues were also present in the 250 Hz and 1000 Hz kernels. However, the 300 Hz kernel with a GUI desktop sometimes was rather optimal for manifesting the issue or issues."
http://ubuntuforums.org/showthread.php?t=2266297&page=3&p=13392458#post13392458

"John created a kernel using an Ubuntu config file. And supplied the perf record data. The results were the same. Therefore the conclusion is that this is a not a kernel configuration issue."
https://bugzilla.kernel.org/show_bug.cgi?id=93521#c53
Comment by Andreas (poison) - Thursday, 25 February 2016, 09:37 GMT
@Stefano A.:

Way back when intel_pstate was set as default my CPU(i7-2600k) started overheating and I replaced the CPU cooler, because I thought the heatpipe was damaged or something like that.
I only figured it out afterwards...
I tried again yesterday with intel_pstate and the problem still exists. CPU heats to ~60°C on an idle desktop and power draw is almost the same as under full load.
I guess I'll stay with acpi-cpufreq on that CPU.
Comment by Arup Roy Chowdhury (Arup) - Thursday, 25 February 2016, 10:26 GMT
The tick rate issue holds, in Ubuntu the frequency scales with kernel 3.19 and 4.2 wheres in Arch even with latest kernel, no scaling.
Comment by Erik Köhler (ErikK) - Friday, 18 March 2016, 03:58 GMT
I did some tests with changing CONFIG_HZ to 250hz like Ubuntu and openSUSE Tumbleweed and I get better/lower power use than with 1000hz and noticeably lower than Arch 300 Hz.
Changing the interrupt frequency it's not a true fix for the higher power consumption but if it prevents the problem for us with haswell cpus with no side effects for the others please consider changing it to 250.
Comment by Arup Roy Chowdhury (Arup) - Friday, 18 March 2016, 04:01 GMT
Yes lower power and heat and in laptops both are necessity. This would be a good idea and benchmarks truly don't suffer with 250MHz tick. In Ubuntu 14.04.4LTS the kernel 4.2 would scale down and up whereas in Arch with kernel 4.4.5 it would stay over 3.5GHZ and regularly hit 4GHz.

Loading...