Page fault in kernel code

Leon Romanovsky leon at leon.nu
Thu Sep 11 11:26:42 EDT 2014


On Thu, Sep 11, 2014 at 5:53 PM, Miles MH Chen <orca.chen at gmail.com> wrote:
> 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
Thanks, I was under wrong impression that the difference between page
allocated in kmalloc vs. vmalloc is in PTE mapping.

>
> On Thu, Sep 11, 2014 at 8:03 PM, Leon Romanovsky <leon at leon.nu> wrote:
>>
>> On Wed, Sep 10, 2014 at 5:52 PM, Manavendra Nath Manav
>> <mnm.kernel at gmail.com> wrote:
>> >
>> > On 10-Sep-2014 6:24 pm, <Valdis.Kletnieks at 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
>
>



-- 
Leon Romanovsky | Independent Linux Consultant
        www.leon.nu | leon at leon.nu



More information about the Kernelnewbies mailing list