[lkml]   [2010]   [Jul]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
    SubjectRe: [patch 1/2] x86_64 page fault NMI-safe
    On Fri, 2010-07-16 at 12:47 +0200, Frederic Weisbecker wrote:
    > > Thus the kernel maps the physical memory with the fewest TLB entries as
    > > needed (large pages and large TLB entries). If we can map 64K pages, we
    > > do that. Then kmalloc just allocates within this range, it does not need
    > > to map any pages. They are already mapped.
    > >
    > > Does this make a bit more sense?
    > Totally! You've made it very clear to me.
    > Moreover I did not know we can have such variable page size. I mean I thought
    > we can have variable page size but that would apply to every pages.

    In x86_64, if bit 7 in the PDE (Page Directory Entry) is set then it
    points to a 2 Meg page. Otherwise it points to a page table which will
    have 512 PTE's pointing to 4K pages.


    It has nice diagrams that explains this. Check out page 207 (fig 5-17)
    and 210 (fig 5-22).

    The phys_pmd_init() in arch/x86/mm/init_64.c will try to map memory
    using 2M pages if it can, otherwise it falls back to 4K pages.

    -- Steve

     \ /
      Last update: 2010-07-16 13:47    [W:0.023 / U:47.440 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site