lkml.org 
[lkml]   [2000]   [Mar]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: scheduler ignores need_resched flag in 2.2.x and 2.3.x?
Dimitris Michailidis wrote:
>
> Jun Sun <jsun@mvista.com> writes:
> > If we choose the above way to fix the lost need_resched flag, we would
> > also
> > need to apply the similar fix to two other functions for the SMP version
> > :
> >
> > 1. smp_local_timer_interrupt()
> > 2. update_process_times()
>
> These two are fine. They set the need_resched flag of the process whose
> counter they decrement, and if the timer interrupt arrives right before a
> context switch they charge the process being descheduled. Why would you
> change this? If you want to be more correct than we are now you can add
>
> prev->need_resched = 0
>
> in __schedule_tail() to make sure a process starts out with a clean
> need_resched when it resumes execution, but that's minor.
>
> --
> Dimitris Michailidis dimitris@engr.sgi.com

You are right!

I was looking for "lost need_resched flag" scenarios. In the above
cases, need_resched is "lost", but does no harm because the flag is set
in order for the CURRENT process to yield the CPU. This is in contrast
with the case when the flag is set to schedule some newly available
processes.

Jun

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 13:57    [W:0.990 / U:0.008 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site