[XL] Change in fuchsia/fuchsia[main]: [fuchsia-async] Make detaching tasks zero-cost

4 views
Skip to first unread message

'Chris Suter (Gerrit)' via owners-override

unread,
Apr 17, 2024, 7:19:31 PMApr 17
to Owners Override
Attention needed from Owners Override

Chris Suter has uploaded the change for review

Chris Suter would like Owners Override to review this change.

Commit message

[fuchsia-async] Make detaching tasks zero-cost

Instead of using RemoteHandle which carries some overhead, track join
results and cancellation within the executor. In this CL, there is only
a cost when a task has finished, or when the join handle has been
polled.

Also migrate from pin_utils::pin_mut to std::pin::pin.
Change-Id: I99783689bc034542478c8ed74ac747c141227cc9

Change diff


Change information

Files:
  • M src/connectivity/bluetooth/profiles/bt-hfp-audio-gateway/src/peer.rs
  • M src/connectivity/bluetooth/tools/bt-cli/src/main.rs
  • M src/connectivity/bluetooth/tools/bt-le-central/src/gatt.rs
  • M src/connectivity/lowpan/drivers/lowpan-ot-driver/src/driver/border_agent.rs
  • M src/connectivity/lowpan/lib/openthread_fuchsia/src/backing/alarm.rs
  • M src/connectivity/wlan/drivers/wlansoftmac/rust_driver/src/lib.rs
  • M src/connectivity/wlan/lib/stash/src/policy.rs
  • M src/developer/debug/e2e_tests/inferiors/async_rust.rs
  • M src/developer/debug/e2e_tests/scripts/async_backtrace.script
  • M src/developer/debug/zxdb/console/commands/verb_async_backtrace.cc
  • M src/developer/ffx/daemon/protocols/agis/src/lib.rs
  • M src/developer/ffx/daemon/protocols/mdns/src/lib.rs
  • M src/developer/ffx/lib/fuchsia-controller/src/lib_context.rs
  • M src/developer/ffx/lib/mdns_discovery/src/lib.rs
  • M src/diagnostics/archivist/src/archivist.rs
  • M src/lib/fuchsia-async-macro/src/lib.rs
  • M src/lib/fuchsia-async/src/atomic_future.rs
  • M src/lib/fuchsia-async/src/handle/emulated/shutdown_test.rs
  • M src/lib/fuchsia-async/src/handle/zircon/channel.rs
  • M src/lib/fuchsia-async/src/lib.rs
  • M src/lib/fuchsia-async/src/runtime/fuchsia/executor/common.rs
  • M src/lib/fuchsia-async/src/runtime/fuchsia/executor/instrumentation.rs
  • M src/lib/fuchsia-async/src/runtime/fuchsia/executor/local.rs
  • M src/lib/fuchsia-async/src/runtime/fuchsia/executor/send.rs
  • M src/lib/fuchsia-async/src/runtime/fuchsia/task.rs
  • M src/lib/fuchsia-async/src/runtime/mod.rs
  • M src/lib/fuchsia-async/src/test_support.rs
  • M src/lib/fuchsia-async/tests/hung_task/BUILD.gn
  • M src/lib/fuchsia-async/tests/hung_task/src/test.rs
  • M src/lib/ui/carnelian/src/app/strategies/framebuffer.rs
  • M src/recovery/system/src/main.rs
  • M src/sys/test_manager/src/running_suite.rs
  • M src/sys/test_manager/src/test_suite.rs
  • M src/sys/time/timekeeper/src/clock_manager.rs
  • M src/ui/bin/terminal/src/ui/terminal_scene.rs
Change size: XL
Delta: 35 files changed, 711 insertions(+), 333 deletions(-)
Open in Gerrit

Related details

Attention is currently required from:
  • Owners Override
Submit Requirements:
  • requirement satisfiedCode-Review
  • requirement satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: newchange
Gerrit-Project: fuchsia
Gerrit-Branch: main
Gerrit-Change-Id: I99783689bc034542478c8ed74ac747c141227cc9
Gerrit-Change-Number: 1021613
Gerrit-PatchSet: 23
Gerrit-Owner: Chris Suter <csu...@google.com>
Gerrit-Reviewer: Chris Suter <csu...@google.com>
Gerrit-Reviewer: Jacob Rutherford <jru...@google.com>
Gerrit-Reviewer: Marie Janssen <jam...@google.com>
Gerrit-Reviewer: Owners Override <owners-...@fuchsia.dev>
Gerrit-Reviewer: Tyler Mandry <tma...@google.com>
Gerrit-Attention: Owners Override <owners-...@fuchsia.dev>

--
You received this message because you are subscribed to the Google Groups "owners-override" group.
To unsubscribe from this group and stop receiving emails from it, send an email to owners-overri...@fuchsia.dev.
To view this discussion on the web visit https://groups.google.com/a/fuchsia.dev/d/msgid/owners-override/f86cbfa83c965056c8d96c1cfc8f1e5821a53538-HTML%40fuchsia-review.googlesource.com.
satisfied_requirement
open
diffy

