View | Details | Raw Unified | Return to bug 205452 | Differences between
and this patch

Collapse All | Expand All

(-)b/emulators/virtualbox-ose/files/patch-src-VBox-Runtime-r0drv-freebsd-memobj-r0drv-freebsd.c (-10 / +13 lines)
Lines 7-15 From Alan L. Cox on FreeBSD-current: Link Here
7
    answer that question.
7
    answer that question.
8
8
9
[1] http://lists.freebsd.org/pipermail/freebsd-current/2012-November/037963.html
9
[1] http://lists.freebsd.org/pipermail/freebsd-current/2012-November/037963.html
10
--- src/VBox/Runtime/r0drv/freebsd/memobj-r0drv-freebsd.c.orig	2015-05-13 11:12:38.000000000 -0400
10
--- src/VBox/Runtime/r0drv/freebsd/memobj-r0drv-freebsd.c.orig	2015-11-10 21:23:50 UTC
11
+++ src/VBox/Runtime/r0drv/freebsd/memobj-r0drv-freebsd.c	2015-06-10 16:42:33.632228000 -0400
11
+++ src/VBox/Runtime/r0drv/freebsd/memobj-r0drv-freebsd.c
12
@@ -168,14 +168,19 @@
12
@@ -168,14 +168,19 @@ DECLHIDDEN(int) rtR0MemObjNativeFree(RTR
13
             VM_OBJECT_LOCK(pMemFreeBSD->pObject);
13
             VM_OBJECT_LOCK(pMemFreeBSD->pObject);
14
 #endif
14
 #endif
15
             vm_page_t pPage = vm_page_find_least(pMemFreeBSD->pObject, 0);
15
             vm_page_t pPage = vm_page_find_least(pMemFreeBSD->pObject, 0);
Lines 29-35 From Alan L. Cox on FreeBSD-current: Link Here
29
 #if __FreeBSD_version >= 1000030
29
 #if __FreeBSD_version >= 1000030
30
             VM_OBJECT_WUNLOCK(pMemFreeBSD->pObject);
30
             VM_OBJECT_WUNLOCK(pMemFreeBSD->pObject);
31
 #else
31
 #else
32
@@ -201,12 +206,12 @@
32
@@ -201,12 +206,12 @@ static vm_page_t rtR0MemObjFreeBSDContig
33
     vm_page_t pPages;
33
     vm_page_t pPages;
34
     int cTries = 0;
34
     int cTries = 0;
35
 
35
 
Lines 44-57 From Alan L. Cox on FreeBSD-current: Link Here
44
     {
44
     {
45
 #if __FreeBSD_version >= 1000030
45
 #if __FreeBSD_version >= 1000030
46
         VM_OBJECT_WLOCK(pObject);
46
         VM_OBJECT_WLOCK(pObject);
47
@@ -220,18 +225,20 @@
47
@@ -220,18 +225,23 @@ static vm_page_t rtR0MemObjFreeBSDContig
48
 #else
48
 #else
49
         VM_OBJECT_UNLOCK(pObject);
49
         VM_OBJECT_UNLOCK(pObject);
50
 #endif
50
 #endif
51
-        if (pPages)
51
-        if (pPages)
52
+        if (pPages || cTries >= 1)
52
+        if (pPages || cTries >= 1)
53
             break;
53
             break;
54
+#if __FreeBSD_version >= 1000015
54
+#if __FreeBSD_version >= 1100092
55
+        if (!vm_page_reclaim_contig(fFlags, cPages, 0, VmPhysAddrHigh, uAlignment, 0))
56
+            break;
57
+#elif __FreeBSD_version >= 1000015
55
         vm_pageout_grow_cache(cTries, 0, VmPhysAddrHigh);
58
         vm_pageout_grow_cache(cTries, 0, VmPhysAddrHigh);
56
+#else
59
+#else
57
+        vm_contig_grow_cache(cTries, 0, VmPhysAddrHigh);
60
+        vm_contig_grow_cache(cTries, 0, VmPhysAddrHigh);
Lines 70-76 From Alan L. Cox on FreeBSD-current: Link Here
70
             break;
73
             break;
71
         vm_contig_grow_cache(cTries, 0, VmPhysAddrHigh);
74
         vm_contig_grow_cache(cTries, 0, VmPhysAddrHigh);
72
         cTries++;
75
         cTries++;
73
@@ -239,11 +246,8 @@
76
@@ -239,11 +249,8 @@ static vm_page_t rtR0MemObjFreeBSDContig
74
 
77
 
75
     if (!pPages)
78
     if (!pPages)
76
         return pPages;
79
         return pPages;
Lines 83-89 From Alan L. Cox on FreeBSD-current: Link Here
83
     for (vm_pindex_t iPage = 0; iPage < cPages; iPage++)
86
     for (vm_pindex_t iPage = 0; iPage < cPages; iPage++)
84
     {
87
     {
85
         vm_page_t pPage = pPages + iPage;
88
         vm_page_t pPage = pPages + iPage;
86
@@ -255,13 +259,9 @@
89
@@ -255,13 +262,9 @@ static vm_page_t rtR0MemObjFreeBSDContig
87
             atomic_add_int(&cnt.v_wire_count, 1);
90
             atomic_add_int(&cnt.v_wire_count, 1);
88
         }
91
         }
89
     }
92
     }
Lines 97-103 From Alan L. Cox on FreeBSD-current: Link Here
97
 }
100
 }
98
 
101
 
99
 static int rtR0MemObjFreeBSDPhysAllocHelper(vm_object_t pObject, u_long cPages,
102
 static int rtR0MemObjFreeBSDPhysAllocHelper(vm_object_t pObject, u_long cPages,
100
@@ -291,11 +291,15 @@
103
@@ -291,11 +294,15 @@ static int rtR0MemObjFreeBSDPhysAllocHel
101
             while (iPage-- > 0)
104
             while (iPage-- > 0)
102
             {
105
             {
103
                 pPage = vm_page_lookup(pObject, iPage);
106
                 pPage = vm_page_lookup(pObject, iPage);
Lines 113-119 From Alan L. Cox on FreeBSD-current: Link Here
113
             }
116
             }
114
 #if __FreeBSD_version >= 1000030
117
 #if __FreeBSD_version >= 1000030
115
             VM_OBJECT_WUNLOCK(pObject);
118
             VM_OBJECT_WUNLOCK(pObject);
116
@@ -743,7 +747,12 @@
119
@@ -743,7 +750,12 @@ DECLHIDDEN(int) rtR0MemObjNativeMapUser(
117
     {
120
     {
118
         /** @todo: is this needed?. */
121
         /** @todo: is this needed?. */
119
         PROC_LOCK(pProc);
122
         PROC_LOCK(pProc);

Return to bug 205452