Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F102746560
D46208.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D46208.diff
View Options
diff --git a/sys/vm/vm_object.c b/sys/vm/vm_object.c
--- a/sys/vm/vm_object.c
+++ b/sys/vm/vm_object.c
@@ -1115,13 +1115,14 @@
vm_object_page_collect_flush(vm_object_t object, vm_page_t p, int pagerflags,
int flags, boolean_t *allclean, boolean_t *eio)
{
- vm_page_t ma[2 * vm_pageout_page_count], tp;
- int count, mreq, runlen;
+ vm_page_t ma[2 * vm_pageout_page_count - 1], tp;
+ int base, count, runlen;
vm_page_lock_assert(p, MA_NOTOWNED);
vm_page_assert_xbusied(p);
VM_OBJECT_ASSERT_WLOCKED(object);
- ma[vm_pageout_page_count] = p;
+ base = nitems(ma) / 2;
+ ma[base] = p;
for (count = 1, tp = p; count < vm_pageout_page_count; count++) {
tp = vm_page_next(tp);
if (tp == NULL || vm_page_tryxbusy(tp) == 0)
@@ -1130,10 +1131,10 @@
vm_page_xunbusy(tp);
break;
}
- ma[vm_pageout_page_count + count] = tp;
+ ma[base + count] = tp;
}
- for (mreq = 0, tp = p; count < vm_pageout_page_count; count++, mreq++) {
+ for (tp = p; count < vm_pageout_page_count; count++) {
tp = vm_page_prev(tp);
if (tp == NULL || vm_page_tryxbusy(tp) == 0)
break;
@@ -1141,11 +1142,11 @@
vm_page_xunbusy(tp);
break;
}
- ma[vm_pageout_page_count - 1 - mreq] = tp;
+ ma[--base] = tp;
}
- vm_pageout_flush(&ma[vm_pageout_page_count - mreq], count, pagerflags,
- mreq, &runlen, eio);
+ vm_pageout_flush(&ma[base], count, pagerflags, nitems(ma) / 2 - base,
+ &runlen, eio);
return (runlen);
}
diff --git a/sys/vm/vm_pageout.c b/sys/vm/vm_pageout.c
--- a/sys/vm/vm_pageout.c
+++ b/sys/vm/vm_pageout.c
@@ -348,7 +348,7 @@
vm_pageout_cluster(vm_page_t m)
{
vm_object_t object;
- vm_page_t mc[2 * vm_pageout_page_count], p, pb, ps;
+ vm_page_t mc[2 * vm_pageout_page_count - 1], p, pb, ps;
vm_pindex_t pindex;
int ib, is, page_base, pageout_count;
@@ -358,9 +358,9 @@
vm_page_assert_xbusied(m);
- mc[vm_pageout_page_count] = pb = ps = m;
pageout_count = 1;
- page_base = vm_pageout_page_count;
+ page_base = nitems(mc) / 2;
+ mc[page_base] = pb = ps = m;
ib = 1;
is = 1;
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Nov 17, 3:48 PM (21 h, 10 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
14681736
Default Alt Text
D46208.diff (1 KB)
Attached To
Mode
D46208: vm_pageout: shrink pageout array
Attached
Detach File
Event Timeline
Log In to Comment