ozone/wayland: Add flag to use wayland thread with normal priority [chromium/src : main]

18 views
Skip to first unread message

Tiago Vignatti (Gerrit)

unread,
Nov 26, 2021, 4:35:58 PM11/26/21
to Maksim Sisov, Robert Kroeger, ozone-...@chromium.org, Hidehiko Abe, Luke Nihlen, Erik Chen

Attention is currently required from: Maksim Sisov, Robert Kroeger.

Tiago Vignatti would like Maksim Sisov and Robert Kroeger to review this change.

View Change

ozone/wayland: Add flag to use wayland thread with normal priority

In ChromeOS, the current priority settings for Lacros processes right
now are misleading because only the Wayland event watcher thread
("wayland-fd") is running with high display priority. The ash-chrome
situation is different, with the following all set to use display
priority:

- wayland-fd thread (always enabled)
- browser UI and IO threads (enabled by BrowserUseDisplayThreadPriority
finch flag)
- GPU main, viz compositor and IO threads (enabled by
GpuUseDisplayThreadPriority)
- renderer compositor & IO threads (enabled by
BlinkCompositorUseDisplayThreadPriority)

It doesn't make sense to simply match-up Lacros settings with ash-chrome
(see crrev.com/c/3243266) because these systems are different by nature.
For example, critical user journey tests on Google Docs (benchmarked
locally) shows that setting wayland-fd thread to normal priority
improves page loading time in Lacros. So with a better understanding of
CPU scheduling and boost mechanisms, our desire next is to come up with
an efficient overall solution for threads priorities in Lacros.

Therefore, in order to test the effects of changing threads priorities,
this CL adds the ability to use wayland-fd with normal priority by
passing the --use-wayland-normal-thread-priority flag.

BUG=1262133
TEST=tast run $device lacros.DocsCUJ (modified to use the newly flag)

Change-Id: I113b60151b43e0ab112606a594bde2e7fdb97e84
---
M ui/ozone/public/ozone_switches.cc
M ui/ozone/platform/wayland/host/wayland_event_watcher.cc
M ui/ozone/public/ozone_switches.h
3 files changed, 55 insertions(+), 1 deletion(-)


To view, visit change 3304121. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I113b60151b43e0ab112606a594bde2e7fdb97e84
Gerrit-Change-Number: 3304121
Gerrit-PatchSet: 1
Gerrit-Owner: Tiago Vignatti <tvig...@igalia.com>
Gerrit-Reviewer: Maksim Sisov <msi...@igalia.com>
Gerrit-Reviewer: Robert Kroeger <rjkr...@chromium.org>
Gerrit-CC: Erik Chen <erik...@chromium.org>
Gerrit-CC: Hidehiko Abe <hide...@chromium.org>
Gerrit-CC: Luke Nihlen <lu...@google.com>
Gerrit-Attention: Maksim Sisov <msi...@igalia.com>
Gerrit-Attention: Robert Kroeger <rjkr...@chromium.org>
Gerrit-MessageType: newchange

Tiago Vignatti (Gerrit)

unread,
Nov 26, 2021, 4:36:07 PM11/26/21
to ozone-...@chromium.org, Maksim Sisov, Robert Kroeger, Hidehiko Abe, Erik Chen, Luke Nihlen, chromium...@chromium.org

Attention is currently required from: Maksim Sisov, Robert Kroeger.

View Change

1 comment:

To view, visit change 3304121. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I113b60151b43e0ab112606a594bde2e7fdb97e84
Gerrit-Change-Number: 3304121
Gerrit-PatchSet: 1
Gerrit-Owner: Tiago Vignatti <tvig...@igalia.com>
Gerrit-Reviewer: Maksim Sisov <msi...@igalia.com>
Gerrit-Reviewer: Robert Kroeger <rjkr...@chromium.org>
Gerrit-CC: Erik Chen <erik...@chromium.org>
Gerrit-CC: Hidehiko Abe <hide...@chromium.org>
Gerrit-CC: Luke Nihlen <lu...@google.com>
Gerrit-Attention: Maksim Sisov <msi...@igalia.com>
Gerrit-Attention: Robert Kroeger <rjkr...@chromium.org>
Gerrit-Comment-Date: Fri, 26 Nov 2021 21:35:53 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Gerrit-MessageType: comment

Tiago Vignatti (Gerrit)

unread,
Nov 26, 2021, 4:42:47 PM11/26/21
to ozone-...@chromium.org

Attention is currently required from: Maksim Sisov, Robert Kroeger.

