Date: Fri, 11 Oct 2002 15:26:19 -0700 (PDT) From: Peter Wemm <peter@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 19102 for review Message-ID: <200210112226.g9BMQJPP047951@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=19102 Change 19102 by peter@peter_mckinley on 2002/10/11 15:25:27 ok, this is a bit nasty, but it boots... use a MD obj_alloc for UMA. This is only used for the pv and pte zones, but having the results direct mapped is what we're after. Affected files ... .. //depot/projects/ia64/sys/conf/files.ia64#17 edit .. //depot/projects/ia64/sys/ia64/ia64/pmap.c#39 edit .. //depot/projects/ia64/sys/ia64/ia64/uma_machdep.c#2 edit .. //depot/projects/ia64/sys/vm/uma_core.c#24 edit Differences ... ==== //depot/projects/ia64/sys/conf/files.ia64#17 (text+ko) ==== @@ -65,6 +65,7 @@ ia64/ia64/swtch.s standard ia64/ia64/sys_machdep.c standard ia64/ia64/trap.c standard +ia64/ia64/uma_machdep.c standard ia64/ia64/unaligned.c standard ia64/ia64/unwind.c optional ddb ia64/ia64/vm_machdep.c standard ==== //depot/projects/ia64/sys/ia64/ia64/pmap.c#39 (text+ko) ==== @@ -117,7 +117,6 @@ #include <vm/vm_pageout.h> #include <vm/vm_pager.h> #include <vm/uma.h> -#include <vm/uma_int.h> /* XXX for obj_alloc clone */ #include <sys/user.h> @@ -496,44 +495,6 @@ return (void *)IA64_PHYS_TO_RR7(ia64_tpa(kmem_alloc(kernel_map, bytes))); } -/* Clone of obj_alloc from uma_core.c, but using RR7 */ -static void * -pmap_allocf_obj_r7(uma_zone_t zone, int bytes, u_int8_t *flags, int wait) -{ - vm_offset_t zkva; - vm_offset_t retkva; - vm_page_t p; - int pages; - - retkva = 0; - pages = zone->uz_pages; - if (bytes > PAGE_SIZE) - panic("pmap_allocf_obj_r7: indigestion: %d\n", bytes); - - /* - * This looks a little weird since we're getting one page at a time - */ - while (bytes > 0) { - p = vm_page_alloc(zone->uz_obj, pages, - VM_ALLOC_INTERRUPT); - if (p == NULL) - return (NULL); - - zkva = zone->uz_kva + pages * PAGE_SIZE; - if (retkva == 0) - retkva = zkva; - pmap_qenter(zkva, &p, 1); - bytes -= PAGE_SIZE; - pages += 1; - } - - *flags = UMA_SLAB_PRIV; - - /* This is a large chunk of duplicated code for this one special hack */ - /* XXX optimize so that we use VM_PAGE_TO_PHYS(p) instead of pmap_qenter */ - return ((void *)IA64_PHYS_TO_RR7(ia64_tpa(retkva))); -} - /* * Initialize the pmap module. * Called by vm_init, to initialize any structures that the pmap @@ -604,10 +565,6 @@ pv_entry_high_water = 9 * (pv_entry_max / 10); uma_zone_set_obj(pvzone, &pvzone_obj, pv_entry_max); uma_zone_set_obj(ptezone, &ptezone_obj, pv_entry_max); - /* XXX override uma_zone_set_obj above */ - ZONE_LOCK(ptezone); - ptezone->uz_allocf = pmap_allocf_obj_r7; - ZONE_UNLOCK(ptezone); } ==== //depot/projects/ia64/sys/ia64/ia64/uma_machdep.c#2 (text+ko) ==== @@ -67,7 +67,10 @@ * TODO: If we fail during a multi-page allocation release the pages that have * already been allocated. */ -static void * +void * +obj_alloc(uma_zone_t zone, int bytes, u_int8_t *flags, int wait); + +void * obj_alloc(uma_zone_t zone, int bytes, u_int8_t *flags, int wait) { vm_offset_t zkva; @@ -78,6 +81,15 @@ retkva = 0; pages = zone->uz_pages; + if (bytes <= PAGE_SIZE) { + p = vm_page_alloc(zone->uz_obj, pages, + VM_ALLOC_INTERRUPT); + if (p == NULL) + return (NULL); + *flags = UMA_SLAB_PRIV; + return ((void *)IA64_PHYS_TO_RR7(VM_PAGE_TO_PHYS(p))); + } + /* * This looks a little weird since we're getting one page at a time */ ==== //depot/projects/ia64/sys/vm/uma_core.c#24 (text+ko) ==== @@ -147,7 +147,11 @@ /* Prototypes.. */ +#ifdef __ia64__ +void *obj_alloc(uma_zone_t, int, u_int8_t *, int); +#else static void *obj_alloc(uma_zone_t, int, u_int8_t *, int); +#endif static void *page_alloc(uma_zone_t, int, u_int8_t *, int); static void page_free(void *, int, u_int8_t); static uma_slab_t slab_zalloc(uma_zone_t, int); @@ -786,6 +790,7 @@ return (p); } +#ifndef __ia64__ /* * Allocates a number of pages from within an object * @@ -833,6 +838,7 @@ return ((void *)retkva); } +#endif /* * Frees a number of pages to the system @@ -1880,12 +1886,19 @@ if (pages * zone->uz_ipers < count) pages++; +#ifdef __ia64__ +if (zone->uz_ppera > 1) { +#endif kva = kmem_alloc_pageable(kernel_map, pages * UMA_SLAB_SIZE); if (kva == 0) { mtx_unlock(&Giant); return (0); } +#ifdef __ia64__ +} else + kva = 0; +#endif if (obj == NULL) To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe p4-projects" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200210112226.g9BMQJPP047951>