Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(731)

Issue 2910853002: [Fuchsia] EventHandler: epoll -> ports v2 (Closed)

Created:
3 years, 6 months ago by zra
Modified:
3 years, 6 months ago
Reviewers:
abarth, siva, swetland
CC:
abarth, reviews_dartlang.org, vm-dev_dartlang.org
Target Ref:
refs/heads/master
Visibility:
Public.

Description

[Fuchsia] EventHandler: epoll -> ports v2 This CL rewrites the EventHandler on Fuchsia to use the low-level ports system call API instead of the epoll() emulation in musl. This will allow the Magenta team to remove the epoll() emulation and the deprecated system call API it is based on. The new ports API doesn't provide epoll()-like edge-triggering that clients of the EventHandler expect. Therefore, this CL emulates it by adding a level of indirection through a new "IOHandle" object, which the socket code now uses instead of file descriptors. This is similar to what we do on Windows. See the comment at the top of eventhandler_fuchsia.cc for more details. Fuchsia issue US-251 R=asiva@google.com Committed: https://github.com/dart-lang/sdk/commit/bad6b64062912b3dedf80cd0c9bd9c0c0ec3bbcb

Patch Set 1 #

Patch Set 2 : WIP #

Patch Set 3 : IOHandle #

Patch Set 4 : WIP #

Patch Set 5 : Use unused signals for synthetic read/write #

Patch Set 6 : Clenaup, locking #

Patch Set 7 : Cleanup logging #

Patch Set 8 : Fix Process. hello_fuchsia passes. #

Patch Set 9 : Cleanup #

Patch Set 10 : Format #

Total comments: 2

Patch Set 11 : Use user packets instead of asserting signals #

Patch Set 12 : Call async wait directly from the Dart thread #

Total comments: 2

Patch Set 13 : Remove unused function #

Total comments: 13

Patch Set 14 : Address comments #

Patch Set 15 : Address comments #

Total comments: 2

Patch Set 16 : Fix typo #

Unified diffs Side-by-side diffs Delta from patch set Stats (+667 lines, -467 lines) Patch
M runtime/bin/eventhandler_fuchsia.h View 1 2 3 4 5 6 7 8 9 10 11 12 3 chunks +87 lines, -13 lines 0 comments Download
M runtime/bin/eventhandler_fuchsia.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 5 chunks +395 lines, -323 lines 0 comments Download
M runtime/bin/process_fuchsia.cc View 1 2 3 4 5 6 7 8 9 5 chunks +111 lines, -88 lines 0 comments Download
M runtime/bin/socket_base_fuchsia.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 8 chunks +35 lines, -26 lines 0 comments Download
M runtime/bin/socket_fuchsia.cc View 1 2 3 4 5 6 7 8 9 9 chunks +37 lines, -15 lines 0 comments Download
M runtime/bin/socket_patch.dart View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 2 chunks +2 lines, -2 lines 0 comments Download

Messages

