Re: timer interrupt

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Jan 2, 2009 at 5:55 PM, Shyam Burkule <shyam.burkule@xxxxxxxxx> wrote:
> Hi All,
>
> In Understanding  The Linux Kernel, 3rd edition I read that
> *scheduler_tick()* is invoked once every tick to perform some operations

Yes, it is still valid and happens.   Looking into /proc/sched_debug:
 CFS is confirmed.

Next:

Looking into kernel/timer.c:update_process_times():

/*
 * Called from the timer interrupt handler to charge one tick to the current
 * process.  user_tick is 1 if the tick is user time, 0 for system.
 */
void update_process_times(int user_tick)
{
        scheduler_tick();

>From above we know that timer tick triggered the function, and
scheduler_tick() is called.

Then using ftrace to analyse dynamically:

          <idle>-0     [000] 4154504419.814143: scheduler_tick
<-update_process_times
           gedit-26702 [001] 4154504419.814146: scheduler_tick
<-update_process_times
          <idle>-0     [000] 4154504419.815139: scheduler_tick
<-update_process_times
           gedit-26702 [001] 4154504419.815142: scheduler_tick
<-update_process_times

So yes, it is still called in the context of my gedit application.

> related to scheduling. I am confused here, how costly it would be to call
> the function after every tick? Does it really happened? If not, then how
> indication of process time slice exhausted(if any) comes to know??
>
>

In the past, preemption is triggered by the timer.   But nowadays,
preemption is voluntary.

http://lwn.net/Articles/95334/

So why is it that we can still see timer based scheduling API like
scheduler_tick() called from timer interrupt?

I am confused too.

-- 
Regards,
Peter Teoh

--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx
Please read the FAQ at http://kernelnewbies.org/FAQ


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux