Commit fe6e8407 authored by kylechar's avatar kylechar Committed by Commit Bot

Revert "[gpu] Add trace events and thread priority assertion in GpuChannelHost."

This reverts commit 0b7197a2.

Reason for revert: Speculative revert for https://crbug.com/1145587

Original change's description:
> [gpu] Add trace events and thread priority assertion in GpuChannelHost.
>
> Traces collected through Slow Reports show that acquiring the
> GpuChannelHost lock from threads running at different priorities can
> cause priority inversions. In particular, it can cause jank on the
> renderer main thread through this chain of dependency:
>
> > Main thread: cc::ProxyMain::BeginMainFrame
>   > Compositor Thread: TileManager::FlushAndIssueSignals
>     > CompositorTileWorkerBackground (slow):
>         OneCopyRasterBuffer::Playback
>
> This CL adds trace events to make contention on the GpuChannelHost lock
> more obvious in traces, and an assertion to ensure that the
> GpuChannelHost lock is never acquired at background thread priority.
>
> Bug: 1072756
> Change-Id: I2a25efe2e3f6e9bf5d980ca351a990f9c7d256b4
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2157659
> Commit-Queue: François Doray <fdoray@chromium.org>
> Reviewed-by: Victor Miura <vmiura@chromium.org>
> Auto-Submit: François Doray <fdoray@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#823744}

TBR=fdoray@chromium.org,vmiura@chromium.org

Change-Id: I18717e6387e20e892b2a58e1aad34cd8b5e4d3e9
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Bug: 1072756, 1145587
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2519397Reviewed-by: default avatarkylechar <kylechar@chromium.org>
Commit-Queue: kylechar <kylechar@chromium.org>
Cr-Commit-Position: refs/heads/master@{#824017}
parent ab5c5f99
......@@ -31,19 +31,6 @@ using base::AutoLock;
namespace gpu {
namespace {
// The |context_lock_| of the GpuChannelHost should only be acquired on
// foreground threads. Otherwise, a normal priority thread could end up waiting
// for a background thread. A background thread may not run for a long time when
// the system is busy.
void AssertForegroundThreadForGpuChannelHostLock() {
DCHECK_NE(base::ThreadPriority::BACKGROUND,
base::PlatformThread::GetCurrentThreadPriority());
}
} // namespace
GpuChannelHost::GpuChannelHost(int channel_id,
const gpu::GPUInfo& gpu_info,
const gpu::GpuFeatureInfo& gpu_feature_info,
......@@ -135,9 +122,6 @@ uint32_t GpuChannelHost::OrderingBarrier(
int32_t route_id,
int32_t put_offset,
std::vector<SyncToken> sync_token_fences) {
TRACE_EVENT0("ipc", "GpuChannelHost::OrderingBarrier");
AssertForegroundThreadForGpuChannelHostLock();
AutoLock lock(context_lock_);
if (pending_ordering_barrier_ &&
......@@ -159,9 +143,6 @@ uint32_t GpuChannelHost::OrderingBarrier(
uint32_t GpuChannelHost::EnqueueDeferredMessage(
const IPC::Message& message,
std::vector<SyncToken> sync_token_fences) {
TRACE_EVENT0("ipc", "GpuChannelHost::EnqueueDeferredMessage");
AssertForegroundThreadForGpuChannelHostLock();
AutoLock lock(context_lock_);
EnqueuePendingOrderingBarrier();
......@@ -174,17 +155,11 @@ uint32_t GpuChannelHost::EnqueueDeferredMessage(
}
void GpuChannelHost::EnsureFlush(uint32_t deferred_message_id) {
TRACE_EVENT0("ipc", "GpuChannelHost::EnsureFlush");
AssertForegroundThreadForGpuChannelHostLock();
AutoLock lock(context_lock_);
InternalFlush(deferred_message_id);
}
void GpuChannelHost::VerifyFlush(uint32_t deferred_message_id) {
TRACE_EVENT0("ipc", "GpuChannelHost::VerifyFlush");
AssertForegroundThreadForGpuChannelHostLock();
AutoLock lock(context_lock_);
InternalFlush(deferred_message_id);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment