Date: Tue, 15 Aug 2000 15:50:04 -0700 (PDT) From: Tor.Egge@fast.no To: freebsd-bugs@FreeBSD.org Subject: Re: kern/20609: panic: vm_fault: fault on nofault entry, addr: cc4b3000 Message-ID: <200008152250.PAA20603@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
The following reply was made to PR kern/20609; it has been noted by GNATS. From: Tor.Egge@fast.no To: dillon@freebsd.org Cc: freebsd-gnats-submit@freebsd.org Subject: Re: kern/20609: panic: vm_fault: fault on nofault entry, addr: cc4b3000 Date: Wed, 16 Aug 2000 00:43:05 +0200 Here is a suggested fix. Please review. Index: sys/i386/i386/machdep.c =================================================================== RCS file: /home/ncvs/src/sys/i386/i386/machdep.c,v retrieving revision 1.401 diff -u -r1.401 machdep.c --- sys/i386/i386/machdep.c 2000/08/13 05:17:46 1.401 +++ sys/i386/i386/machdep.c 2000/08/15 22:39:49 @@ -379,6 +379,7 @@ (nbuf*BKVASIZE) + (nswbuf*MAXPHYS) + pager_map_size); buffer_map = kmem_suballoc(clean_map, &buffer_sva, &buffer_eva, (nbuf*BKVASIZE)); + buffer_map->system_map = 1; pager_map = kmem_suballoc(clean_map, &pager_sva, &pager_eva, (nswbuf*MAXPHYS) + pager_map_size); pager_map->system_map = 1; Index: sys/vm/vm_map.c =================================================================== RCS file: /home/ncvs/src/sys/vm/vm_map.c,v retrieving revision 1.190 diff -u -r1.190 vm_map.c --- sys/vm/vm_map.c 2000/05/14 18:46:40 1.190 +++ sys/vm/vm_map.c 2000/08/15 22:39:49 @@ -271,7 +271,10 @@ vm_map_t map; vm_map_entry_t entry; { - zfree((map->system_map || !mapentzone) ? kmapentzone : mapentzone, entry); + if (map->system_map || !mapentzone) + zfreei(kmapentzone, entry); + else + zfree(mapentzone, entry); } /* @@ -286,8 +289,10 @@ { vm_map_entry_t new_entry; - new_entry = zalloc((map->system_map || !mapentzone) ? - kmapentzone : mapentzone); + if (map->system_map || !mapentzone) + new_entry = zalloci(kmapentzone); + else + new_entry = zalloc(mapentzone); if (new_entry == NULL) panic("vm_map_entry_create: kernel resources exhausted"); return(new_entry); @@ -776,7 +781,7 @@ * put this improvement. */ - if (entry->object.vm_object == NULL) { + if (entry->object.vm_object == NULL && !map->system_map) { vm_object_t object; object = vm_object_allocate(OBJT_DEFAULT, atop(entry->end - entry->start)); @@ -832,7 +837,7 @@ * put this improvement. */ - if (entry->object.vm_object == NULL) { + if (entry->object.vm_object == NULL && !map->system_map) { vm_object_t object; object = vm_object_allocate(OBJT_DEFAULT, atop(entry->end - entry->start)); @@ -1287,7 +1292,8 @@ atop(entry->end - entry->start)); entry->eflags &= ~MAP_ENTRY_NEEDS_COPY; - } else if (entry->object.vm_object == NULL) { + } else if (entry->object.vm_object == NULL && + !map->system_map) { entry->object.vm_object = vm_object_allocate(OBJT_DEFAULT, @@ -1477,7 +1483,8 @@ &entry->offset, atop(entry->end - entry->start)); entry->eflags &= ~MAP_ENTRY_NEEDS_COPY; - } else if (entry->object.vm_object == NULL) { + } else if (entry->object.vm_object == NULL && + !map->system_map) { entry->object.vm_object = vm_object_allocate(OBJT_DEFAULT, atop(entry->end - entry->start)); @@ -2604,7 +2611,8 @@ /* * Create an object if necessary. */ - if (entry->object.vm_object == NULL) { + if (entry->object.vm_object == NULL && + !map->system_map) { if (vm_map_lock_upgrade(map)) goto RetryLookup; Index: sys/vm/vm_fault.c =================================================================== RCS file: /home/ncvs/src/sys/vm/vm_fault.c,v retrieving revision 1.112 diff -u -r1.112 vm_fault.c --- sys/vm/vm_fault.c 2000/05/29 22:40:54 1.112 +++ sys/vm/vm_fault.c 2000/08/15 22:39:49 @@ -796,6 +796,7 @@ * any swap backing since the page is now dirty. */ if (fault_flags & VM_FAULT_DIRTY) { + int s; if (fs.entry->eflags & MAP_ENTRY_NOSYNC) { if (fs.m->dirty == 0) vm_page_flag_set(fs.m, PG_NOSYNC); @@ -803,7 +804,9 @@ vm_page_flag_clear(fs.m, PG_NOSYNC); } vm_page_dirty(fs.m); + s = splvm(); vm_pager_page_unswapped(fs.m); + splx(s); } } To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-bugs" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200008152250.PAA20603>