How to change the "HZ_FIXED" when "CONFIG_HIGH_RES_TIMERS" is 'y'

This forum is for users of Microchip MPUs and who are interested in using Linux OS.

Moderator: nferre

pakydu
Posts: 3
Joined: Wed Mar 21, 2018 3:31 am

How to change the "HZ_FIXED" when "CONFIG_HIGH_RES_TIMERS" is 'y'

Wed Mar 21, 2018 4:00 am

Hi everyone:
I want change the "CONFIG_HZ" to 1000 for my CPU. These are my CPU information,
root@familiar:~# cat /proc/cpuinfo
processor : 0
model name : ARM926EJ-S rev 5 (v5l)
BogoMIPS : 91.13
Features : swp half thumb fastmult edsp java
CPU implementer : 0x41
CPU architecture: 5TEJ
CPU variant : 0x0
CPU part : 0x926
CPU revision : 5

Hardware : Atmel AT91SAM9
Revision : 0000
Serial : 0000000000000000
But when I change my .config which is based on "at91_dt_defconfig". I can't change the "CONFIG_HZ" to 1000, it is still 128. Because the "CONFIG_SOC_AT91RM9200" is 'y'. My questions are:
1. What is better value for "CONFIG_HZ" when I enable "CONFIG_HIGH_RES_TIMERS" for my hardware board?
2. Can I disable the "CONFIG_SOC_AT91RM9200" for my hardware board ?
3. Can I change the "CONFIG_HZ" to 1000 ?
Can someone give me some information? Thanks.

Note: When the HZ is 128, the CPU loading average is bigger 2.(08:51:44 up 30 min, 1 user, load average: 2.56, 2.64, 2.32)
When I change the HZ to 1000, the CPU loading average is lower 1 (08:41:17 up 1:55, 1 user, load average: 0.99, 0.85, 0.77)
blue_z
Location: USA
Posts: 1764
Joined: Thu Apr 19, 2007 10:15 pm

Re: How to change the "HZ_FIXED" when "CONFIG_HIGH_RES_TIMERS" is 'y'

Thu Mar 22, 2018 1:51 am

pakydu wrote:These are my CPU information,
...
model name : ARM926EJ-S rev 5 (v5l)The
...
Because the "CONFIG_SOC_AT91RM9200" is 'y'.
Duh, that doesn't correlate.
The AT91RM9200 SoC has an ARM920T processor (ARMv4T), and not an ARM926EJ-S (ARMv5).
You should only enable this CONFIG_SOC_AT91RM9200 if you are actually using an AT91RM9200.

What SoC are you using?
What Linux kernel version are you using?

pakydu wrote:But when I change my .config ...
Exactly how are you doing this?
pakydu wrote:I can't change the "CONFIG_HZ" to 1000, it is still 128.
Instead of summations, describe exactly what you are doing, and the results you see, not your interpretations.

pakydu wrote:1. What is better value for "CONFIG_HZ" when I enable "CONFIG_HIGH_RES_TIMERS" for my hardware board?
"Better" than what? Using what criteria?
What makes you think high-resolution timers are related?

pakydu wrote:2. Can I disable the "CONFIG_SOC_AT91RM9200" for my hardware board ?
If you board doen't have an AT91RM9200, then there never was a reason to specify it in the first place.

pakydu wrote: 3. Can I change the "CONFIG_HZ" to 1000 ?
Why?
What are you specifically trying to achieve?


Regards
pakydu
Posts: 3
Joined: Wed Mar 21, 2018 3:31 am

Re: How to change the "HZ_FIXED" when "CONFIG_HIGH_RES_TIMERS" is 'y'

Thu Mar 22, 2018 2:14 am

blue_z wrote:
Thu Mar 22, 2018 1:51 am
pakydu wrote:These are my CPU information,
...
model name : ARM926EJ-S rev 5 (v5l)The
...
Because the "CONFIG_SOC_AT91RM9200" is 'y'.
Duh, that doesn't correlate.
The AT91RM9200 SoC has an ARM920T processor, and not an ARM926EJ-S.
You should only enable this CONFIG_SOC_AT91RM9200 if you are actually using an AT91RM9200.

