public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: Arun Srinivas <getarunsri@hotmail.com>
Cc: juhl-lkml@dif.dk, LKML <linux-kernel@vger.kernel.org>
Subject: Re: scheduler/SCHED_FIFO behaviour
Date: Mon, 04 Apr 2005 23:33:05 -0400	[thread overview]
Message-ID: <1112671985.5147.50.camel@localhost.localdomain> (raw)
In-Reply-To: <BAY10-F20EDF8B5558E2E8945A4DAD93C0@phx.gbl>

On Tue, 2005-04-05 at 07:46 +0530, Arun Srinivas wrote:

> 
> So, what I want from the above code is whenever process1 or process2 is 
> being scheduled measure the time and print the timedifference. But, when I 
> run my 2 processes as SCHED_FIFO processes i get only one set of 
> readings....indicating they have been scheduled only once and run till 
> completion.
> 
> But, as we saw above if interrupts have been processed they must have been 
> scheduled several times(i.e., schedule() called several times). Is my 
> measurement procedure not correct?

No! Interrupts are not scheduled. When an interrupt goes off, the
interrupt service routine (ISR) is executed. It doesn't need to be
scheduled. It runs right where it interrupted the CPU. That's why you
need to be careful about protecting data that ISRs manipulate with
spin_lock_irqsave. This not only protects against multiple CPUs, but
turns off interrupts so that an interrupt wont be called and one of the
ISRs modify the data you need to be atomic.

Your tasks are running and will be interrupted by an ISR, on return from
the routine, a check is made to see if your tasks should be preempted.
But since they are the highest running tasks and in FIFO mode, the check
determines that schedule should not be called.  So you will not see any
schedules while your tasks are running.

Now, if you where running Ingo's RT patch with PREEMPT_HARDIRQ enabled,
and your tasks were of lower priority than the ISR thread handlers, then
you would see the scheduling. Maybe that is what you want?

-- Steve



  reply	other threads:[~2005-04-05  3:33 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <bpH71yEXU00000397@hotmail.com>
2005-04-03  0:37 ` sched /HT processor Arun Srinivas
2005-04-03  1:17   ` Steven Rostedt
2005-04-03  2:16     ` Arun Srinivas
2005-04-03  4:22       ` Steven Rostedt
2005-04-03  7:52     ` Arun Srinivas
2005-04-03 11:17       ` Jesper Juhl
2005-04-03 15:31         ` Steven Rostedt
2005-04-03 22:52           ` Arun Srinivas
2005-04-03 23:08             ` Steven Rostedt
2005-04-04 23:06               ` scheduler/SCHED_FIFO behaviour Arun Srinivas
2005-04-04 23:17                 ` Steven Rostedt
2005-04-05  2:16                   ` Arun Srinivas
2005-04-05  3:33                     ` Steven Rostedt [this message]
2005-04-03 22:52           ` sched /HT processor Arun Srinivas
2005-04-07  1:41 scheduler/SCHED_FIFO behaviour Arun Srinivas
2005-04-07  2:27 ` Steven Rostedt
2005-05-01  2:06   ` Arun Srinivas
2005-05-01 15:51     ` Steven Rostedt
2005-05-02  5:27       ` Arun Srinivas
2005-05-02 10:37         ` Florian Schmidt
2005-05-02 16:33         ` Steven Rostedt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1112671985.5147.50.camel@localhost.localdomain \
    --to=rostedt@goodmis.org \
    --cc=getarunsri@hotmail.com \
    --cc=juhl-lkml@dif.dk \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox