From mboxrd@z Thu Jan 1 00:00:00 1970 From: mobile.parmenides@gmail.com (Parmenides) Date: Tue, 27 Sep 2011 10:07:07 +0800 Subject: Why do processes with higher priority to be allocated more timeslice? In-Reply-To: References: Message-ID: To: kernelnewbies@lists.kernelnewbies.org List-Id: kernelnewbies.lists.kernelnewbies.org Hi Jeff, 2011/9/27 Jeff Donner : > Well, if it doesn't need more time then it doesn't matter what its priority is, > when it goes to sleep waiting for some IO it yields back the > remainder of its time. You could give it as long a timeslice > as you like; it won't use more than it needs, because it mostly waits on IO. > > A lot of the time the IO process won't be runnable, as it's waiting on IO. > When the kernel is looking to dole out CPU time at those times, well the > CPU-bound process is the only one that can take it. So the kernel > gives it to it, lower priority or not. > > CFS doesn't distort anything. For this example, it is really ok. But, dynamic priority doesn't has nothing to do with timeslice. I have no intention to give any remarks conerning whichever scheduler (Forgive me if I seem do that.) :-). Actually, a common characteristics of Linux's schedulers is that timeslices will be longer with priorities raising . I am just curious about why the the schedulers takes this policy. IMHO, this policy somewhat conflicts with intuition. I think there must be some motivations to take this policy, but I have no idea about it.