Module Name: src
Committed By: maxv
Date: Sat May 7 12:45:56 UTC 2016
Modified Files:
src/sys/arch/amd64/conf: kern.ldscript
Removed Files:
src/sys/arch/amd64/conf: kern.ldscript.2MB largepages.inc
Log Message:
Large pages are supported by default for the text+rodata segments. Apply
the proper alignment for the data segment, so that more pages can benefit
from it. Reduces TLB contention.
kern.ldscript.2MB and largepages.inc are useless.
To generate a diff of this commit:
cvs rdiff -u -r1.16 -r1.17 src/sys/arch/amd64/conf/kern.ldscript
cvs rdiff -u -r1.11 -r0 src/sys/arch/amd64/conf/kern.ldscript.2MB
cvs rdiff -u -r1.4 -r0 src/sys/arch/amd64/conf/largepages.inc
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/arch/amd64/conf/kern.ldscript
diff -u src/sys/arch/amd64/conf/kern.ldscript:1.16 src/sys/arch/amd64/conf/kern.ldscript:1.17
--- src/sys/arch/amd64/conf/kern.ldscript:1.16 Sat Nov 14 14:01:23 2015
+++ src/sys/arch/amd64/conf/kern.ldscript Sat May 7 12:45:55 2016
@@ -1,7 +1,15 @@
-/* $NetBSD: kern.ldscript,v 1.16 2015/11/14 14:01:23 maxv Exp $ */
+/* $NetBSD: kern.ldscript,v 1.17 2016/05/07 12:45:55 maxv Exp $ */
#include "assym.h"
+/*
+ * PAE is enabled by default on amd64, the large page size is therefore
+ * 2MB (and not 4MB!).
+ */
+
+__PAGE_SIZE = 0x1000 ;
+__LARGE_PAGE_SIZE = 0x200000 ;
+
ENTRY(_start)
SECTIONS
{
@@ -22,10 +30,11 @@ SECTIONS
}
/*
- * Adjust the address for the data segment. We want to adjust up to
- * the same address within the page on the next page up.
+ * Push the data segment up to the next large page boundary so that we
+ * can map the text+rodata segments with large pages.
*/
- . = ALIGN(0x100000) + (. & (0x100000 - 1));
+ . = ALIGN(__LARGE_PAGE_SIZE);
+
__data_start = . ;
.data :
{