Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/uvm In the case of a double amap_extend() (during a forw...
details: https://anonhg.NetBSD.org/src/rev/04ab69998352
branches: trunk
changeset: 538662:04ab69998352
user: atatat <atatat%NetBSD.org@localhost>
date: Thu Oct 24 22:22:28 2002 +0000
description:
In the case of a double amap_extend() (during a forward merge after a
back merge), don't abort the allocation if the second extend fails,
just abort the forward merge and finish the allocation.
Code reviewed by thorpej.
diffstat:
sys/uvm/uvm_map.c | 26 ++++++++++++--------------
1 files changed, 12 insertions(+), 14 deletions(-)
diffs (47 lines):
diff -r e96c8b6242d1 -r 04ab69998352 sys/uvm/uvm_map.c
--- a/sys/uvm/uvm_map.c Thu Oct 24 20:54:41 2002 +0000
+++ b/sys/uvm/uvm_map.c Thu Oct 24 22:22:28 2002 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: uvm_map.c,v 1.122 2002/10/24 20:37:59 atatat Exp $ */
+/* $NetBSD: uvm_map.c,v 1.123 2002/10/24 22:22:28 atatat Exp $ */
/*
* Copyright (c) 1997 Charles D. Cranor and Washington University.
@@ -71,7 +71,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: uvm_map.c,v 1.122 2002/10/24 20:37:59 atatat Exp $");
+__KERNEL_RCSID(0, "$NetBSD: uvm_map.c,v 1.123 2002/10/24 22:22:28 atatat Exp $");
#include "opt_ddb.h"
#include "opt_uvmhist.h"
@@ -787,18 +787,16 @@
* XXX call amap_extend() to merge backwards here if needed. -- @@@
*/
if (merged) {
- if (prev_entry->aref.ar_amap) {
- error = amap_extend(prev_entry,
- prev_entry->next->end -
- prev_entry->next->start);
- if (error) {
- vm_map_unlock(map);
- if (new_entry) {
- uvm_mapent_free(new_entry);
- }
- return error;
- }
- }
+ /*
+ * Try to extend the amap of the previous entry to
+ * cover the next entry as well. If it doesn't work
+ * just skip on, don't actually give up, since we've
+ * already completed the back merge.
+ */
+ if (prev_entry->aref.ar_amap &&
+ amap_extend(prev_entry, prev_entry->next->end -
+ prev_entry->next->start))
+ goto nomerge;
}
if (merged) {
Home |
Main Index |
Thread Index |
Old Index