Total messages: 23 (6 generated)
zra
3 years, 6 months ago (2017-06-19 18:06:51 UTC) #5
zra
3 years, 6 months ago (2017-06-19 18:06:52 UTC) #6
abarth
https://codereview.chromium.org/2910853002/diff/180001/runtime/bin/eventhandler_fuchsia.h File runtime/bin/eventhandler_fuchsia.h (right): https://codereview.chromium.org/2910853002/diff/180001/runtime/bin/eventhandler_fuchsia.h#newcode142 runtime/bin/eventhandler_fuchsia.h:142: static const uint64_t kInterruptPacketKey = 0xda47da47; You might as ...
3 years, 6 months ago (2017-06-19 19:02:46 UTC) #8
zra
Changed to use user packets instead of asserting user signals on handles. https://codereview.chromium.org/2910853002/diff/180001/runtime/bin/eventhandler_fuchsia.h File runtime/bin/eventhandler_fuchsia.h ...
3 years, 6 months ago (2017-06-19 21:04:28 UTC) #9
zra
Updated to call async wait directly from the Dart thread after reads and writes. PTAL.
3 years, 6 months ago (2017-06-20 21:57:16 UTC) #10
abarth
https://codereview.chromium.org/2910853002/diff/220001/runtime/bin/eventhandler_fuchsia.h File runtime/bin/eventhandler_fuchsia.h (right): https://codereview.chromium.org/2910853002/diff/220001/runtime/bin/eventhandler_fuchsia.h#newcode71 runtime/bin/eventhandler_fuchsia.h:71: mx_status_t ReadySignalsLocked(mx_signals_t* ready_signals); I didn't find any callers of ...
3 years, 6 months ago (2017-06-20 22:07:34 UTC) #11
abarth
I'm not an expert on this code, but it looks like a good direction.
3 years, 6 months ago (2017-06-20 22:07:54 UTC) #12
zra
https://codereview.chromium.org/2910853002/diff/220001/runtime/bin/eventhandler_fuchsia.h File runtime/bin/eventhandler_fuchsia.h (right): https://codereview.chromium.org/2910853002/diff/220001/runtime/bin/eventhandler_fuchsia.h#newcode71 runtime/bin/eventhandler_fuchsia.h:71: mx_status_t ReadySignalsLocked(mx_signals_t* ready_signals); On 2017/06/20 22:07:34, abarth wrote: > ...
3 years, 6 months ago (2017-06-20 22:22:27 UTC) #13
swetland
Just a note on cancel behaviour
3 years, 6 months ago (2017-06-21 00:08:55 UTC) #14
swetland
https://codereview.chromium.org/2910853002/diff/240001/runtime/bin/eventhandler_fuchsia.cc File runtime/bin/eventhandler_fuchsia.cc (right): https://codereview.chromium.org/2910853002/diff/240001/runtime/bin/eventhandler_fuchsia.cc#newcode216 runtime/bin/eventhandler_fuchsia.cc:216: if ((status != MX_OK) && (status != MX_ERR_NOT_FOUND)) { ...
3 years, 6 months ago (2017-06-21 00:09:51 UTC) #15
siva
https://codereview.chromium.org/2910853002/diff/240001/runtime/bin/eventhandler_fuchsia.cc File runtime/bin/eventhandler_fuchsia.cc (right): https://codereview.chromium.org/2910853002/diff/240001/runtime/bin/eventhandler_fuchsia.cc#newcode84 runtime/bin/eventhandler_fuchsia.cc:84: LOG_INFO("IOHandle::Read: fd = %ld. read %ld bytes\n", fd_, read_bytes); ...
3 years, 6 months ago (2017-06-21 00:48:10 UTC) #16
zra
https://codereview.chromium.org/2910853002/diff/240001/runtime/bin/eventhandler_fuchsia.cc File runtime/bin/eventhandler_fuchsia.cc (right): https://codereview.chromium.org/2910853002/diff/240001/runtime/bin/eventhandler_fuchsia.cc#newcode84 runtime/bin/eventhandler_fuchsia.cc:84: LOG_INFO("IOHandle::Read: fd = %ld. read %ld bytes\n", fd_, read_bytes); ...
3 years, 6 months ago (2017-06-21 06:43:39 UTC) #17
swetland
https://codereview.chromium.org/2910853002/diff/240001/runtime/bin/eventhandler_fuchsia.cc File runtime/bin/eventhandler_fuchsia.cc (right): https://codereview.chromium.org/2910853002/diff/240001/runtime/bin/eventhandler_fuchsia.cc#newcode216 runtime/bin/eventhandler_fuchsia.cc:216: if ((status != MX_OK) && (status != MX_ERR_NOT_FOUND)) { ...
3 years, 6 months ago (2017-06-21 20:07:29 UTC) #18
zra
@asiva did you have any more comments?
3 years, 6 months ago (2017-06-23 14:53:22 UTC) #19
siva
lgtm https://codereview.chromium.org/2910853002/diff/280001/runtime/bin/eventhandler_fuchsia.cc File runtime/bin/eventhandler_fuchsia.cc (right): https://codereview.chromium.org/2910853002/diff/280001/runtime/bin/eventhandler_fuchsia.cc#newcode108 runtime/bin/eventhandler_fuchsia.cc:108: // Resubscribe to to write events. typo 'to ...
3 years, 6 months ago (2017-06-23 15:08:27 UTC) #20
zra
https://codereview.chromium.org/2910853002/diff/280001/runtime/bin/eventhandler_fuchsia.cc File runtime/bin/eventhandler_fuchsia.cc (right): https://codereview.chromium.org/2910853002/diff/280001/runtime/bin/eventhandler_fuchsia.cc#newcode108 runtime/bin/eventhandler_fuchsia.cc:108: // Resubscribe to to write events. On 2017/06/23 15:08:27, ...
3 years, 6 months ago (2017-06-23 17:31:38 UTC) #21
zra
3 years, 6 months ago (2017-06-23 17:41:27 UTC) #23
Message was sent while issue was closed.
Committed patchset #16 (id:300001) manually as
bad6b64062912b3dedf80cd0c9bd9c0c0ec3bbcb (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698