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.
Write an article for LinuxForums Today! Win Great Prizes!
Find the answer to your Linux question:
New to Linux Forums? Register here for free!
    Linux Forums > GNU Linux Zone > The Linux Kernel > My program cannot get fair CPU time under CFS

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

Site Navigation
Linux Articles
Linux Forums
Linux Downloads
Linux Hosting
Free Magazines
Job Board
IRC Chat
RSS Feeds
Linux Forum Topics
Linux Forums
Your Distro
Linux Resources
GNU Linux Zone
The Community
Reply
 
Thread Tools Display Modes
Old 06-12-2008   #1 (permalink)
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
Old 01-04-2009   #2 (permalink)
Just Joined!
 
Join Date: Jan 2009
Posts: 1
My program cannot get fair CPU time under CFS

Was there any response or resolution to the interesting question on this thread?
Adel29 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

Free Magazines
Run Your Own Web Server Using Linux & Apache - Free 191 Page Preview
Learn about everything you'll need to build and maintain your Linux servers, and to deploy Web applications to them.
subscribe
Open Source Security Myths Dispelled
Dispel the five major myths surrounding Open Source Security and gain the tools necessary to make a truly informed decision for your IT organization
subscribe
InformationWeek
InformationWeek is the only newsweekly you'll need to stay on top of the latest developments in information technology.
subscribe



All times are GMT. The time now is 04:55 PM.






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

Content Relevant URLs by vBSEO 3.3.1