'Adam Barth (Gerrit)' via owners-override

unread,
Apr 17, 2024, 8:15:08 PMApr 17
to Chris Suter, Owners Override, Tyler Mandry, Marie Janssen, Jacob Rutherford, CQ Bot
Attention needed from Chris Suter and Owners Override

Adam Barth voted and added 1 comment

Votes added by Adam Barth

Owners-Override+1

1 comment

Patchset-level comments
File-level comment, Patchset 23 (Latest):
Adam Barth . resolved

I only looked at the the files that did not already have +2

Open in Gerrit

Related details

Attention is currently required from:
  • Chris Suter
  • Owners Override
Submit Requirements:
  • requirement satisfiedCode-Review
  • requirement satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: fuchsia
Gerrit-Branch: main
Gerrit-Change-Id: I99783689bc034542478c8ed74ac747c141227cc9
Gerrit-Change-Number: 1021613
Gerrit-PatchSet: 23
Gerrit-Owner: Chris Suter <csu...@google.com>
Gerrit-Reviewer: Adam Barth <aba...@google.com>
Gerrit-Reviewer: Chris Suter <csu...@google.com>
Gerrit-Reviewer: Jacob Rutherford <jru...@google.com>
Gerrit-Reviewer: Marie Janssen <jam...@google.com>
Gerrit-Reviewer: Owners Override <owners-...@fuchsia.dev>
Gerrit-Reviewer: Tyler Mandry <tma...@google.com>
Gerrit-Attention: Owners Override <owners-...@fuchsia.dev>
Gerrit-Attention: Chris Suter <csu...@google.com>
Gerrit-Comment-Date: Thu, 18 Apr 2024 00:14:59 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes

--
You received this message because you are subscribed to the Google Groups "owners-override" group.
To unsubscribe from this group and stop receiving emails from it, send an email to owners-overri...@fuchsia.dev.
To view this discussion on the web visit https://groups.google.com/a/fuchsia.dev/d/msgid/owners-override/0f7173cec2ddb13f93c76f48e15333fc02e4d3d6-EmailReviewComments-HTML%40fuchsia-review.googlesource.com.
satisfied_requirement
open
diffy

'Chris Suter (Gerrit)' via owners-override

unread,
Apr 18, 2024, 12:56:24 AMApr 18
to Adam Barth, Owners Override, Tyler Mandry, Marie Janssen, Jacob Rutherford, CQ Bot
Attention needed from Owners Override

Chris Suter voted Commit-Queue+2

Commit-Queue+2
Open in Gerrit

Related details

Attention is currently required from:
  • Owners Override
Submit Requirements:
  • requirement satisfiedCode-Review
  • requirement satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: fuchsia
Gerrit-Branch: main
Gerrit-Change-Id: I99783689bc034542478c8ed74ac747c141227cc9
Gerrit-Change-Number: 1021613
Gerrit-PatchSet: 23
Gerrit-Owner: Chris Suter <csu...@google.com>
Gerrit-Reviewer: Adam Barth <aba...@google.com>
Gerrit-Reviewer: Chris Suter <csu...@google.com>
Gerrit-Reviewer: Jacob Rutherford <jru...@google.com>
Gerrit-Reviewer: Marie Janssen <jam...@google.com>
Gerrit-Reviewer: Owners Override <owners-...@fuchsia.dev>
Gerrit-Reviewer: Tyler Mandry <tma...@google.com>
Gerrit-Attention: Owners Override <owners-...@fuchsia.dev>
Gerrit-Comment-Date: Thu, 18 Apr 2024 04:56:14 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes

--
You received this message because you are subscribed to the Google Groups "owners-override" group.
To unsubscribe from this group and stop receiving emails from it, send an email to owners-overri...@fuchsia.dev.
To view this discussion on the web visit https://groups.google.com/a/fuchsia.dev/d/msgid/owners-override/5bd7d74ab7b6f8faeb87ba3926324d9ccdd03046-EmailReviewComments-HTML%40fuchsia-review.googlesource.com.
satisfied_requirement
open
diffy

'CQ Bot (Gerrit)' via owners-override

unread,
Apr 18, 2024, 12:56:38 AMApr 18
to Chris Suter, Adam Barth, Owners Override, Tyler Mandry, Marie Janssen, Jacob Rutherford

CQ Bot submitted the change with unreviewed changes

Unreviewed changes

21 is the latest approved patch-set.
The change was submitted with unreviewed changes in the following files:

