Welcome to Linux Forums!

With a comprehensive Linux Forum, information on various types of Linux software and many Linux Reviews articles, we have all the knowledge you need a click away, or accessible via our knowledgeable members.

Linux Forum ArticlesLinux ForumsLinux Forum DownloadsLinux Hosts
Home|Register|FAQ|Member List|Calendar|Unanswered Posts|Forum Rules|Today's Posts|Advanced Search|
SEARCH FOR IN
Go Back   Linux Forums > GNU Linux Zone > The Linux Kernel
Reload this Page My program cannot get fair CPU time under CFS
Linux Forums
Linux Forums
Welcome To The Linux Forums!
Welcome to Linux Forums. We pride ourselves in being one of the largest Linux communities on the web, we encourage you to REGISTER on our forums and participate in the community. There are over 150,000 members ready to answer your questions. JOINING US today will allow you to make new posts, get support, send messages to other members and submit downloads to our downloads directory and many other great features!

The Linux Kernel Compiling, theory, programming or other discussion about the linux kernel

Reply
 
Thread Tools Display Modes
Old 06-12-2008   #1 (permalink)
bobkuan
Just Joined!
 
Join Date: Jun 2008
Posts: 1
Question My program cannot get fair CPU time under CFS

Hello,
I have a mutlti-threading program. It can receive/respond packets on the network. When I do a stress test on it, it can process 60 request/response packets per seconds, in kernel 2.6.17, which uses the O(1) scheduler. But when I do the same test in 2.6.23, with CFS scheduler, its performance will drop down to less than 10 request/response packets per seconds. During the test most of the other processes are sleeping in the system. That means no one is competing the CPU with it. But if you use "top", you will see those threads of my program are taking nearly 0% of CPU. And if you use "ps", you will always see them in S state. I don't understand why CFS does not give CPU resource to my program. Then I ran some other tests and got some more interesting results. That is with the "/proc/sys/kernel/sched_compat_yield" turned on, it will become a lot faster when system is idle. But as soon as there is a CPU bound process (like a infinite loop program) comes in, it will take out 90% of CPU and my program will become very, very slow. This actually violates the game rule of CFS since CFS' goal is about completely fair. No process can take out most of the CPU time if there are other processes in need of CPU at the same time. But then if "/proc/sys/kernel/sched_compat_yield" is turned off (this is the default), no matter how many CPU bound processes you put in, they will share the CPU time fairly, so my program will not become unreasonable slow. But the problem will then become, if system is idle, my program will be slow, slower than that when system is loaded with other processes. I really don't understand why it behaves like this under CFS. Does anyone have any clue to help me out? Thanks !! orz...
bobkuan is offline   Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




All times are GMT. The time now is 12:30 PM.




© 2000 - 2008 - All Rights Reserved - Property of  MAS Media

Content Relevant URLs by vBSEO 3.0.0