Re: Page fault in kernel code

2014-09-16 Thread Christoph Lameter
On Thu, 11 Sep 2014, Leon Romanovsky wrote: > > 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. Kernel faults are used on some pl

Re: Page fault in kernel code

2014-09-11 Thread Leon Romanovsky
On Thu, Sep 11, 2014 at 5:53 PM, Miles MH Chen 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

Re: Page fault in kernel code

2014-09-11 Thread Miles MH Chen
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

Re: Page fault in kernel code

2014-09-11 Thread Leon Romanovsky
On Wed, Sep 10, 2014 at 5:52 PM, Manavendra Nath Manav wrote: > > On 10-Sep-2014 6:24 pm, 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

Re: Page fault in kernel code

2014-09-10 Thread Manavendra Nath Manav
On 10-Sep-2014 6:24 pm, 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-

Re: Page fault in kernel code

2014-09-10 Thread Valdis . Kletnieks
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 mo

RE: Page fault in kernel code

2014-09-10 Thread Manavendra Nath Manav
On 09-Sep-2014 10:25 pm, "Jeff Haran" 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? Als

RE: Page fault in kernel code

2014-09-09 Thread Jeff Haran
in kernel code 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 fau

Re: Page fault in kernel code

2014-09-09 Thread Valdis . Kletnieks
On Tue, 09 Sep 2014 18:53:55 +0530, Manavendra Nath Manav said: > 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? There's no inherent chiseled-in-ston

Re: Page fault in kernel code

2014-09-09 Thread Greg KH
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

Page fault in kernel code

2014-09-09 Thread Manavendra Nath Manav
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 pro