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 return actual system value on Solaris #12558

Closed
binarycrusader opened this issue Sep 10, 2015 · 9 comments
Closed
Milestone

Comments

@binarycrusader
Copy link
Contributor

As noted in #12076 Getpagesize doesn't currently return the actual system's default page size, but rather a hard-coded value. Per the discussion with @ianlancetaylor on golang-dev [1], the opinion was that syscall.Getpagesize should return the same value as the POSIX call sysconf(_SC_PAGESIZE).

This change will be necessary for future platform support on Solaris.

While this change could be generally applied (more than likely) to all other POSIX platforms, I'm only planning on making this change for Solaris for now.

This issue is being filed to track the change against golang/go separately from x/sys/unix.

While it may be viewed as related to #10180, I believe it can be resolved independently.

[1] https://groups.google.com/forum/#!topic/golang-dev/ZLzxYzULzU8

@minux
Copy link
Member

minux commented Sep 10, 2015 via email

@davecheney
Copy link
Contributor

@minux agreed, having syscall and runtime return different values is an accident waiting to happen.

@binarycrusader
Copy link
Contributor Author

/CC @4ad

@ianlancetaylor ianlancetaylor added this to the Go1.6 milestone Sep 10, 2015
@minux
Copy link
Member

minux commented Sep 10, 2015 via email

@gopherbot
Copy link

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

@binarycrusader
Copy link
Contributor Author

Your CL is fine for x/sys/unix (#12076). But for the main repo, we need to update runtime and make syscall and runtime using the same page size.

Like I said, I'm going off what Ian told me, so I'll let all of you work things out.

For the record though, if the runtime does not return the same pagesize as what sysconf(_SC_PAGESIZE) returns, that's going to be a problem too.

@4ad
Copy link
Member

4ad commented Sep 10, 2015

I agree, this is fine for x/sys/unix, but for syscall is not the right thing. It has to involve the runtime, and it's not just making the runtime call this function either. Unfortunately, the runtime doesn't work well with big page sizes. We should fix #10180, plus any other bugs that linger in the runtime, like #9993 and #11933 (some of them have been fixed, but they're just symptoms of a larger problem).

In particular, we need to make the runtime work with multiple dynamic page sizes.

@binarycrusader
Copy link
Contributor Author

@4ad on Solaris, the runtime may not have a choice about whether or not big pages are used. In particular, on SPARC systems, much larger page sizes may be used by default as very large SPARC systems are already at a max of 32 terabytes of memory and I imagine that will increase in the future.

If this change should not be made for syscall today, should I close this issue as a duplicate of #10180 then?

@binarycrusader
Copy link
Contributor Author

I'm going to close this with the assumption that it's a duplicate of #10180.

@golang golang locked and limited conversation to collaborators Sep 22, 2016
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

6 participants