All of lore.kernel.org
 help / color / mirror / Atom feed
From: orca.chen@gmail.com (Miles MH Chen)
To: kernelnewbies@lists.kernelnewbies.org
Subject: Page fault in kernel code
Date: Thu, 11 Sep 2014 22:53:53 +0800	[thread overview]
Message-ID: <CAHkaATSS2f8LBz8Evb3PrkCCAJ+w08yo6V3xdsUj1WQQCtfbmw@mail.gmail.com> (raw)
In-Reply-To: <CALq1K=JmTtiLSvBWJET6fGE111wPOGUOO+7+nzrEnf99c5+OWA@mail.gmail.com>

Not exactly, vmalloc'ed addresses can generate page faults.

vmalloc'ed page entries live in kernel master page table, not in

every process' page table. When a vmalloc page fault occurs,

kernel simply copy the page table entry from master page table to
the current process' page table and fix the page fault.

MH

On Thu, Sep 11, 2014 at 8:03 PM, Leon Romanovsky <leon@leon.nu> wrote:

> On Wed, Sep 10, 2014 at 5:52 PM, Manavendra Nath Manav
> <mnm.kernel@gmail.com> wrote:
> >
> > On 10-Sep-2014 6:24 pm, <Valdis.Kletnieks@vt.edu> wrote:
> >>
> >> On Wed, 10 Sep 2014 14:45:23 +0530, Manavendra Nath Manav said:
> >>
> >> > But if the total RAM is limited (less than 896MB LOWMEM), for example
> as
> >> > in
> >> > embedded devices how the kernel code be kept in RAM all the time. Am I
> >> > correct to assume that the kernel pre-fetches all pages when entering
> >> > kernel mode from user mode?
> >>
> >> No, kernel code is loaded by your boot loader, and *it stays there*.
> >> Similarly,
> >> if you modprobe something, the kernel allocates the page, loads the
> code,
> >> and leaves it there.
> >>
> >> Particularly in embedded devices, where you know all the modules the
> >> kernel may
> >> need, it's common to just create a kernel with everything built in, no
> >> module
> >> support, and when the system boots, it loads into memory and never moves
> >> again.
> >>
> >
> > Linux kernel memory is not page-able, but memory allocated through
> vmalloc
> > can still cause page fault. How device drivers using vmalloc handle this?
> Pages allocated via vmalloc call won't generate page-faults.
>
> >
> >
> > _______________________________________________
> > Kernelnewbies mailing list
> > Kernelnewbies at kernelnewbies.org
> > http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
> >
>
>
>
> --
> Leon Romanovsky | Independent Linux Consultant
>         www.leon.nu | leon at leon.nu
>
> _______________________________________________
> Kernelnewbies mailing list
> Kernelnewbies at kernelnewbies.org
> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20140911/1dc64a22/attachment.html 

  parent reply	other threads:[~2014-09-11 14:53 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
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 [this message]
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=CAHkaATSS2f8LBz8Evb3PrkCCAJ+w08yo6V3xdsUj1WQQCtfbmw@mail.gmail.com \
    --to=orca.chen@gmail.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.