What SoC are you using?
What Linux kernel version are you using?
Paky: I am using SOC "AT91SAM9260B". My kernel is 4.4.57. So I thing I just need enable "CONFIG_SOC_AT91SAM9", not need "CONFIG_SOC_AT91RM9200". Is it correct ?
pakydu wrote:But when I change my .config ...
Exactly how are you doing this?
pakydu wrote:I can't change the "CONFIG_HZ" to 1000, it is still 128.
Instead of summations, describe exactly what you are doing, and the results you see, not your interpretations.
paky: My old .config enable "CONFIG_SOC_AT91RM9200", so the HZ is 128. My user processes has a high CPU loading.(Such as: 09:23:38 up 1:02, 1 user, load average: 2.75, 2.79, 2.70). I can't find what is wrong on my user space code. So I try to change the HZ.
pakydu wrote:1. What is better value for "CONFIG_HZ" when I enable "CONFIG_HIGH_RES_TIMERS" for my hardware board?
"Better" than what? Using what criteria?
What makes you think high-resolution timers are related?
paky: So I want to fine tune the HZ value to try to fix the CPU loading issue. When I disable "CONFIG_SOC_AT91RM9200", and change the HZ to 1000. the CPU loading goes down.(such as: 13:32:06 up 1:55, 1 user, load average: 1.18, 1.31, 1.34)
pakydu wrote:2. Can I disable the "CONFIG_SOC_AT91RM9200" for my hardware board ?
If you board doen't have an AT91RM9200, then there never was a reason to specify it in the first place.
Paky: Understand. Thanks.

pakydu wrote: 3. Can I change the "CONFIG_HZ" to 1000 ?
Why?
What are you specifically trying to achieve?
paky: So I want to fine tune the HZ value to try to fix the CPU loading issue. When I disable "CONFIG_SOC_AT91RM9200", and change the HZ to 1000. the CPU loading goes down.(such as: 13:32:06 up 1:55, 1 user, load average: 1.18, 1.31, 1.34)
Regards
blue_z
Location: USA
Posts: 1764
Joined: Thu Apr 19, 2007 10:15 pm

Re: How to change the "HZ_FIXED" when "CONFIG_HIGH_RES_TIMERS" is 'y'

Thu Mar 22, 2018 8:28 pm

Your response is unreadable because you're misusing quote tags.

I have no expertise with load averages, but AFAIK load averages when using different HZ are not comparable.
The load average is related to the tick duration, so simply increasing the HZ will always reduce the load average.
So your comparison of load averages is like comparing apples versus oranges.
IOW you're using a bogus metric, and your goal of increasing HZ is misguided.

Regards
pakydu
Posts: 3
Joined: Wed Mar 21, 2018 3:31 am

Re: How to change the "HZ_FIXED" when "CONFIG_HIGH_RES_TIMERS" is 'y'

Fri Mar 23, 2018 1:46 am

Thank you, blue_z.
I know your mean, but I have one question: how to get a correct HZ for a system? ( What should we do when we config a new kernel for HZ? )

Thanks again.
blue_z
Location: USA
Posts: 1764
Joined: Thu Apr 19, 2007 10:15 pm

Re: How to change the "HZ_FIXED" when "CONFIG_HIGH_RES_TIMERS" is 'y'

Fri Mar 23, 2018 3:40 am

pakydu wrote:I know your mean,...
Is this a case of bad spelling or bad grammar?

pakydu wrote:... but I have one question: how to get a correct HZ for a system?
Your question is unreasonable, since there is no single "correct" value for HZ.
Since you have presented no compelling reason, the sensible value for HZ would be the default value.

Be aware that increasing the value of HZ has a cost, i.e. increased overhead, with dubious benefit.
Whereas there are other kernel configuration options that are specifically targeted at effectively improving performance of userspace programs (e.g. preemptible kernel, alternate memory allocators, and alternate I/O schedulers).

However without analyzing your system and processes, you're just guessing at what should be changed.

Regards

Return to “LINUX”

Who is online

Users browsing this forum: No registered users and 5 guests