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

runtime: squeeze Hchan into 64 bytes #8901

Open
dvyukov opened this Issue Oct 7, 2014 · 2 comments

Comments

Projects
None yet
3 participants
@dvyukov
Member

dvyukov commented Oct 7, 2014

Currently Hchan is 12 words (on 64-bit machine). It would be nice to squeeze it into 8
words. First it's just memory consumption reduction, and second it will be exactly cache
line (and due to malloc alignment, it will be also cache line aligned) which will
speedup contented synchronization - ping-pong only one line instead of two + no false
sharing.

elemtype goes away as it is not needed.
dataqsiz is a derivative of qcount/sendx/recvx, so it just goes away as well.
recvq/sendq can be reduced to 1 pointer to a head of doubly-linked cycle of waiters.
This gives exactly 8 words.

FTR, here is a CL that lowers OCAP/OLEN for chans into runtime calls (necessary to
remove dataqsiz):
https://golang.org/cl/54570046/
@rsc

This comment has been minimized.

Contributor

rsc commented Oct 7, 2014

Comment 1:

Labels changed: added release-go1.5, removed release-none.

@bradfitz bradfitz modified the milestone: Go1.5 Dec 16, 2014

@bradfitz bradfitz removed the release-go1.5 label Dec 16, 2014

@rsc rsc removed accepted labels Apr 14, 2015

@rsc

This comment has been minimized.

Contributor

rsc commented Jun 8, 2015

Too late for Go 1.5.

@rsc rsc modified the milestones: Unplanned, Go1.5 Jun 8, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment