summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorvisa <visa@openbsd.org>2016-12-17 11:17:56 +0000
committervisa <visa@openbsd.org>2016-12-17 11:17:56 +0000
commit252f28ff84482c4cdfc004a2566a52b6a116449c (patch)
tree894a83570cacc5e4e20007a67bc6166b7170648f
parentAdd new device xp(4), preliminary support for LUNA's I/O processor. (diff)
downloadwireguard-openbsd-252f28ff84482c4cdfc004a2566a52b6a116449c.tar.xz
wireguard-openbsd-252f28ff84482c4cdfc004a2566a52b6a116449c.zip
On some systems, the firmware advertises multiple tiny and disjoint
regions of free memory whose size is no more than a few page frames. Ignore them in order not to clutter uvm with fragments.
-rw-r--r--sys/arch/octeon/octeon/machdep.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/sys/arch/octeon/octeon/machdep.c b/sys/arch/octeon/octeon/machdep.c
index 9d97e275f5e..0ecde24d617 100644
--- a/sys/arch/octeon/octeon/machdep.c
+++ b/sys/arch/octeon/octeon/machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: machdep.c,v 1.79 2016/11/26 15:42:03 martijn Exp $ */
+/* $OpenBSD: machdep.c,v 1.80 2016/12/17 11:17:56 visa Exp $ */
/*
* Copyright (c) 2009, 2010 Miodrag Vallat.
@@ -197,6 +197,10 @@ octeon_memory_init(struct boot_info *boot_info)
if (fp >= lp)
continue;
+ /* Skip small fragments. */
+ if (lp - fp < atop(1u << 20))
+ continue;
+
mem_layout[i].mem_first_page = fp;
mem_layout[i].mem_last_page = lp;
i++;