Page MenuHomeFreeBSD

D60936.1794715561.diff
No OneTemporary

Authored By
Unknown
Size
1 KB
Referenced Files
None
Subscribers
None

D60936.1794715561.diff

diff --git a/sys/vm/vm_phys.c b/sys/vm/vm_phys.c
--- a/sys/vm/vm_phys.c
+++ b/sys/vm/vm_phys.c
@@ -2015,6 +2015,7 @@
* Now find biggest physical segment in within the desired
* numa domain.
*/
+search:
biggestsize = 0;
biggestone = 0;
for (i = 0; phys_avail[i + 1] != 0; i += 2) {
@@ -2028,6 +2029,23 @@
biggestsize = size;
}
}
+ /*
+ * The search above was constrained to the domain's biggest SRAT
+ * range. If phys_avail has no segment there that can hold the
+ * allocation (with the natural alignment applied below for large
+ * allocations), search all of phys_avail rather than panic: the
+ * range may be mostly unusable, e.g. when hw.physmem is set or a
+ * hypervisor reserves it.
+ */
+ if (mem_start != 0 || mem_end != (vm_paddr_t)-1) {
+ size = round_page(alloc_size);
+ if (biggestsize < size || (size > PAGE_SIZE && size +
+ (phys_avail[biggestone + 1] & (size - 1)) > biggestsize)) {
+ mem_start = 0;
+ mem_end = -1;
+ goto search;
+ }
+ }
alloc_size = round_page(alloc_size);
/*

File Metadata

Mime Type
text/plain
Expires
Sun, Nov 15, 4:06 AM (20 h, 6 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
41206367
Default Alt Text
D60936.1794715561.diff (1 KB)

Event Timeline