linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "shane Miller" <gshanemiller@gmail.com>
To: linux-kernel@vger.kernel.org
Subject: How linux schedules things when interrupts occur
Date: Sat, 4 Mar 2006 10:42:23 -0500	[thread overview]
Message-ID: <f89c9fd60603040742x1ae5ce29rbe4ccc39fb973e08@mail.gmail.com> (raw)

All-

I know what interrupts are. I read the Linux Device driver book and
see how to deal with them. But I don't see the full picture on how the
kernel deals with scheduling it's work. Bsically I am leaking for more
meat on this.

Suppose Linux is running on a single CPU system. Conceptually the CPU
is executing a user thread/process --- whether  that be user code or
library code on the user's behalf --- or the CPU is in the kernel.

When an APIC processed hardware interrupt comes and assuming the
interrupt is not masked off then if

* the CPU is doing user code, the kernel arranges to block/preempt the
current user process/thread and jumps into the kernel and runs the
registered interrupt handler.

* the CPU is in the kernel so it jumps to the interrupt handler and
runs it.

Can somebody put some more meat on this? For example,

* how does the kernel decide what to schedule once the interrupt
handler is done? Does it, as may be the case, resume the preempted user
thread or resume where it left off in the kernel? Or does it merely
call schedule().
* What happens if a signal comes during this work?

Once I understand this I think I can deal with the case in which an
interrupt comes while an interrupt is already being processed.

Thanks.

             reply	other threads:[~2006-03-04 15:42 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-03-04 15:42 shane Miller [this message]
2006-03-04 16:44 ` How linux schedules things when interrupts occur 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=f89c9fd60603040742x1ae5ce29rbe4ccc39fb973e08@mail.gmail.com \
    --to=gshanemiller@gmail.com \
    --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;
as well as URLs for NNTP newsgroup(s).