Skip to content

runtime: handle page sizes other than 4096 properly #8495

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
davecheney opened this issue Aug 8, 2014 · 3 comments
Closed

runtime: handle page sizes other than 4096 properly #8495

davecheney opened this issue Aug 8, 2014 · 3 comments
Milestone

Comments

@davecheney
Copy link
Contributor

This is a placeholder issue to ensure that platforms that don't use 4096 page sizes are
properly handled.

The specific use case is ppc64 which can have page sizes other than 4k, see
https://code.google.com/p/gofrontend/source/detail?r=986b937904fd9768c40948ece0bc233b441abb98
@davecheney
Copy link
Contributor Author

Comment 1:

I just caught this problem in action on a ppc64le box with a 64k page size
open("/home/ubuntu/go/src/cmd/go/bootstrap.go", O_RDONLY|O_CLOEXEC) = 3
mmap(0xc208400000, 1048576, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) =
0xc208400000
mmap(0xc207fb0000, 65536, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) =
0xc207fb0000
mmap(0xc000001000, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) =
0x3fff87440000
munmap(0x3fff87440000, 4096)            = 0
mincore(0xc000001000, 4096, 0x516685)   = -1 EINVAL (Invalid argument)
write(2, "runtime: address space conflict:"..., 37runtime: address space conflict: map()
= 37
write(2, "0xc000001000", 120xc000001000)            = 12
write(2, ") = ", 4) = )                     = 4
write(2, "0x0", 30x0)                      = 3
write(2, "\n", 1
)                       = 1
$ getconf PAGESIZE
65536
This little tweak (as discussed offline) 
diff -r b6784924c5eb src/pkg/runtime/arch_power64le.h
--- a/src/pkg/runtime/arch_power64le.h  Wed Aug 13 18:32:54 2014 -0400
+++ b/src/pkg/runtime/arch_power64le.h  Thu Aug 14 09:56:15 2014 +0000
@@ -7,7 +7,7 @@
        BigEndian = 0,
        CacheLineSize = 64,
        RuntimeGogoBytes = 84,
-       PhysPageSize = 4096,
+       PhysPageSize = 65536,
        PCQuantum = 4,
        Int64Align = 8
 };
passed ./make.bash

@gopherbot
Copy link
Contributor

Comment 2:

CL https://golang.org/cl/123520043 mentions this issue.

@davecheney
Copy link
Contributor Author

Comment 3:

This issue was closed by revision f9fdc88.

Status changed to Fixed.

@rsc rsc added this to the Go1.4 milestone Apr 14, 2015
@rsc rsc removed the release-go1.4 label Apr 14, 2015
@golang golang locked and limited conversation to collaborators Jun 25, 2016
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants