Page 1 of 1

usleep change?

Posted: 2018/01/20 21:52:59
by tsunami6774
hello. My programs uses high cpu while wait idle mod. So i want to change usleep code at my kernel before copile new kernel ?
how can i change this sleep codes and how can i change cp usage when idle ?

thanks.

Re: usleep change?

Posted: 2018/01/22 09:52:15
by pjsr2
My programs uses high cpu while wait idle mod.
Something is wrong with your program. Solve this by fixing your program. There is nothing wrong with the kernel.

Re: usleep change?

Posted: 2018/01/22 16:35:40
by tsunami6774
pjsr2 wrote:
My programs uses high cpu while wait idle mod.
Something is wrong with your program. Solve this by fixing your program. There is nothing wrong with the kernel.
no problem at my program ( my program is HLDS by Valve Corp. ) No problem while use Centos 5.11 but problem starts after upgrade Centos 6.9-7 or other newest kernel systems.

Re: usleep change?

Posted: 2018/01/22 17:14:33
by TrevorH
I suspect this has to do with the increase in HZ values between el5 and el6. Try booting CentOS 6 with 'divider=10' appended to the end of the kernel parameters and see if that helps. Not sure if this is still valid in CentOS 7 and it may require a different parameter to fix it there but worth trying.

Re: usleep change?

Posted: 2018/01/22 19:50:37
by tsunami6774
TrevorH wrote:I suspect this has to do with the increase in HZ values between el5 and el6. Try booting CentOS 6 with 'divider=10' appended to the end of the kernel parameters and see if that helps. Not sure if this is still valid in CentOS 7 and it may require a different parameter to fix it there but worth trying.
I do not think it's related to wanting to use a processor while the program is idle, but I will try ...

Re: usleep change?

Posted: 2018/01/22 21:37:21
by pjsr2
There was somewhere in 2016 (?) an incompatible change in implementation of synchronization objects in glibc that could cause havoc when programs were using these in shared memory and were (statically) linked against different versions of glibc or when mixing 32- and 64-bit applications. If I remember correctly, this could lead to bad initialization of the objects and/or show up as a busy loop.