{"action":"created","issue":{"url":"https://api.github.com/repos/golang/go/issues/25625","repository_url":"https://api.github.com/repos/golang/go","labels_url":"https://api.github.com/repos/golang/go/issues/25625/labels{/name}","comments_url":"https://api.github.com/repos/golang/go/issues/25625/comments","events_url":"https://api.github.com/repos/golang/go/issues/25625/events","html_url":"https://github.com/golang/go/issues/25625","id":327339423,"number":25625,"title":"runtime: performance scaling degradation in some Chan benchmarks when futexes became private ","user":{"login":"laboger","id":9433228,"avatar_url":"https://avatars1.githubusercontent.com/u/9433228?v=4","gravatar_id":"","url":"https://api.github.com/users/laboger","html_url":"https://github.com/laboger","followers_url":"https://api.github.com/users/laboger/followers","following_url":"https://api.github.com/users/laboger/following{/other_user}","gists_url":"https://api.github.com/users/laboger/gists{/gist_id}","starred_url":"https://api.github.com/users/laboger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/laboger/subscriptions","organizations_url":"https://api.github.com/users/laboger/orgs","repos_url":"https://api.github.com/users/laboger/repos","events_url":"https://api.github.com/users/laboger/events{/privacy}","received_events_url":"https://api.github.com/users/laboger/received_events","type":"User","site_admin":false},"labels":[{"id":373402289,"url":"https://api.github.com/repos/golang/go/labels/NeedsInvestigation","name":"NeedsInvestigation","color":"ededed","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/golang/go/milestones/62","html_url":"https://github.com/golang/go/milestone/62","labels_url":"https://api.github.com/repos/golang/go/milestones/62/labels","id":2827591,"number":62,"title":"Go1.11","description":"","creator":{"login":"rsc","id":104030,"avatar_url":"https://avatars1.githubusercontent.com/u/104030?v=4","gravatar_id":"","url":"https://api.github.com/users/rsc","html_url":"https://github.com/rsc","followers_url":"https://api.github.com/users/rsc/followers","following_url":"https://api.github.com/users/rsc/following{/other_user}","gists_url":"https://api.github.com/users/rsc/gists{/gist_id}","starred_url":"https://api.github.com/users/rsc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/rsc/subscriptions","organizations_url":"https://api.github.com/users/rsc/orgs","repos_url":"https://api.github.com/users/rsc/repos","events_url":"https://api.github.com/users/rsc/events{/privacy}","received_events_url":"https://api.github.com/users/rsc/received_events","type":"User","site_admin":false},"open_issues":639,"closed_issues":492,"state":"open","created_at":"2017-10-10T13:39:17Z","updated_at":"2018-05-30T06:55:59Z","due_on":"2018-07-31T07:00:00Z","closed_at":null},"comments":4,"created_at":"2018-05-29T14:13:00Z","updated_at":"2018-05-30T12:37:53Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"### What version of Go are you using (`go version`)?\r\ntip\r\n\r\n### Does this issue reproduce with the latest release?\r\nyes\r\n\r\n### What operating system and processor architecture are you using (`go env`)?\r\nppc64le, not sure about others\r\n\r\n### What did you do?\r\nIn comparing performance for some package benchmarks using latest against 1.10, it was noted that some of the runtime Chan benchmarks degraded by 2-4X. The degradation was tracked down to the change where futexes became private.\r\n\r\n07751f4 runtime: use private futexes on Linux\r\n\r\n### What did you expect to see?\r\nNo significant change.\r\n\r\n### What did you see instead?\r\nSignificant degradation in the following:\r\n```\r\nBenchmarkChanSem-16                                         397             1925            +384.89%\r\nBenchmarkChanProdCons100-16                                 603             2571            +326.37%\r\nBenchmarkChanContended-16                                   51225           215813          +321.30%\r\nBenchmarkChanProdCons10-16                                  797             3256            +308.53%\r\nBenchmarkChanProdCons0-16                                   1288            4279            +232.22%\r\nBenchmarkChanProdConsWork10-16                              1133            3692            +225.86%\r\nBenchmarkChanProdConsWork100-16                             1049            3293            +213.92%\r\nBenchmarkChanProdConsWork0-16                               1573            4261            +170.88%\r\nBenchmarkChanPopular-16                                     2335795         4591414         +96.57%\r\n```\r\nThe degradation is worse with higher values of GOMAXPROCS when comparing go 1.10 against latest.\r\n\r\nAccording the to profiles, more time spent in the atomic.Xchg statements in the lock function in runtime/lock_futex.go after change to make futexes private, less time spent in the futex.\r\n\r\n@ianlancetaylor "},"comment":{"url":"https://api.github.com/repos/golang/go/issues/comments/393145432","html_url":"https://github.com/golang/go/issues/25625#issuecomment-393145432","issue_url":"https://api.github.com/repos/golang/go/issues/25625","id":393145432,"user":{"login":"laboger","id":9433228,"avatar_url":"https://avatars1.githubusercontent.com/u/9433228?v=4","gravatar_id":"","url":"https://api.github.com/users/laboger","html_url":"https://github.com/laboger","followers_url":"https://api.github.com/users/laboger/followers","following_url":"https://api.github.com/users/laboger/following{/other_user}","gists_url":"https://api.github.com/users/laboger/gists{/gist_id}","starred_url":"https://api.github.com/users/laboger/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/laboger/subscriptions","organizations_url":"https://api.github.com/users/laboger/orgs","repos_url":"https://api.github.com/users/laboger/repos","events_url":"https://api.github.com/users/laboger/events{/privacy}","received_events_url":"https://api.github.com/users/laboger/received_events","type":"User","site_admin":false},"created_at":"2018-05-30T12:37:53Z","updated_at":"2018-05-30T12:37:53Z","author_association":"CONTRIBUTOR","body":"Here are the results comparing latest with and without setting futex to private. I also reverted back to the way benchmark timings are done with count > 1 (https://github.com/golang/go/issues/25622) to avoid flaky results.\r\n\r\nold = latest\r\nnew = futex not private\r\nIn both cases, I changed testing/benchmark.go to avoid using hintN on the launch function.\r\n```\r\nname                    old time/op  new time/op   delta\r\n\r\nChanNonblocking-16      1.46ns ±29%   1.33ns ±26%     ~     (p=0.257 n=4+4)\r\nChanUncontended-16       927ns ± 8%    918ns ± 2%     ~     (p=0.771 n=4+4)\r\nChanContended-16         209µs ± 2%     38µs ± 3%  -82.01%  (p=0.029 n=4+4)\r\nChanSync-16              378ns ± 0%    393ns ± 1%   +3.83%  (p=0.029 n=4+4)\r\nChanSyncWork-16         9.18µs ± 7%  10.00µs ± 5%     ~     (p=0.057 n=4+4)\r\nChanProdCons0-16        4.23µs ± 2%   1.26µs ± 3%  -70.10%  (p=0.029 n=4+4)\r\nChanProdCons10-16       3.27µs ± 0%   0.64µs ± 3%  -80.40%  (p=0.029 n=4+4)\r\nChanProdCons100-16      2.45µs ± 1%   0.44µs ± 2%  -81.87%  (p=0.029 n=4+4)\r\nChanProdConsWork0-16    4.27µs ± 1%   1.58µs ± 2%  -63.05%  (p=0.029 n=4+4)\r\nChanProdConsWork10-16   3.74µs ± 1%   1.07µs ± 1%  -71.38%  (p=0.029 n=4+4)\r\nChanProdConsWork100-16  3.32µs ± 0%   0.96µs ± 1%  -71.03%  (p=0.029 n=4+4)\r\nChanCreation-16         90.6ns ± 5%   85.5ns ± 8%     ~     (p=0.200 n=4+4)\r\nChanSem-16              1.76µs ± 1%   0.39µs ± 1%  -77.78%  (p=0.029 n=4+4)\r\nChanPopular-16          4.63ms ± 2%   2.37ms ± 0%  -48.87%  (p=0.029 n=4+4)\r\n```\r\n"}}
{"actor":{"display_login":"laboger"}}