mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* Question about scheduler changes from 2.2 to 2.4
@ 2002-04-01 23:10 Chris Friesen
  2002-04-01 23:25 ` Mike Kravetz
  0 siblings, 1 reply; 2+ messages in thread
From: Chris Friesen @ 2002-04-01 23:10 UTC (permalink / raw)
  To: linux-kernel


In the 2.2 scheduler there was a section that checked if the previous process
was still runnable and set it as the default next running process.  It looked
like this:

	if (prev->state == TASK_RUNNING)
	   goto still_running;
still_running_back:

With another chunk of code under still_running that set "c" and "next".

In 2.4 this seems to have been removed.  Can someone explain why?  I'm porting
some custom scheduler changes and want to make sure that I understand what's
going on in 2.4.

Thanks,

Chris

-- 
Chris Friesen                    | MailStop: 043/33/F10  
Nortel Networks                  | work: (613) 765-0557
3500 Carling Avenue              | fax:  (613) 765-2986
Nepean, ON K2H 8E9 Canada        | email: cfriesen@nortelnetworks.com

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Question about scheduler changes from 2.2 to 2.4
  2002-04-01 23:10 Question about scheduler changes from 2.2 to 2.4 Chris Friesen
@ 2002-04-01 23:25 ` Mike Kravetz
  0 siblings, 0 replies; 2+ messages in thread
From: Mike Kravetz @ 2002-04-01 23:25 UTC (permalink / raw)
  To: Chris Friesen; +Cc: linux-kernel

On Mon, Apr 01, 2002 at 06:10:13PM -0500, Chris Friesen wrote:
> 
> In the 2.2 scheduler there was a section that checked if the previous process
> was still runnable and set it as the default next running process.  It looked
> like this:
> 
> 	if (prev->state == TASK_RUNNING)
> 	   goto still_running;
> still_running_back:
> 
> With another chunk of code under still_running that set "c" and "next".
> 
> In 2.4 this seems to have been removed.  Can someone explain why?  I'm porting
> some custom scheduler changes and want to make sure that I understand what's
> going on in 2.4.

In 2.2 and early 2.4 versions of the scheduler, the 'can_schedule'
macro rejected tasks that had the 'has_cpu' field set.  The logic
has been changed so that 'can_schedule' will return true for the
task which is still running on the current CPU.  Therefore, the
scan of all tasks on the runqueue will recognize/include the currently
running task.  This eliminates the need for the special 'still_running'
check noted above.

The logic should be the same as before.  The only difference would
be in the case where a task with identical goodness was found on the
runqueue before the current task.  In this case we would run the other
task instead of continuing with the current task.  In practice, this
doesn't happen enough to justify the special check.

-- 
Mike

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2002-04-01 23:26 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-04-01 23:10 Question about scheduler changes from 2.2 to 2.4 Chris Friesen
2002-04-01 23:25 ` Mike Kravetz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®