From owner-p4-projects Fri Oct 11 15:26:46 2002 Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 5A86A37B404; Fri, 11 Oct 2002 15:26:40 -0700 (PDT) Delivered-To: perforce@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id CF0FC37B401 for ; Fri, 11 Oct 2002 15:26:39 -0700 (PDT) Received: from repoman.freebsd.org (repoman.freebsd.org [216.136.204.115]) by mx1.FreeBSD.org (Postfix) with ESMTP id 7C37E43E42 for ; Fri, 11 Oct 2002 15:26:39 -0700 (PDT) (envelope-from peter@freebsd.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.12.6/8.12.6) with ESMTP id g9BMQJMt047961 for ; Fri, 11 Oct 2002 15:26:19 -0700 (PDT) (envelope-from peter@freebsd.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.12.6/8.12.3/Submit) id g9BMQJPP047951 for perforce@freebsd.org; Fri, 11 Oct 2002 15:26:19 -0700 (PDT) Date: Fri, 11 Oct 2002 15:26:19 -0700 (PDT) Message-Id: <200210112226.g9BMQJPP047951@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to peter@freebsd.org using -f From: Peter Wemm Subject: PERFORCE change 19102 for review To: Perforce Change Reviews Sender: owner-p4-projects@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG 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 #include #include -#include /* XXX for obj_alloc clone */ #include @@ -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