svn commit: r208589 - head/sys/mips/mips

Jayachandran C. c.jayachandran at gmail.com
Mon Jul 19 07:19:35 UTC 2010


On Wed, Jul 14, 2010 at 11:56 PM, Alan Cox <alc at cs.rice.edu> wrote:
[....]
> This makes sense.  I have the following requests.  All but 1.a. are simple,
> mechanical changes.
>
> 1. Move vm_phys_page_alloc() to vm_page.c and rename it to
> vm_page_alloc_freelist().
>
> 1.a. The new vm_page_alloc_freelist() should really have a "req" parameter
> like vm_page_alloc() and duplicate the following from vm_page_alloc():
>
>   mtx_lock(&vm_page_queue_free_mtx);
>   if (cnt.v_free_count + cnt.v_cache_count > cnt.v_free_reserved ||
>       (page_req == VM_ALLOC_SYSTEM &&
>       cnt.v_free_count + cnt.v_cache_count > cnt.v_interrupt_free_min) ||
>       (page_req == VM_ALLOC_INTERRUPT &&
>       cnt.v_free_count + cnt.v_cache_count > 0)) {
>
> In essence, user page table page allocation shouldn't be allowed to allocate
> the last available page.  Only pmap_growkernel() should use
> VM_ALLOC_INTERRUPT.  (See either the amd64 or i386 pmap.)
>
> You could also drop the "pool" parameter and pass VM_FREEPOOL_DIRECT to
> vm_phys_alloc_freelist_pages() from vm_page_alloc_freelist().  (This is
> consistent with what vm_page_alloc() does for VM_ALLOC_NOOBJ.)
>
> 2. Move vm_page_alloc_init() to vm_page.c as well.  (And add it to
> vm_page.h.)
>
> 3. Make vm_phys_alloc_freelist_pages() extern.
>
>
>> Since I had originally added the UMA zone for  page table
>> pages for MIPS, which has the issues you had noted, I would like to
>> fix this...
>
>
> The patch introduces a few unnecessary blank lines.  Can you please remove
> these:
[...]
>
> FreeBSD style(9) requires parentheses around the "m":
[...]
> +                       return m;

[freebsd-mips cc-ed, for comments on MIPS side]

Here's is the updated patch with the review comments taken care of. I
have been testing this on MIPS, could not see any regression so far.

--
Redo the page table page allocation on MIPS, based on suggestion from
alc at . The current UMA zone based allocation can be replaced by a
scheme that creates a new free list for the KSEG0 region, and a new
function in sys/vm to allocate pages from a specific free page list.

The changes are :
- Revert the earlier changes in MIPS pmap.c that added UMA zone for
page table pages.
- Add a new freelist VM_FREELIST_HIGHMEM to vmparam.h for memory that
is not directly mapped (in 32bit compilation). Normal page allocations
will first try the HIGHMEM freelist and then the default freelist
(which is for the KSEG0 direct mapped memory).
- Add a new function 'vm_page_t vm_page_alloc_freelist(int flind, int
order, int req)' to vm/vm_page.c to allocate a page from a specified
freelist.  The MIPS page table pages will be allocated using this
function from the KSEG0 freelist.
- Move the page initialization code from  vm_phys_alloc_contig() to a
new function vm_page_alloc_init(), and use this function to initialize
pages in vm_page_alloc_freelist() too.
-  Split the  vm_phys_alloc_pages(pool, order) to create
vm_phys_alloc_freelist_pages(int flind, int pool, int order), and use
this function from both vm_page_alloc_freelist() and
vm_phys_alloc_pages().
--

Thanks,
JC.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pmap-pagetable-page-alloc.patch
Type: text/x-patch
Size: 17031 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-mips/attachments/20100719/400a14f4/pmap-pagetable-page-alloc.bin


More information about the freebsd-mips mailing list