```
The name of the file: src/lib/fuchsia-async/src/runtime/fuchsia/task.rs
Insertions: 1, Deletions: 0.

@@ -123,6 +123,7 @@
impl<T> Drop for Task<T> {
fn drop(&mut self) {
if self.task_id != 0 {
+ // SAFETY: We spawned the task so the return type should be correct.
unsafe { self.executor.cancel::<T>(self.task_id) };
}
}
```
```
The name of the file: src/lib/fuchsia-async/src/runtime/fuchsia/executor/local.rs
Insertions: 3, Deletions: 1.

@@ -66,6 +66,8 @@
);

let Poll::Ready(result) = self.run::</* UNTIL_STALLED: */ false, F::Output>(
+ // SAFETY: This is a singlethreaded executor, so the future will never be sent across
+ // threads.
unsafe { AtomicFuture::new_local(main_future, true) }
) else {
unreachable!()
@@ -195,7 +197,7 @@

loop {
let result = self.local.run::</* UNTIL_STALLED: */ true, F::Output>(
- // SAFETY: We meet the Send requirements.
+ // SAFETY: We don't move the main future across threads.
unsafe { AtomicFuture::new_local(main_future.as_mut(), true) }
);
if result.is_ready() {
```

Change information

Commit message:
[fuchsia-async] Make detaching tasks zero-cost

Instead of using RemoteHandle which carries some overhead, track join
results and cancellation within the executor. In this CL, there is only
a cost when a task has finished, or when the join handle has been
polled.

Also migrate from pin_utils::pin_mut to std::pin::pin.
Change-Id: I99783689bc034542478c8ed74ac747c141227cc9
Owners-Override: Adam Barth <aba...@google.com>
Reviewed-by: Tyler Mandry <tma...@google.com>
Commit-Queue: Chris Suter <csu...@google.com>
Reviewed-by: Jacob Rutherford <jru...@google.com>
Reviewed-by: Marie Janssen <jam...@google.com>
Branch: refs/heads/main
Submit Requirements:
  • requirement satisfiedCode-Review: +2 by Marie Janssen, +2 by Jacob Rutherford, +2 by Tyler Mandry
Open in Gerrit
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: merged
Gerrit-Project: fuchsia
Gerrit-Branch: main
Gerrit-Change-Id: I99783689bc034542478c8ed74ac747c141227cc9
Gerrit-Change-Number: 1021613
Gerrit-PatchSet: 24
Gerrit-Owner: Chris Suter <csu...@google.com>
Gerrit-Reviewer: Adam Barth <aba...@google.com>
Gerrit-Reviewer: Chris Suter <csu...@google.com>
Gerrit-Reviewer: Jacob Rutherford <jru...@google.com>
Gerrit-Reviewer: Marie Janssen <jam...@google.com>
Gerrit-Reviewer: Owners Override <owners-...@fuchsia.dev>
Gerrit-Reviewer: Tyler Mandry <tma...@google.com>

--
You received this message because you are subscribed to the Google Groups "owners-override" group.
To unsubscribe from this group and stop receiving emails from it, send an email to owners-overri...@fuchsia.dev.
To view this discussion on the web visit https://groups.google.com/a/fuchsia.dev/d/msgid/owners-override/6340d1e22c16ad5a1d8768cf6fee3ae1323f57cf-HTML%40fuchsia-review.googlesource.com.
open
diffy
satisfied_requirement

'GI Roller (Gerrit)' via owners-override

unread,
Apr 18, 2024, 12:59:15 AMApr 18
to CQ Bot, Chris Suter, Adam Barth, Owners Override, Tyler Mandry, Marie Janssen, Jacob Rutherford

Message from GI Roller

Open in Gerrit

Related details

Attention set is empty
Submit Requirements:
  • requirement satisfiedCode-Review
  • requirement satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: fuchsia
Gerrit-Branch: main
Gerrit-Change-Id: I99783689bc034542478c8ed74ac747c141227cc9
Gerrit-Change-Number: 1021613
Gerrit-PatchSet: 24
Gerrit-Owner: Chris Suter <csu...@google.com>
Gerrit-Reviewer: Adam Barth <aba...@google.com>
Gerrit-Reviewer: Chris Suter <csu...@google.com>
Gerrit-Reviewer: Jacob Rutherford <jru...@google.com>
Gerrit-Reviewer: Marie Janssen <jam...@google.com>
Gerrit-Reviewer: Owners Override <owners-...@fuchsia.dev>
Gerrit-Reviewer: Tyler Mandry <tma...@google.com>
Gerrit-Comment-Date: Thu, 18 Apr 2024 04:59:06 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: No

--
You received this message because you are subscribed to the Google Groups "owners-override" group.
To unsubscribe from this group and stop receiving emails from it, send an email to owners-overri...@fuchsia.dev.
To view this discussion on the web visit https://groups.google.com/a/fuchsia.dev/d/msgid/owners-override/458196213497e83bf35f655cfa60248f8b2bcf81-EmailReviewComments-HTML%40fuchsia-review.googlesource.com.
satisfied_requirement
open
diffy
Reply all
Reply to author
Forward
0 new messages