Skip to content

runtime: high system time in openbsd #3311

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
gopherbot opened this issue Mar 13, 2012 · 6 comments
Closed

runtime: high system time in openbsd #3311

gopherbot opened this issue Mar 13, 2012 · 6 comments

Comments

@gopherbot
Copy link
Contributor

by yourcomputerpal:

Before filing a bug, please check whether it has been fixed since
the latest release: run "hg pull", "hg update default", rebuild, and
retry
what you did to
reproduce the problem.  Thanks.

What steps will reproduce the problem?
1. Observe initial CPU utilization
2. run godoc -http=:6060
3. Observe System CPU utilization 

What is the expected output?
I'd expect to see slight cpu utilization to run the process, perhaps higher on startup. 

What do you see instead?
I see sustained System cpu utilization in the 80% range even while no requests are being
handled. 


Which compiler are you using (5g, 6g, 8g, gccgo)?
6g


Which operating system are you using?
OpenBSD amd64

Which revision are you using?  (hg identify)
2594f4a8314e+ tip

Please provide any additional information below.
I ran a ktrace on this and found gettimeofday() being called tens of thousands of times
a second. This seems similar to the issue that ruby had a while ago.
@rsc
Copy link
Contributor

rsc commented Mar 13, 2012

Comment 1:

Maybe osyield doesn't work, or maybe sleep doesn't work.
Can wait until after Go 1: OpenBSD is not on our supported list.

Labels changed: added priority-later, removed priority-triage.

Owner changed to builder@golang.org.

Status changed to Accepted.

@gopherbot
Copy link
Contributor Author

Comment 2 by yourcomputerpal:

Very well. So what you're saying is that it isn't a desired or common behavior that
gettimeofday() would be called that frequently if osyield or sleep was implemented and
working properly?

@rsc
Copy link
Contributor

rsc commented Mar 13, 2012

Comment 3:

I am saying that if I were debugging this, that's where I would start.

@4a6f656c
Copy link
Contributor

Comment 4:

Unfortunately, you do not specify which version of OpenBSD you are running, however if
you are running a snapshot that is newer than 1st January 2012, you will be hitting a
problem that is caused by a change to the function signatures for thrsleep (an
additional argument was added to some thread related syscalls in r1.120 of
sys/kern/syscalls.master).
I have a change to fix this:
  http://golang.org/cl/5777079/
However, be aware that this currently includes parts of:
  http://golang.org/cl/5757064/
Since they both touch the same files.

Owner changed to @4a6f656c.

@gopherbot
Copy link
Contributor Author

Comment 5 by yourcomputerpal:

Thanks so much! This was indeed the problem... after a closer look the thrsleep() was
returning right away with a RET 4 meaning EINTR so something was waking it up... when it
woke up it checked the time of day and realized it still needed to sleep. Thanks for
this fix, it's working great on amd64. I'm a -current as well. Thank you again! Great
work. :)

@4a6f656c
Copy link
Contributor

Comment 6:

This issue was closed by revision 8cea1bf.

Status changed to Fixed.

@golang golang locked and limited conversation to collaborators Jun 24, 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