• Austin Clements's avatar
    runtime: assume 64kB physical pages on ARM · d7de8b6d
    Austin Clements authored
    Currently we assume the physical page size on ARM is 4kB. While this
    is usually true, the architecture also supports 16kB and 64kB physical
    pages, and Linux (and possibly other OSes) can be configured to use
    these larger page sizes.
    
    With Go 1.6, such a configuration could potentially run, but generally
    resulted in memory corruption or random panics. With current master,
    this configuration will cause the runtime to panic during init on
    Linux when it checks the true physical page size (and will still cause
    corruption or panics on other OSes).
    
    However, the assumed physical page size only has to be a multiple of
    the true physical page size, the scavenger can now deal with large
    physical page sizes, and the rest of the runtime can deal with a
    larger assumed physical page size than the true size. Hence, there's
    little disadvantage to conservatively setting the assumed physical
    page size to 64kB on ARM.
    
    This may result in some extra memory use, since we can only return
    memory at multiples of the assumed physical page size. However, it is
    a simple change that should make Go run on systems configured for
    larger page sizes. The following commits will make the runtime query
    the actual physical page size from the OS, but this is a simple step
    there.
    
    Updates #12480.
    
    Change-Id: I851829595bc9e0c76235c847a7b5f62ad82b5302
    Reviewed-on: https://go-review.googlesource.com/25021
    Run-TryBot: Austin Clements <austin@google.com>
    TryBot-Result: Gobot Gobot <gobot@golang.org>
    Reviewed-by: 's avatarMinux Ma <minux@golang.org>
    d7de8b6d
Name
Last commit
Last update
..
archive Loading commit data...
bufio Loading commit data...
builtin Loading commit data...
bytes Loading commit data...
cmd Loading commit data...
compress Loading commit data...
container Loading commit data...
context Loading commit data...
crypto Loading commit data...
database/sql Loading commit data...
debug Loading commit data...
encoding Loading commit data...
errors Loading commit data...
expvar Loading commit data...
flag Loading commit data...
fmt Loading commit data...
go Loading commit data...
hash Loading commit data...
html Loading commit data...
image Loading commit data...
index/suffixarray Loading commit data...
internal Loading commit data...
io Loading commit data...
log Loading commit data...
math Loading commit data...
mime Loading commit data...
net Loading commit data...
os Loading commit data...
path Loading commit data...
reflect Loading commit data...
regexp Loading commit data...
runtime Loading commit data...
sort Loading commit data...
strconv Loading commit data...
strings Loading commit data...
sync Loading commit data...
syscall Loading commit data...
testing Loading commit data...
text Loading commit data...
time Loading commit data...
unicode Loading commit data...
unsafe Loading commit data...
vendor/golang_org/x/net Loading commit data...
Make.dist Loading commit data...
all.bash Loading commit data...
all.bat Loading commit data...
all.rc Loading commit data...
androidtest.bash Loading commit data...
bootstrap.bash Loading commit data...
buildall.bash Loading commit data...
clean.bash Loading commit data...
clean.bat Loading commit data...
clean.rc Loading commit data...
cmp.bash Loading commit data...
iostest.bash Loading commit data...
make.bash Loading commit data...
make.bat Loading commit data...
make.rc Loading commit data...
naclmake.bash Loading commit data...
nacltest.bash Loading commit data...
race.bash Loading commit data...
race.bat Loading commit data...
run.bash Loading commit data...
run.bat Loading commit data...
run.rc Loading commit data...