Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F143304750
D19826.id55954.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
2 KB
Referenced Files
None
Subscribers
None
D19826.id55954.diff
View Options
Index: sys/vm/vm_map.c
===================================================================
--- sys/vm/vm_map.c
+++ sys/vm/vm_map.c
@@ -923,10 +923,12 @@
/* Rotate right and make y root. */ \
root->left = y->right; \
y->right = root; \
- vm_map_entry_set_max_free(root); \
+ if (root->max_free == y->max_free) \
+ vm_map_entry_set_max_free(root);\
root = y; \
y = root->left; \
} \
+ root->max_free = root->right ? root->right->max_free : root->next->start - root->end;\
/* Put root on rlist. */ \
root->left = rlist; \
rlist = root; \
@@ -939,10 +941,12 @@
/* Rotate left and make y root. */ \
root->right = y->left; \
y->left = root; \
- vm_map_entry_set_max_free(root); \
+ if (root->max_free == y->max_free) \
+ vm_map_entry_set_max_free(root);\
root = y; \
y = root->right; \
} \
+ root->max_free = root->left ? root->left->max_free : root->start - root->prev->end;\
/* Put root on llist. */ \
root->right = llist; \
llist = root; \
@@ -1015,18 +1019,31 @@
vm_map_entry_t ltree, vm_map_entry_t rtree)
{
vm_map_entry_t y;
+ vm_size_t max_free;
+ if (llist != NULL)
+ max_free = (ltree != NULL) ? ltree->max_free :
+ llist->next->start - llist->end;
while (llist != NULL) {
y = llist->right;
llist->right = ltree;
- vm_map_entry_set_max_free(llist);
+ if (llist->max_free < max_free)
+ llist->max_free = max_free;
+ else
+ max_free = llist->max_free;
ltree = llist;
llist = y;
}
+ if (rlist != NULL)
+ max_free = (rtree != NULL) ? rtree->max_free :
+ rlist->start - rlist->prev->end;
while (rlist != NULL) {
y = rlist->left;
rlist->left = rtree;
- vm_map_entry_set_max_free(rlist);
+ if (rlist->max_free < max_free)
+ rlist->max_free = max_free;
+ else
+ max_free = rlist->max_free;
rtree = rlist;
rlist = y;
}
@@ -1132,10 +1149,6 @@
vm_map_entry_t llist, rlist, root, y;
VM_MAP_ASSERT_LOCKED(map);
- llist = entry->prev;
- rlist = entry->next;
- llist->next = rlist;
- rlist->prev = llist;
root = map->root;
root = vm_map_splay_split(entry->start, 0, root, &llist, &rlist);
KASSERT(root != NULL,
@@ -1174,6 +1187,9 @@
root = NULL;
break;
}
+ y = entry->next;
+ y->prev = entry->prev;
+ y->prev->next = y;
if (root != NULL)
root = vm_map_splay_merge(root, llist, rlist,
root->left, root->right);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Jan 29, 4:31 PM (9 h, 38 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
28086463
Default Alt Text
D19826.id55954.diff (2 KB)
Attached To
Mode
D19826: reduce accesses to vm_map entries off the search path in updating max_free
Attached
Detach File
Event Timeline
Log In to Comment