Date: Mon, 13 Sep 2010 13:58:03 GMT From: Edward Tomasz Napierala <trasz@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 183712 for review Message-ID: <201009131358.o8DDw39L085752@skunkworks.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://p4web.freebsd.org/@@183712?ac=10 Change 183712 by trasz@trasz_victim on 2010/09/13 13:58:02 Try to fix panics I've been seeing occasionaly. Affected files ... .. //depot/projects/soc2009/trasz_limits/sys/vm/swap_pager.c#8 edit .. //depot/projects/soc2009/trasz_limits/sys/vm/vm_pageout.c#16 edit Differences ... ==== //depot/projects/soc2009/trasz_limits/sys/vm/swap_pager.c#8 (text+ko) ==== @@ -2438,6 +2438,11 @@ vm_map_entry_t cur; int count = 0; +#if 0 + /* Panics the kernel at startup. */ + KASSERT(vm_map_locked(map), ("vm_map not locked")); +#endif + for (cur = map->header.next; cur != &map->header; cur = cur->next) { vm_object_t object; ==== //depot/projects/soc2009/trasz_limits/sys/vm/vm_pageout.c#16 (text+ko) ==== @@ -1722,8 +1722,11 @@ * I want to get a better feeling on how the memory * management works. In other words, it's post-shm task. */ - size = vmspace_swap_count(vm); - rusage_set(p, RUSAGE_SWAP, IDX_TO_OFF(size)); + if (vm_map_trylock_read(&vm->vm_map)) { + size = vmspace_swap_count(vm); + vm_map_unlock_read(&vm->vm_map); + rusage_set(p, RUSAGE_SWAP, IDX_TO_OFF(size)); + } #endif vmspace_free(vm); }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201009131358.o8DDw39L085752>