Tiago Vignatti uploaded patch set #3 to this change.

View Change

ozone/wayland: Add flag to use wayland thread with normal priority

In ChromeOS, the current priority settings for Lacros processes right
now are misleading because only the Wayland event watcher thread
("wayland-fd") is running with high display priority. The ash-chrome
situation is different, with the following all set to use display
priority:

- wayland-fd thread (always enabled)
- browser UI and IO threads (enabled by BrowserUseDisplayThreadPriority
finch flag)
- GPU main, viz compositor and IO threads (enabled by
GpuUseDisplayThreadPriority)
- renderer compositor & IO threads (enabled by
BlinkCompositorUseDisplayThreadPriority)

It doesn't make sense to simply match-up Lacros settings with ash-chrome
(see crrev.com/c/3243266) because these systems are different by nature.
For example, critical user journey tests on Google Docs shows that

setting wayland-fd thread to normal priority improves page loading time
in Lacros (benchmarked locally). So with a better understanding of CPU

scheduling and boost mechanisms, our desire next is to come up with an
efficient overall solution for threads priorities in Lacros.

Therefore, in order to test the effects of changing threads priorities,
this CL adds the ability to use wayland-fd with normal priority by
passing the --use-wayland-normal-thread-priority flag.

BUG=1262133
TEST=tast run $device lacros.DocsCUJ (modified to use the newly flag)

Change-Id: I113b60151b43e0ab112606a594bde2e7fdb97e84
---
M ui/ozone/public/ozone_switches.cc
M ui/ozone/platform/wayland/host/wayland_event_watcher.cc
M ui/ozone/public/ozone_switches.h
3 files changed, 55 insertions(+), 1 deletion(-)

To view, visit change 3304121. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I113b60151b43e0ab112606a594bde2e7fdb97e84
Gerrit-Change-Number: 3304121
Gerrit-PatchSet: 3
Gerrit-Owner: Tiago Vignatti <tvig...@igalia.com>
Gerrit-Reviewer: Maksim Sisov <msi...@igalia.com>
Gerrit-Reviewer: Robert Kroeger <rjkr...@chromium.org>
Gerrit-CC: Erik Chen <erik...@chromium.org>
Gerrit-CC: Hidehiko Abe <hide...@chromium.org>
Gerrit-CC: Luke Nihlen <lu...@google.com>
Gerrit-Attention: Maksim Sisov <msi...@igalia.com>
Gerrit-Attention: Robert Kroeger <rjkr...@chromium.org>
Gerrit-MessageType: newpatchset

Maksim Sisov (Gerrit)

unread,
Nov 29, 2021, 2:15:42 AM11/29/21
to Tiago Vignatti, ozone-...@chromium.org, Robert Kroeger, Hidehiko Abe, Erik Chen, Luke Nihlen, chromium...@chromium.org

Attention is currently required from: Tiago Vignatti, Robert Kroeger.

Patch set 3:Code-Review +1

