Skip to content
This repository has been archived by the owner on Dec 3, 2019. It is now read-only.

arm64, malloc: Support 64KB pages #148

Open
wants to merge 1 commit into
base: merge.arm64
Choose a base branch
from

Conversation

stevecapperlinaro
Copy link

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

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
Copy link
Collaborator

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.

@4ad
Copy link
Owner

4ad commented Mar 25, 2015

Thanks for taking a pass on this, it's not really enough, some more bits are missing, but thanks.

@davecheney
Copy link
Collaborator

davecheney commented Mar 25, 2015 via email

@stevecapperlinaro
Copy link
Author

Hi guys, thanks for your feedback. I'll step back to testing :-).
@davecheney, how does one contribute a builder? Does the machine have to be dedicated, or is it enough to schedule a job somewhere that can check in with build.golang.org?

@davecheney
Copy link
Collaborator

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

wrote:

Hi guys, thanks for your feedback. I'll step back to testing :-).
@davecheney https://github.com/davecheney, how does one contribute a
builder? Does the machine have to be dedicated, or is it enough to schedule
a job somewhere that can check in with build.golang.org?


Reply to this email directly or view it on GitHub
https://github.com/4ad/go/pull/148#issuecomment-86971542.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants