Page fault in kernel code

Manavendra Nath Manav mnm.kernel at gmail.com
Wed Sep 10 05:15:23 EDT 2014


On 09-Sep-2014 10:25 pm, "Jeff Haran" <Jeff.Haran at citrix.com> 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?
>
> -- manav m-n
>
> Think about handling the case where a page fault has occurred but the
code that handles the page fault is itself not already in RAM, which leads
to another page fault. Gets complicated. That complexity can be avoided by
keeping all the kernel code in RAM all the time. Same applies to the kernel
data that is needed to handle a page fault.
>
> Jeff Haran
>
>

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?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20140910/eb2f31cd/attachment-0001.html 


More information about the Kernelnewbies mailing list