[roll] Roll fuchsia Revert "[starnix] Avoid syscalls for starnix-backed FD events"

This reverts commit 4bcd5865e131b49caa3e491bf10ccc47e7f71041.

Reason for revert: tree closure due to starnix build failure

Original change's description:
> [starnix] Avoid syscalls for starnix-backed FD events
>
> Previously, events on FDs that are implemented purely in starnix (e.g.
> pipe, eventfd, netlink sockets) each triggered a unique `zx::UserPacket`
> on a `zx::Port` (which backs a starnix `Waiter`). This meant that a
> `Waiter` may perform `O(N + M)` Fuchsia syscalls to collect all of the
> ready events to pass back to starnix user-space (where N is the number
> of FDs backed by pure starnix implementations and M is the number of FDs
> backed by the Fuchsia platform (e.g. network sockets)).
>
> This change introduces an in-starnix queue of pending events for FDs
> backed by pure starnix implementations, replacing the need for a
> per-event `zx::UserPacket`. Now, we only use a single `zx::UserPacket`
> to wake up a `Waiter` regardless the number of pending events for FDs
> backed by pure starnix implementations. This results in a `Waiter`
> performing only `O(M)` Fuchsia syscalls to collect all of the ready
> events to pass back to starnix user-space.
>
> Note that this CL changes the ordering semantics of triggered events by
> batching all user events with the first pending user event. There does
> not seem to be anything documenting any specific ordering so this CL
> reordered events to gain some performance wins when operating on FDs
> backed by starnix. Concretely, if events were triggered in the following
> order:
>   - network socket (Fuchsia)
>   - eventfd (starnix)
>   - filesystem (Fuchsia)
>   - pipe (starnix)
>   - netlink socket (starnix)
>
> The events will be returned in the following order:
>   - network socket (Fuchsia)
>   - eventfd (starnix)
>   - pipe (starnix)
>   - netlink socket (starnix)
>   - filesystem (Fuchsia)
>
> An alternative design was considered where the waiter implementation
> will eagerly check the in-starnix queue and only check the `zx::Port`
> if the in-starnix queue was empty, but this was abandoned as it allows
> for the edge-case where events triggered by the Fuchsia platform are
> never handled when starnix is constantly triggering events and keeping
> the in-starnix queue of events hydrated. The current implementation
> still relies on a `zx::UserPacket` enqueued to the `zx::Port` to
> determine when we dequeue from the in-starnix queue or process an event
> from the Fuchsia platform, avoiding the starvation problem.
>
> FUTURE: Another optimization that would help more generally is to
> introduce a variant of `zx_port_wait` that supports batch reading of
> `zx_port_packet_t`s. See https://fxbug.dev/134622.
>
> Performance Wins:
> ```
> Test case                                               Improve/regress?  Factor change  Mean before           Mean after
> ------------------------------------------------------  ----------------  -------------  --------------------  --------------------
> fuchsia.starnix.gvisor_benchmarks: EpollAllEvents/1024  improved          0.549-0.598    2315600 +/- 40512 ns  1326480 +/- 33901 ns
> fuchsia.starnix.gvisor_benchmarks: EpollAllEvents/2     improved          0.853-0.899    7423 +/- 122 ns       6500 +/- 63 ns
> fuchsia.starnix.gvisor_benchmarks: EpollAllEvents/512   improved          0.542-0.606    1150627 +/- 15511 ns  660076 +/- 28365 ns
> fuchsia.starnix.gvisor_benchmarks: EpollAllEvents/64    improved          0.569-0.614    143408 +/- 2117 ns    84762 +/- 1997 ns
> fuchsia.starnix.gvisor_benchmarks: EpollAllEvents/8     improved          0.675-0.710    20674 +/- 177 ns      14314 +/- 238 ns
> ```
>
> Original-Bug: 134622
> Original-Bug: b/296273285
> Original-Reviewed-on: https://fuchsia-review.googlesource.com/c/fuchsia/+/924718

Original-Bug: 134622
Original-Bug: b/296273285
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Original-Reviewed-on: https://fuchsia-review.googlesource.com/c/fuchsia/+/925174
Original-Revision: bcd8df5a656f5d26486f9633982da20541d76951
GitOrigin-RevId: 318b050ef4d53c73791e05ecb1050bc8b5fda3b8
Change-Id: I7cf744b9ab98bffb7b76d263177a20b8807c9b19
1 file changed
tree: e3e9c7ecdadb09aa53c2277a70d26de53a6c1aae
  1. git-hooks/
  2. infra/
  3. third_party/
  4. cts
  5. firmware
  6. flower
  7. jiri.lock
  8. MILESTONE
  9. minimal
  10. prebuilts
  11. README.md
  12. stem
  13. test_durations
  14. toolchain
README.md

Integration

This repository contains Fuchsia's Global Integration manifest files.

Making changes

All changes should be made to the internal version of this repository. Our infrastructure automatically updates this version when the internal one changes.

Currently all changes must be made by a Google employee. Non-Google employees wishing to make a change can ask for assistance via the IRC channel #fuchsia on Freenode.

Obtaining the source

First install Jiri.

Next run:

$ jiri init
$ jiri import minimal https://fuchsia.googlesource.com/integration
$ jiri update

Third party

Third party projects should have their own subdirectory in ./third_party.