-
Notifications
You must be signed in to change notification settings - Fork 3
arm64, malloc: Support 64KB pages #148
base: merge.arm64
Are you sure you want to change the base?
arm64, malloc: Support 64KB pages #148
Conversation
On arm64 we can run with 64KB pages as well as 4KB pages. Unfortunately, the memory allocator in go assumes pages are of size 4KB and we run into problems such as: runtime: address space conflict: map(0x4000001000) = 0x3ff7e090000 fatal error: runtime: address space conflict This patch increases the _PageShift to 16 for arm64 and also beefs up the _StackCacheSize to one page for arm64. I have tested this patch on an AMD Seattle system running 64KB pages and 4.0-rc5 kernel as well as an APM Mustang system running 4KB pages and 3.19 kernel. I don't know why this hasn't arisen in PowerPC, perhaps a lucky set of addresses back from mmap? Perhaps this patch could be extended for PowerPC too if need be? Signed-off-by: Steve Capper <steve.capper@linaro.org>
@@ -104,7 +104,7 @@ const ( | |||
) | |||
|
|||
const ( | |||
_PageShift = 13 | |||
_PageShift = 13 * (1 - goarch_arm64) + 16 * goarch_arm64 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we don't need to change this. The runtime "page" is independent of
the physical page size. just chaning _PhysPageSize should be ok.
Thanks for taking a pass on this, it's not really enough, some more bits are missing, but thanks. |
Steve, would you be able to contribute a 64k page size builder to the build
dashboard, build.golang.org ?
|
Hi guys, thanks for your feedback. I'll step back to testing :-). |
Start here, https://github.com/golang/go/wiki/DashboardBuilders email bradfitz@golang.org for a builder key, let me know if you get stuck On Sat, Mar 28, 2015 at 2:17 AM, stevecapperlinaro <notifications@github.com
|
Hi,
This is my attempt to fix the issues I was having running go on 64KB pages on my Seattle board, #147 . As is evident from my patch, I am not a go programmer ;-). Please do tidy this up if it needs it. Also, if there is already a 64KB fix out there that I've missed, then please sling it my way and I would be happy to test it here.
Cheers,
Steve
On arm64 we can run with 64KB pages as well as 4KB pages.
Unfortunately, the memory allocator in go assumes pages are of size 4KB
and we run into problems such as:
runtime: address space conflict: map(0x4000001000) = 0x3ff7e090000
fatal error: runtime: address space conflict
This patch increases the _PageShift to 16 for arm64 and also beefs up
the _StackCacheSize to one page for arm64.
I have tested this patch on an AMD Seattle system running 64KB pages
and 4.0-rc5 kernel as well as an APM Mustang system running 4KB pages
and 3.19 kernel.
I don't know why this hasn't arisen in PowerPC, perhaps a lucky set
of addresses back from mmap? Perhaps this patch could be extended for
PowerPC too if need be?
Signed-off-by: Steve Capper steve.capper@linaro.org