Skip to content

Commit

Permalink
Revert "Fix OOM problem in VulkanSwapChain"
Browse files Browse the repository at this point in the history
This reverts commit 08bd208.

Reason for revert: https://bugs.chromium.org/p/chromium/issues/detail?id=1206023

Original change's description:
> Fix OOM problem in VulkanSwapChain
>
> On Linux, sometimes the vulkan present engine will never release
> an image acquire fence, when it happens. Chrome will create new
> fences continuelly. It will cause OOM problem. To fix the OOM problem,
> the CL will add a limit on how many fences can be created. If the
> limit is reached, the VulkanSwapChian::SwapBuffers() related call
> will fail, and context lost will be triggered.
>
> Bug: 1189069
> Change-Id: I66f6368a4c1c1f3a95ce35827a89795060e450d9
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2847040
> Reviewed-by: Vasiliy Telezhnikov <vasilyt@chromium.org>
> Commit-Queue: Peng Huang <penghuang@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#875620}

Bug: 1189069
Change-Id: I7e792d46be68985d8d9cf512f931040c59493670
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2880749
Owners-Override: Peng Huang <penghuang@chromium.org>
Reviewed-by: Peng Huang <penghuang@chromium.org>
Reviewed-by: Vasiliy Telezhnikov <vasilyt@chromium.org>
Commit-Queue: Peng Huang <penghuang@chromium.org>
Cr-Commit-Position: refs/heads/master@{#880624}
  • Loading branch information
phuang authored and Chromium LUCI CQ committed May 7, 2021
1 parent 300dd35 commit f4f3e77
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions gpu/vulkan/vulkan_swap_chain.cc
Original file line number Diff line number Diff line change
Expand Up @@ -501,14 +501,11 @@ VulkanSwapChain::GetOrCreateFenceAndSemaphores() {
FenceAndSemaphores fence_and_semaphores;
do {
#if !defined(OS_FUCHSIA)
// On Linux, some drivers may never release an image acquire fence,
// It should be a driver bug. When it happens, return {}, and then
// it will cause context lost instead of creating new fences and
// semaphores and causing OOM.
// https://crbug.com/1189069
constexpr size_t kQueueSizeLimit = 64;
if (UNLIKELY(fence_and_semaphores_queue_.size() >= kQueueSizeLimit))
break;
// This crash key is for diagnosing OOM crash.
// TODO(penghuang): remove it when OOM crash is fixed, or find out it is not
// related.
SCOPED_CRASH_KEY_NUMBER("VulkanSwapChian", "queue_.size()",
fence_and_semaphores_queue_.size());

if (LIKELY(!fence_and_semaphores_queue_.empty())) {
fence_and_semaphores = fence_and_semaphores_queue_.front();
Expand Down

0 comments on commit f4f3e77

Please sign in to comment.