[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH gnumach] i386: Use discontiguous page directories when using

From: Samuel Thibault
Subject: Re: [PATCH gnumach] i386: Use discontiguous page directories when using PAE.
Date: Sun, 23 Oct 2016 11:58:08 +0200
User-agent: Mutt/1.5.21+34 (58baf7c9f32f) (2010-12-30)

Justus Winter, on Sun 23 Oct 2016 11:31:10 +0200, wrote:
> Previously, we used contiguous page directories four pages in length
> when using PAE.  To prevent physical memory fragmentation, we need to
> use virtual memory for objects spanning multiple pages.  Virtual
> kernel memory, however, is a scarce commodity.
> * i386/intel/pmap.h (lin2pdenum): Never include the page directory pointer 
> table index.
> (lin2pdenum_cont): New macro which does include said index.
> (struct pmap): Remove the directory base pointer when using PAE.
> * i386/intel/pmap.c (pmap_pde): Fix lookup.
> (pmap_pte): Fix check for uninitialized pmap.
> (pmap_bootstrap): Do not store the page directory base if PAE.
> (pmap_init): Reduce size of page directories to one page, use
> direct-mapped memory.
> (pmap_create): Allocate four page directories per pmap.
> (pmap_destroy): Adapt to the discontinuous directories.
> (pmap_collect): Likewise.
> * i386/i386/xen.h (hyp_mmu_update_la): Adapt code manipulating the
> kernels page directory.
> * i386/i386at/model_dep.c (i386at_init): Likewise.

It looks good to me. There is just

> +#if PAE
> +     for (i = 0; i <= lin2pdpnum(LINEAR_MIN_KERNEL_ADDRESS); i++) {
> +             free_all = i < lin2pdpnum(LINEAR_MIN_KERNEL_ADDRESS);
> +             page_dir = (pt_entry_t *) ptetokv(p->pdpbase[i]);

Which is nicer to read when reviewing, but for eventual code, I'd say
indent the content of the loop, otherwise a quick glance won't catch
that the whole body is inside the loop.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]