usleep change?

General support questions
tsunami6774
Posts: 3
Joined: 2018/01/18 22:53:08

usleep change?

Postby tsunami6774 » 2018/01/20 21:52:59

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.

pjsr2
Posts: 267
Joined: 2014/03/27 20:11:07

Re: usleep change?

Postby pjsr2 » 2018/01/22 09:52:15

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.

tsunami6774
Posts: 3
Joined: 2018/01/18 22:53:08

Re: usleep change?

Postby tsunami6774 » 2018/01/22 16:35:40

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.

User avatar
TrevorH
Forum Moderator
Posts: 21730
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: usleep change?

Postby TrevorH » 2018/01/22 17:14:33

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.
CentOS 5 died in March 2017 - migrate NOW!
Full time Geek, part time moderator. Use the FAQ Luke

tsunami6774
Posts: 3
Joined: 2018/01/18 22:53:08

Re: usleep change?

Postby tsunami6774 » 2018/01/22 19:50:37

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 ...

pjsr2
Posts: 267
Joined: 2014/03/27 20:11:07

Re: usleep change?

Postby pjsr2 » 2018/01/22 21:37:21

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.