All of lore.kernel.org
 help / color / mirror / Atom feed
From: greg@kroah.com (Greg KH)
To: kernelnewbies@lists.kernelnewbies.org
Subject: Page fault in kernel code
Date: Tue, 9 Sep 2014 07:25:05 -0700	[thread overview]
Message-ID: <20140909142505.GA18476@kroah.com> (raw)
In-Reply-To: <CAJKgH8C1cgQmJFJSBsNWB_tK9yWHZUaEUyimvm60d-YOCFeD0Q@mail.gmail.com>

On Tue, Sep 09, 2014 at 06:53:55PM +0530, Manavendra Nath Manav wrote:
> While reading the book Essential Linux device drivers it says "user mode code
> is allowed to page fault, however, whereas kernel mode code isn't".
> 
> Why is it so? Why can't kernel mode code handle the page fault and reload the
> page from swap? Also, can page fault occur when kernel is executing in process
> context and/or interrupt context?

That is just the way the Linux kernel is designed, no page faults within
it, unlike other operating systems.  In the end, it makes kernel code
much simpler.

thanks,

greg k-h

  reply	other threads:[~2014-09-09 14:25 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CAJKgH8Df51ZL-BaN_zBmtP=2tjxh5po6KWdbR1Q7LwiR2DZzTg@mail.gmail.com>
2014-09-09 13:23 ` Page fault in kernel code Manavendra Nath Manav
2014-09-09 14:25   ` Greg KH [this message]
2014-09-09 15:51   ` Valdis.Kletnieks at vt.edu
2014-09-09 16:54   ` Jeff Haran
2014-09-10  9:15     ` Manavendra Nath Manav
2014-09-10 12:54       ` Valdis.Kletnieks at vt.edu
2014-09-10 14:52         ` Manavendra Nath Manav
2014-09-11 12:03           ` Leon Romanovsky
2014-09-11 14:19             ` Christoph Lameter
2014-09-11 14:53             ` Miles MH Chen
2014-09-11 15:26               ` Leon Romanovsky

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=20140909142505.GA18476@kroah.com \
    --to=greg@kroah.com \
    --cc=kernelnewbies@lists.kernelnewbies.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.