Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(1383)

Issue 7569043: code review 7569043: runtime: integrated network poller for darwin (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
11 years, 1 month ago by dvyukov
Modified:
11 years, 1 month ago
Reviewers:
minux1
CC:
golang-dev, bradfitz, dho, mikio, iant, rsc, pabuhr
Visibility:
Public.

Description

runtime: integrated network poller for darwin vs tip: benchmark old ns/op new ns/op delta BenchmarkTCP4Persistent 67786 33175 -51.06% BenchmarkTCP4Persistent-2 49085 31227 -36.38% BenchmarkTCP4PersistentTimeout 69265 32565 -52.98% BenchmarkTCP4PersistentTimeout-2 49217 32588 -33.79% vs old scheduler: benchmark old ns/op new ns/op delta BenchmarkTCP4Persistent 63517 33175 -47.77% BenchmarkTCP4Persistent-2 54760 31227 -42.97% BenchmarkTCP4PersistentTimeout 63234 32565 -48.50% BenchmarkTCP4PersistentTimeout-2 56956 32588 -42.78%

Patch Set 1 #

Patch Set 2 : diff -r 790eddf30d5d https://dvyukov%40google.com@code.google.com/p/go/ #

Patch Set 3 : diff -r 220ad1fe57ad https://dvyukov%40google.com@code.google.com/p/go/ #

Patch Set 4 : diff -r 220ad1fe57ad https://dvyukov%40google.com@code.google.com/p/go/ #

Patch Set 5 : diff -r fa80d4256029 https://dvyukov%40google.com@code.google.com/p/go/ #

Patch Set 6 : diff -r fa80d4256029 https://dvyukov%40google.com@code.google.com/p/go/ #

Patch Set 7 : diff -r 5b76706b55af https://dvyukov%40google.com@code.google.com/p/go/ #

Patch Set 8 : diff -r 5b76706b55af https://dvyukov%40google.com@code.google.com/p/go/ #

Patch Set 9 : diff -r 5b76706b55af https://dvyukov%40google.com@code.google.com/p/go/ #

Total comments: 6

Patch Set 10 : diff -r 1da9617aaae9 https://dvyukov%40google.com@code.google.com/p/go/ #

Total comments: 17

Patch Set 11 : diff -r fceb4b7359ef https://dvyukov%40google.com@code.google.com/p/go/ #

Patch Set 12 : diff -r fceb4b7359ef https://dvyukov%40google.com@code.google.com/p/go/ #

Total comments: 4

Patch Set 13 : diff -r dfbaf2b999a6 https://dvyukov%40google.com@code.google.com/p/go/ #

Patch Set 14 : diff -r dfbaf2b999a6 https://dvyukov%40google.com@code.google.com/p/go/ #

Patch Set 15 : diff -r dfbaf2b999a6 https://dvyukov%40google.com@code.google.com/p/go/ #

Patch Set 16 : diff -r dfbaf2b999a6 https://dvyukov%40google.com@code.google.com/p/go/ #

Patch Set 17 : diff -r dfbaf2b999a6 https://dvyukov%40google.com@code.google.com/p/go/ #

Patch Set 18 : diff -r dfbaf2b999a6 https://dvyukov%40google.com@code.google.com/p/go/ #

Total comments: 2

Patch Set 19 : diff -r dfbaf2b999a6 https://dvyukov%40google.com@code.google.com/p/go/ #

Patch Set 20 : diff -r dfbaf2b999a6 https://dvyukov%40google.com@code.google.com/p/go/ #

Patch Set 21 : diff -r dfbaf2b999a6 https://dvyukov%40google.com@code.google.com/p/go/ #

Total comments: 3

Patch Set 22 : diff -r fed789ce8072 https://dvyukov%40google.com@code.google.com/p/go/ #

Patch Set 23 : diff -r fed789ce8072 https://dvyukov%40google.com@code.google.com/p/go/ #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+705 lines, -133 lines) Patch
R src/pkg/net/fd_darwin.go View 1 2 1 chunk +0 lines, -126 lines 0 comments Download
A src/pkg/net/fd_poll_runtime.go View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 chunk +119 lines, -0 lines 0 comments Download
M src/pkg/net/fd_poll_unix.go View 1 2 3 4 10 11 12 13 14 15 16 1 chunk +1 line, -1 line 0 comments Download
M src/pkg/runtime/defs_darwin.go View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 5 chunks +18 lines, -2 lines 0 comments Download
M src/pkg/runtime/defs_darwin_386.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 8 chunks +28 lines, -2 lines 0 comments Download
M src/pkg/runtime/defs_darwin_amd64.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 8 chunks +28 lines, -2 lines 0 comments Download
A src/pkg/runtime/netpoll.goc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 1 chunk +346 lines, -0 lines 0 comments Download
A src/pkg/runtime/netpoll_kqueue.c View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 chunk +96 lines, -0 lines 1 comment Download
M src/pkg/runtime/netpoll_stub.c View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 1 chunk +2 lines, -0 lines 0 comments Download
M src/pkg/runtime/runtime.h View 1 2 3 4 5 6 7 8 9 10 2 chunks +4 lines, -0 lines 0 comments Download
M src/pkg/runtime/sys_darwin_386.s View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +29 lines, -0 lines 0 comments Download
M src/pkg/runtime/sys_darwin_amd64.s View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +34 lines, -0 lines 0 comments Download

Messages

Total messages: 40
dvyukov
Hello golang-dev@googlegroups.com, I'd like you to review this change to https://dvyukov%40google.com@code.google.com/p/go/
11 years, 1 month ago (2013-03-07 23:41:59 UTC) #1
dvyukov
It's faster due to several reasons: 1. Uses edge-triggered notifications, arm kevent only once per ...
11 years, 1 month ago (2013-03-07 23:48:47 UTC) #2
bradfitz
This will be useful for everybody who runs servers on Macs. On Thu, Mar 7, ...
11 years, 1 month ago (2013-03-07 23:49:36 UTC) #3
dvyukov
On 2013/03/07 23:49:36, bradfitz wrote: > This will be useful for everybody who runs servers ...
11 years, 1 month ago (2013-03-07 23:56:16 UTC) #4
bradfitz
On Thu, Mar 7, 2013 at 3:56 PM, <dvyukov@google.com> wrote: > On 2013/03/07 23:49:36, bradfitz ...
11 years, 1 month ago (2013-03-07 23:59:25 UTC) #5
dvyukov
Platform-specific part is quite small, see the similar change for linux: https://codereview.appspot.com/7579044/diff/2001/src/pkg/runtime/netpoll_linux.c
11 years, 1 month ago (2013-03-07 23:59:56 UTC) #6
dvyukov
Peter, can you take a look at this?
11 years, 1 month ago (2013-03-08 17:25:20 UTC) #7
dvyukov
On 2013/03/08 17:25:20, dvyukov wrote: > Peter, can you take a look at this? It ...
11 years, 1 month ago (2013-03-08 17:25:56 UTC) #8
dho
2013/3/7 <dvyukov@google.com>: > On 2013/03/07 23:49:36, bradfitz wrote: >> >> This will be useful for ...
11 years, 1 month ago (2013-03-08 17:39:25 UTC) #9
dvyukov
On Fri, Mar 8, 2013 at 9:39 PM, Devon H. O'Dell <devon.odell@gmail.com> wrote: > 2013/3/7 ...
11 years, 1 month ago (2013-03-08 17:43:28 UTC) #10
dho
2013/3/8 Dmitry Vyukov <dvyukov@google.com>: > On Fri, Mar 8, 2013 at 9:39 PM, Devon H. ...
11 years, 1 month ago (2013-03-08 17:46:12 UTC) #11
mikio
go1.0.3 vs. tip w/ CL 7569043+7448048 on darwin/amd64: benchmark old ns/op new ns/op delta BenchmarkTCP4OneShot-2 ...
11 years, 1 month ago (2013-03-09 04:44:48 UTC) #12
dvyukov
On Sat, Mar 9, 2013 at 8:44 AM, <mikioh.mikioh@gmail.com> wrote: > go1.0.3 vs. tip w/ ...
11 years, 1 month ago (2013-03-09 11:34:13 UTC) #13
dvyukov
https://codereview.appspot.com/7569043/diff/22001/src/pkg/net/fd_poll_runtime.go File src/pkg/net/fd_poll_runtime.go (right): https://codereview.appspot.com/7569043/diff/22001/src/pkg/net/fd_poll_runtime.go#newcode15 src/pkg/net/fd_poll_runtime.go:15: func runtime_pollServerInit() On 2013/03/09 04:44:49, mikio wrote: > net.runtime_PollServerInit ...
11 years, 1 month ago (2013-03-09 11:40:08 UTC) #14
mikio
https://codereview.appspot.com/7569043/diff/22001/src/pkg/net/fd_poll_runtime.go File src/pkg/net/fd_poll_runtime.go (right): https://codereview.appspot.com/7569043/diff/22001/src/pkg/net/fd_poll_runtime.go#newcode15 src/pkg/net/fd_poll_runtime.go:15: func runtime_pollServerInit() ah, understood. thx. https://codereview.appspot.com/7569043/diff/22001/src/pkg/runtime/netpoll_kqueue.c File src/pkg/runtime/netpoll_kqueue.c (right): ...
11 years, 1 month ago (2013-03-09 12:23:40 UTC) #15
dvyukov
ping this holds another big piece of changes for soaking
11 years, 1 month ago (2013-03-12 08:13:42 UTC) #16
iant
https://codereview.appspot.com/7569043/diff/40001/src/pkg/runtime/netpoll.c File src/pkg/runtime/netpoll.c (right): https://codereview.appspot.com/7569043/diff/40001/src/pkg/runtime/netpoll.c#newcode14 src/pkg/runtime/netpoll.c:14: // and associate fd with PollFD. What is fd ...
11 years, 1 month ago (2013-03-12 13:55:24 UTC) #17
dvyukov
https://codereview.appspot.com/7569043/diff/40001/src/pkg/runtime/netpoll.c File src/pkg/runtime/netpoll.c (right): https://codereview.appspot.com/7569043/diff/40001/src/pkg/runtime/netpoll.c#newcode62 src/pkg/runtime/netpoll.c:62: net·runtime_pollServerInit(void) On 2013/03/12 13:55:24, iant wrote: > Why not ...
11 years, 1 month ago (2013-03-12 16:32:18 UTC) #18
rsc
On Tue, Mar 12, 2013 at 12:32 PM, <dvyukov@google.com> wrote: > > https://codereview.appspot.**com/7569043/diff/40001/src/** > pkg/runtime/netpoll.c<https://codereview.appspot.com/7569043/diff/40001/src/pkg/runtime/netpoll.c> ...
11 years, 1 month ago (2013-03-12 16:36:25 UTC) #19
iant
On 2013/03/12 16:36:25, rsc wrote: > By "put it in package net" I believe Ian ...
11 years, 1 month ago (2013-03-12 16:37:55 UTC) #20
iant
https://codereview.appspot.com/7569043/diff/40001/src/pkg/runtime/netpoll.c File src/pkg/runtime/netpoll.c (right): https://codereview.appspot.com/7569043/diff/40001/src/pkg/runtime/netpoll.c#newcode68 src/pkg/runtime/netpoll.c:68: net·runtime_pollOpen(intgo intfd, PollFD *fd, intgo errno) On 2013/03/12 16:32:18, ...
11 years, 1 month ago (2013-03-12 16:40:12 UTC) #21
dvyukov
On Tue, Mar 12, 2013 at 8:40 PM, <iant@golang.org> wrote: > > https://codereview.appspot.com/7569043/diff/40001/src/pkg/runtime/netpoll.c > File ...
11 years, 1 month ago (2013-03-12 16:47:41 UTC) #22
rsc
The overall structure seems fine. I agree with Ian's comments about names. Please update defs_darwin.go ...
11 years, 1 month ago (2013-03-12 16:50:51 UTC) #23
dvyukov
On Tue, Mar 12, 2013 at 8:47 PM, Dmitry Vyukov <dvyukov@google.com> wrote: > On Tue, ...
11 years, 1 month ago (2013-03-12 18:32:22 UTC) #24
dvyukov
On 2013/03/12 16:50:51, rsc wrote: > The overall structure seems fine. I agree with Ian's ...
11 years, 1 month ago (2013-03-12 19:54:32 UTC) #25
rsc
Try C.struct_epoll_event.
11 years, 1 month ago (2013-03-12 19:58:02 UTC) #26
dvyukov
Addressed all comments, except autogenerated defs (need darwin machine for that). Please take a look ...
11 years, 1 month ago (2013-03-12 20:17:48 UTC) #27
dvyukov
On 2013/03/12 20:17:48, dvyukov wrote: > Addressed all comments, except autogenerated defs (need darwin machine ...
11 years, 1 month ago (2013-03-12 20:20:02 UTC) #28
iant
https://codereview.appspot.com/7569043/diff/59001/src/pkg/net/fd_poll_unix.go File src/pkg/net/fd_poll_unix.go (right): https://codereview.appspot.com/7569043/diff/59001/src/pkg/net/fd_poll_unix.go#newcode5 src/pkg/net/fd_poll_unix.go:5: // +build darwin freebsd netbsd openbsd Is this +build ...
11 years, 1 month ago (2013-03-12 20:52:06 UTC) #29
dvyukov
https://codereview.appspot.com/7569043/diff/59001/src/pkg/runtime/netpoll_kqueue.c File src/pkg/runtime/netpoll_kqueue.c (right): https://codereview.appspot.com/7569043/diff/59001/src/pkg/runtime/netpoll_kqueue.c#newcode68 src/pkg/runtime/netpoll_kqueue.c:68: tp = nil; On 2013/03/12 20:52:06, iant wrote: > ...
11 years, 1 month ago (2013-03-13 12:04:24 UTC) #30
dvyukov
On 2013/03/12 20:52:06, iant wrote: > https://codereview.appspot.com/7569043/diff/59001/src/pkg/net/fd_poll_unix.go#newcode5 > src/pkg/net/fd_poll_unix.go:5: // +build darwin freebsd netbsd openbsd ...
11 years, 1 month ago (2013-03-13 13:39:40 UTC) #31
dvyukov
PTAL I've fixed all the comments netpoll now goc build tags are fixed defs are ...
11 years, 1 month ago (2013-03-13 13:41:18 UTC) #32
iant
LGTM but see if rsc has any comments. https://codereview.appspot.com/7569043/diff/84001/src/pkg/runtime/netpoll.goc File src/pkg/runtime/netpoll.goc (right): https://codereview.appspot.com/7569043/diff/84001/src/pkg/runtime/netpoll.goc#newcode147 src/pkg/runtime/netpoll.goc:147: pd->rt.arg.type ...
11 years, 1 month ago (2013-03-13 13:54:07 UTC) #33
dvyukov
On 2013/03/13 13:54:07, iant wrote: > LGTM > > but see if rsc has any ...
11 years, 1 month ago (2013-03-13 14:37:15 UTC) #34
rsc
LGTM after fixes below https://codereview.appspot.com/7569043/diff/93013/src/pkg/runtime/netpoll.goc File src/pkg/runtime/netpoll.goc (right): https://codereview.appspot.com/7569043/diff/93013/src/pkg/runtime/netpoll.goc#newcode99 src/pkg/runtime/netpoll.goc:99: return; Because of the way ...
11 years, 1 month ago (2013-03-13 16:52:56 UTC) #35
dvyukov
On 2013/03/13 16:52:56, rsc wrote: > LGTM after fixes below > > https://codereview.appspot.com/7569043/diff/93013/src/pkg/runtime/netpoll.goc > File ...
11 years, 1 month ago (2013-03-14 06:38:11 UTC) #36
dvyukov
*** Submitted as https://code.google.com/p/go/source/detail?r=5af2130aec77 *** runtime: integrated network poller for darwin vs tip: benchmark old ...
11 years, 1 month ago (2013-03-14 06:48:14 UTC) #37
minux1
https://codereview.appspot.com/7569043/diff/104001/src/pkg/runtime/netpoll_kqueue.c File src/pkg/runtime/netpoll_kqueue.c (right): https://codereview.appspot.com/7569043/diff/104001/src/pkg/runtime/netpoll_kqueue.c#newcode40 src/pkg/runtime/netpoll_kqueue.c:40: ev[0].flags = EV_ADD|EV_RECEIPT|EV_CLEAR; Of all the *BSDs out there, ...
11 years, 1 month ago (2013-03-17 21:24:28 UTC) #38
pabuhr
Peter, can you take a look at this? Hey Dmitry, I did see this message ...
11 years, 1 month ago (2013-03-18 03:20:42 UTC) #39
dvyukov
11 years, 1 month ago (2013-03-18 04:10:37 UTC) #40
On Mon, Mar 18, 2013 at 7:20 AM, Peter Buhr <pabuhr@google.com> wrote:
>     Peter, can you take a look at this?
>
> Hey Dmitry, I did see this message go by about a week ago, but I though you
> were
> referring to the other "Peter" on the Go team. So I ignored it. ;-)
>
> I'm still learning a LOT about stuff here at Google and with the Go team. I
> know it's late,
> but I'll try to look through the code this week, and see if I can generate
> any useful comments.
>
> Sorry about the misunderstanding, and thank you can asking me to look at the
> code.


Useful comments are never late :)

There are still some open questions:
- whether kqueue needs explicit fd unregistration (as epoll)?
- how to port kqueue to darwin/freebsd/netbsd/openbsd?
- is edge-triggered IO a good idea here?
- why my rblock idea
(https://codereview.appspot.com/7326051/diff/10002/src/pkg/net/fd_linux_amd64.go
line 260) does not work on linux in some conditions?
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b