login
Header Space

 
 

RE: CFS: some bad numbers with Java/database threading [FIXED]

Score:
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Linux-Kernel@Vger. Kernel. Org <linux-kernel@...>
Date: Wednesday, September 19, 2007 - 2:45 pm

> The CFS scheduler does not seem to implement sched_yield correctly. If one

I disagree with the bug report.


This seems right. They're both always ready to run. They're at the same
priority. Neither ever blocks. There is no reason one should get more CPU
than the other.


Umm, how does he get that? It's yielding at blinding speed.


Nonsense. The task is always ready-to-run. There is no reason its CPU should
be low. This bug report is based on a misunderstanding of what yielding
means.

The Linux page says:

       "A  process can relinquish the processor voluntarily without blocking
by
       calling sched_yield().  The process will then be moved to  the  end
of
       the queue for its static priority and a new process gets to run."

Notice the "without blocking" part?

POSIX says:

"The sched_yield() function forces the running thread to relinquish the
processor until it again becomes the head of its thread list. It takes no
arguments."

CFS is perfectly complying with both of these. This bug report is a great
example of how sched_yield can be misunderstood and misused.

You can even argue that the sched_yield process should get even more CPU,
since it's voluntarily relinquishing (which should be rewarded) rather than
infinitely spinning (which should be punished). (Not that I agree with this
argument, I'm just using it to counter-balance the other argument.)

DS


-
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
CFS: some bad numbers with Java/database threading, Antoine Martin, (Wed Sep 12, 7:10 pm)
Re: CFS: some bad numbers with Java/database threading, Ingo Molnar, (Thu Sep 13, 7:24 am)
Re: CFS: some bad numbers with Java/database threading, Ingo Molnar, (Fri Sep 14, 4:32 am)
Re: CFS: some bad numbers with Java/database threading, Satyam Sharma, (Fri Sep 14, 6:06 am)
Re: CFS: some bad numbers with Java/database threading, Satyam Sharma, (Fri Sep 14, 12:01 pm)
Re: CFS: some bad numbers with Java/database threading, Antoine Martin, (Mon Sep 17, 8:17 am)
Re: CFS: some bad numbers with Java/database threading, Satyam Sharma, (Fri Sep 14, 12:08 pm)
Re: CFS: new java yield graphs, Antoine Martin, (Tue Sep 25, 9:46 pm)
Re: CFS: new java yield graphs, Ingo Molnar, (Thu Sep 27, 4:35 am)
RE: CFS: some bad numbers with Java/database threading [FIXED], David Schwartz, (Wed Sep 19, 2:45 pm)
RE: some bad numbers with Java/database threading, David Schwartz, (Thu Sep 13, 3:18 am)
Re: some bad numbers with Java/database threading, Nick Piggin, (Wed Sep 12, 7:33 pm)
Re: some bad numbers with Java/database threading, Antoine Martin, (Thu Sep 13, 3:02 pm)
RE: some bad numbers with Java/database threading, David Schwartz, (Thu Sep 13, 5:47 pm)
speck-geostationary