View Change

    To view, visit change 3304121. To unsubscribe, or for help writing mail filters, visit settings.

    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: I113b60151b43e0ab112606a594bde2e7fdb97e84
    Gerrit-Change-Number: 3304121
    Gerrit-PatchSet: 3
    Gerrit-Owner: Tiago Vignatti <tvig...@igalia.com>
    Gerrit-Reviewer: Maksim Sisov <msi...@igalia.com>
    Gerrit-Reviewer: Robert Kroeger <rjkr...@chromium.org>
    Gerrit-CC: Erik Chen <erik...@chromium.org>
    Gerrit-CC: Hidehiko Abe <hide...@chromium.org>
    Gerrit-CC: Luke Nihlen <lu...@google.com>
    Gerrit-Attention: Tiago Vignatti <tvig...@igalia.com>
    Gerrit-Attention: Robert Kroeger <rjkr...@chromium.org>
    Gerrit-Comment-Date: Mon, 29 Nov 2021 07:15:30 +0000
    Gerrit-HasComments: No
    Gerrit-Has-Labels: Yes
    Gerrit-MessageType: comment

    Robert Kroeger (Gerrit)

    unread,
    Nov 29, 2021, 10:36:51 AM11/29/21
    to Tiago Vignatti, ozone-...@chromium.org, Maksim Sisov, Hidehiko Abe, Erik Chen, Luke Nihlen, chromium...@chromium.org

    Attention is currently required from: Tiago Vignatti.

    Patch set 3:Code-Review +1

    View Change

    2 comments:

    • Commit Message:

      • Patch Set #3, Line 15: - wayland-fd thread (always enabled)

        Why is there a wayland-fd thread at all in Ash-Chrome? That seems wrong to me. Are you sure? And if you are: why? Why doesn't Ash-Chrome support the arrival of events at Exo on the I/O or UI threads?

    • File ui/ozone/platform/wayland/host/wayland_event_watcher.cc:

      • Patch Set #3, Line 101: base::CommandLine* cmd_line = base::CommandLine::ForCurrentProcess();

        It seems somewhat wrong that we don't specify this at the time of ::InitializeUI. Chrome has a somewhat regretful habit of using command line variables as convenient global variables. 😊

        Can you add a TODO in the .h file to consider pruning the list of command line flags before landing.

    To view, visit change 3304121. To unsubscribe, or for help writing mail filters, visit settings.

    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: I113b60151b43e0ab112606a594bde2e7fdb97e84
    Gerrit-Change-Number: 3304121
    Gerrit-PatchSet: 3
    Gerrit-Owner: Tiago Vignatti <tvig...@igalia.com>
    Gerrit-Reviewer: Maksim Sisov <msi...@igalia.com>
    Gerrit-Reviewer: Robert Kroeger <rjkr...@chromium.org>
    Gerrit-CC: Erik Chen <erik...@chromium.org>
    Gerrit-CC: Hidehiko Abe <hide...@chromium.org>
    Gerrit-CC: Luke Nihlen <lu...@google.com>
    Gerrit-Attention: Tiago Vignatti <tvig...@igalia.com>
    Gerrit-Comment-Date: Mon, 29 Nov 2021 15:36:30 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: Yes
    Gerrit-MessageType: comment

    Tiago Vignatti (Gerrit)

    unread,
    Nov 29, 2021, 12:19:16 PM11/29/21
    to ozone-...@chromium.org, Robert Kroeger, Maksim Sisov, Hidehiko Abe, Erik Chen, Luke Nihlen, chromium...@chromium.org

    Attention is currently required from: Robert Kroeger.

    View Change

    3 comments:

    • Commit Message:

      • Why is there a wayland-fd thread at all in Ash-Chrome? That seems wrong to me. […]

        sorry, the description was wrong. I'm fixing it.

    • Patchset:

      • Patch Set #3:

        Thanks for review. One small question to address still, Robert.

    • File ui/ozone/platform/wayland/host/wayland_event_watcher.cc:

      • It seems somewhat wrong that we don't specify this at the time of ::InitializeUI. […]

        Are you suggesting to add a TODO in which .h file exactly, Robert?

    To view, visit change 3304121. To unsubscribe, or for help writing mail filters, visit settings.

    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: I113b60151b43e0ab112606a594bde2e7fdb97e84
    Gerrit-Change-Number: 3304121
    Gerrit-PatchSet: 3
    Gerrit-Owner: Tiago Vignatti <tvig...@igalia.com>
    Gerrit-Reviewer: Maksim Sisov <msi...@igalia.com>
    Gerrit-Reviewer: Robert Kroeger <rjkr...@chromium.org>
    Gerrit-CC: Erik Chen <erik...@chromium.org>
    Gerrit-CC: Hidehiko Abe <hide...@chromium.org>
    Gerrit-CC: Luke Nihlen <lu...@google.com>
    Gerrit-Attention: Robert Kroeger <rjkr...@chromium.org>
    Gerrit-Comment-Date: Mon, 29 Nov 2021 17:19:00 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No
    Comment-In-Reply-To: Robert Kroeger <rjkr...@chromium.org>
    Gerrit-MessageType: comment

    Tiago Vignatti (Gerrit)

    unread,
    Nov 29, 2021, 12:19:54 PM11/29/21
    to ozone-...@chromium.org

    Attention is currently required from: Robert Kroeger.

    Tiago Vignatti uploaded patch set #4 to this change.

    View Change

    ozone/wayland: Add flag to use wayland thread with normal priority

    In ChromeOS, the current priority settings for Lacros processes right
    now are misleading because only the Wayland event watcher thread
    ("wayland-fd") is running with high display priority. The ash-chrome
    situation is different, with the following all set to use display
    priority:

    - browser UI and IO threads (enabled by BrowserUseDisplayThreadPriority
    finch flag)
    - GPU main, viz compositor and IO threads (enabled by
    GpuUseDisplayThreadPriority)
    - renderer compositor & IO threads (enabled by
    BlinkCompositorUseDisplayThreadPriority)

    It doesn't make sense to simply match-up Lacros settings with ash-chrome
    (see crrev.com/c/3243266) because these systems are different by nature.
    For example, critical user journey tests on Google Docs shows that
    setting wayland-fd thread to normal priority improves page loading time
    in Lacros (benchmarked locally). So with a better understanding of CPU
    scheduling and boost mechanisms, our desire next is to come up with an
    efficient overall solution for threads priorities in Lacros.

    Therefore, in order to test the effects of changing threads priorities
    in Lacros, this CL adds the ability to use wayland-fd with normal

    priority by passing the --use-wayland-normal-thread-priority flag.

    BUG=1262133
    TEST=tast run $device lacros.DocsCUJ (modified to use the newly flag)

    Change-Id: I113b60151b43e0ab112606a594bde2e7fdb97e84
    ---
    M ui/ozone/public/ozone_switches.cc
    M ui/ozone/platform/wayland/host/wayland_event_watcher.cc
    M ui/ozone/public/ozone_switches.h
    3 files changed, 54 insertions(+), 1 deletion(-)

    To view, visit change 3304121. To unsubscribe, or for help writing mail filters, visit settings.

    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: I113b60151b43e0ab112606a594bde2e7fdb97e84
    Gerrit-Change-Number: 3304121
    Gerrit-PatchSet: 4
    Gerrit-Owner: Tiago Vignatti <tvig...@igalia.com>
    Gerrit-Reviewer: Maksim Sisov <msi...@igalia.com>
    Gerrit-Reviewer: Robert Kroeger <rjkr...@chromium.org>
    Gerrit-CC: Erik Chen <erik...@chromium.org>
    Gerrit-CC: Hidehiko Abe <hide...@chromium.org>
    Gerrit-CC: Luke Nihlen <lu...@google.com>
    Gerrit-Attention: Robert Kroeger <rjkr...@chromium.org>
    Gerrit-MessageType: newpatchset

    Robert Kroeger (Gerrit)

    unread,
    Nov 29, 2021, 3:39:21 PM11/29/21
    to Tiago Vignatti, ozone-...@chromium.org, Maksim Sisov, Hidehiko Abe, Erik Chen, Luke Nihlen, chromium...@chromium.org

    Attention is currently required from: Tiago Vignatti.

    Patch set 4:Code-Review +1

    View Change

    1 comment:

    • File ui/ozone/platform/wayland/host/wayland_event_watcher.cc:

      • Are you suggesting to add a TODO in which . […]

        ozone_switches.h

    To view, visit change 3304121. To unsubscribe, or for help writing mail filters, visit settings.

    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: I113b60151b43e0ab112606a594bde2e7fdb97e84
    Gerrit-Change-Number: 3304121
    Gerrit-PatchSet: 4
    Gerrit-Owner: Tiago Vignatti <tvig...@igalia.com>
    Gerrit-Reviewer: Maksim Sisov <msi...@igalia.com>
    Gerrit-Reviewer: Robert Kroeger <rjkr...@chromium.org>
    Gerrit-CC: Erik Chen <erik...@chromium.org>
    Gerrit-CC: Hidehiko Abe <hide...@chromium.org>
    Gerrit-CC: Luke Nihlen <lu...@google.com>
    Gerrit-Attention: Tiago Vignatti <tvig...@igalia.com>
    Gerrit-Comment-Date: Mon, 29 Nov 2021 20:39:05 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: Yes
    Comment-In-Reply-To: Tiago Vignatti <tvig...@igalia.com>

    Tiago Vignatti (Gerrit)

    unread,
    Nov 29, 2021, 3:56:23 PM11/29/21
    to ozone-...@chromium.org, Robert Kroeger, Maksim Sisov, Hidehiko Abe, Erik Chen, Luke Nihlen, chromium...@chromium.org

    View Change

    2 comments:

    • Patchset:

    • File ui/ozone/platform/wayland/host/wayland_event_watcher.cc:

      • ozone_switches. […]

        Ack

    To view, visit change 3304121. To unsubscribe, or for help writing mail filters, visit settings.

    Gerrit-Project: chromium/src
    Gerrit-Branch: main
    Gerrit-Change-Id: I113b60151b43e0ab112606a594bde2e7fdb97e84
    Gerrit-Change-Number: 3304121
    Gerrit-PatchSet: 5
    Gerrit-Owner: Tiago Vignatti <tvig...@igalia.com>
    Gerrit-Reviewer: Maksim Sisov <msi...@igalia.com>
    Gerrit-Reviewer: Robert Kroeger <rjkr...@chromium.org>
    Gerrit-CC: Erik Chen <erik...@chromium.org>
    Gerrit-CC: Hidehiko Abe <hide...@chromium.org>
    Gerrit-CC: Luke Nihlen <lu...@google.com>
    Gerrit-Comment-Date: Mon, 29 Nov 2021 20:56:10 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No

    Tiago Vignatti (Gerrit)

    unread,
    Nov 29, 2021, 3:56:30 PM11/29/21
    to ozone-...@chromium.org, Robert Kroeger, Maksim Sisov, Hidehiko Abe, Erik Chen, Luke Nihlen, chromium...@chromium.org

    Patch set 5:Commit-Queue +2

    View Change

      To view, visit change 3304121. To unsubscribe, or for help writing mail filters, visit settings.

      Gerrit-Project: chromium/src
      Gerrit-Branch: main
      Gerrit-Change-Id: I113b60151b43e0ab112606a594bde2e7fdb97e84
      Gerrit-Change-Number: 3304121
      Gerrit-PatchSet: 5
      Gerrit-Owner: Tiago Vignatti <tvig...@igalia.com>
      Gerrit-Reviewer: Maksim Sisov <msi...@igalia.com>
      Gerrit-Reviewer: Robert Kroeger <rjkr...@chromium.org>
      Gerrit-Reviewer: Tiago Vignatti <tvig...@igalia.com>
      Gerrit-CC: Erik Chen <erik...@chromium.org>
      Gerrit-CC: Hidehiko Abe <hide...@chromium.org>
      Gerrit-CC: Luke Nihlen <lu...@google.com>
      Gerrit-Comment-Date: Mon, 29 Nov 2021 20:56:20 +0000

      Chromium LUCI CQ (Gerrit)

      unread,
      Nov 29, 2021, 5:05:24 PM11/29/21
      to Tiago Vignatti, ozone-...@chromium.org, Robert Kroeger, Maksim Sisov, Hidehiko Abe, Erik Chen, Luke Nihlen, chromium...@chromium.org

      Chromium LUCI CQ submitted this change.

      View Change



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

      ```
      The name of the file: ui/ozone/public/ozone_switches.h
      Insertions: 2, Deletions: 0.

      @@ -8,6 +8,8 @@
      #include "base/compiler_specific.h"
      #include "base/component_export.h"

      +// TODO(rjkroege): Specify this at the time of ::InitializeUI to avoid the habit
      +// of using command line variables as convenient as global variables.
      namespace switches {

      COMPONENT_EXPORT(OZONE_BASE) extern const char kOzonePlatform[];
      ```

      Approvals: Robert Kroeger: Looks good to me Maksim Sisov: Looks good to me Tiago Vignatti: Commit
      Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3304121
      Commit-Queue: Tiago Vignatti <tvig...@igalia.com>
      Reviewed-by: Robert Kroeger <rjkr...@chromium.org>
      Reviewed-by: Maksim Sisov <msi...@igalia.com>
      Cr-Commit-Position: refs/heads/main@{#946170}

      ---
      M ui/ozone/public/ozone_switches.cc
      M ui/ozone/platform/wayland/host/wayland_event_watcher.cc
      M ui/ozone/public/ozone_switches.h
      3 files changed, 61 insertions(+), 1 deletion(-)


      To view, visit change 3304121. To unsubscribe, or for help writing mail filters, visit settings.

      Gerrit-Project: chromium/src
      Gerrit-Branch: main
      Gerrit-Change-Id: I113b60151b43e0ab112606a594bde2e7fdb97e84
      Gerrit-Change-Number: 3304121
      Gerrit-PatchSet: 6
      Gerrit-Owner: Tiago Vignatti <tvig...@igalia.com>
      Gerrit-Reviewer: Chromium LUCI CQ <chromiu...@luci-project-accounts.iam.gserviceaccount.com>
      Gerrit-Reviewer: Maksim Sisov <msi...@igalia.com>
      Gerrit-Reviewer: Robert Kroeger <rjkr...@chromium.org>
      Gerrit-Reviewer: Tiago Vignatti <tvig...@igalia.com>
      Gerrit-CC: Erik Chen <erik...@chromium.org>
      Gerrit-CC: Hidehiko Abe <hide...@chromium.org>
      Gerrit-CC: Luke Nihlen <lu...@google.com>
      Gerrit-MessageType: merged
      Reply all
      Reply to author
      Forward
      0 new messages