lkml.org 
[lkml]   [1999]   [Dec]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: lowlatency-2.2.13-A1 questions

On Thu, 2 Dec 1999, Ingo Molnar wrote:
>
> On Thu, 2 Dec 1999, William Montgomery wrote:
>
> > An interrupt can occur during the kernel schedule function
> > just prior to the "__switch_to" function and the interrupt handler
> > may add a new task to the run-queue and set current->need_resched.
> > Then the current task gets switched out immediately and the need_resched
> > flag is lost. Should the new task inherit need_resched in this
> > case? Is this an oversight or is this intentional?
>
> hm, this shouldnt happen, because it's not current->need_resched that gets
> set, but cpu_curr(cpu)->need_resched. cpu_curr gets set atomically and
> takes the value of the next process already before doing the switch_to().
> So any new wakeup and potential ->need_resched setting should go to the
> next process.
>
Here is a snippet from my trace log (slightly reformatted):

61899.88 0.14 schedule_timeout pid(132)
61900.01 1.75 schedule pid(132)
61901.76 0.49 do_IRQ pid(132)
61902.25 2.84 do_8259A_IRQ pid(132)
61905.09 0.47 handle_IRQ_event pid(132)
61905.56 4.78 rtc_interrupt pid(132)
61910.34 0.82 __wake_up pid(132)
61911.16 0.49 wake_up_process pid(132)
61911.65 0.35 reschedule_idle pid(132)
61912.00 0.64 mod_timer pid(132)
61912.64 0.73 enable_8259A_irq pid(132)
61913.37 0.14 do_IRQ pid(132)
61913.51 0.66 do_IRQ pid(132->309)
61914.17 2.65 __switch_to pid(309)

The "wake_up_process" puts pid(188) in the run-queue and the
"reschedule_idle" sets pid(132)->need_resched = 1.
However, pid(309) is switched in and does not have need_resched = 1.

I am not running SMP only UP; a snippet from reschedule_idle
follows:
---------------
#else /* UP */
int this_cpu = smp_processor_id();
struct task_struct *tsk;

tsk = current;
if (preemption_goodness(tsk, p, this_cpu) > 0)
tsk->need_resched = 1;
#endif
}
----------------

Is my theory valid?

Wm


-
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:55    [W:0.066 / U:0.048 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site