Skip to content
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

syscall: Getpagesize should consult OS on arm64 #13191

Closed
hrw opened this issue Nov 9, 2015 · 4 comments
Closed

syscall: Getpagesize should consult OS on arm64 #13191

hrw opened this issue Nov 9, 2015 · 4 comments

Comments

@hrw
Copy link

hrw commented Nov 9, 2015

There is code in src/syscall/syscall_linux_arm64.go file:

func Getpagesize() int { return 65536 }

But this architecture supports three values for PAGE_SIZE: 4K, 16K and 64K which are selected at kernel compilation time.

Userspace is expected to check which value is set. Simplest solution is to use sysconf(_SC_PAGESIZE) function call (same as getpagesize()).

@ianlancetaylor ianlancetaylor added this to the Go1.6 milestone Nov 9, 2015
@rakyll rakyll changed the title On AArch64 Getpagesize() can return wrong value syscall: on aarch64 Getpagesize() can return wrong value Nov 9, 2015
@rsc rsc changed the title syscall: on aarch64 Getpagesize() can return wrong value syscall: Getpagesize should consult OS on arm64 Nov 24, 2015
@rsc rsc modified the milestones: Unplanned, Go1.6 Dec 5, 2015
@dmcgowan
Copy link

This is causing an issue in Docker running on arm64 with the new overlay driver. We use the pagesize to determine when we the mount arguments are too large. It would be preferable to report the PageSize as the minimum value rather than the maximum to avoid unexpected truncation to syscalls.

See https://github.com/docker/docker/blob/3b0660da30a23b86a2f29f1ecf3ded52ab7fe577/daemon/graphdriver/overlay2/overlay.go#L476

@vielmetti
Copy link

Thanks @dmcgowan - good catch!

@vielmetti
Copy link

vielmetti commented Oct 19, 2016

This commit 1b9499b
looks like it addresses this problem, with the other related issue at #10180

@bradfitz
Copy link
Contributor

Oh, yeah, @aclements already did this in 1b9499b

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

7 participants