New issue
Advanced search Search tips

Issue 774160 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Apr 2018
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux , Windows , Chrome , Mac
Pri: 2
Type: Bug



Sign in to add a comment

MojoCdmFileIO should do I/O on separate thread

Project Member Reported by jrumm...@chromium.org, Oct 12 2017

Issue description

MojoCdmFileIO should do the Read/Write operations on a separate thread so as to not impact decoding happening on the same thread. The new thread may need to block shutdown so that the file is not corrupted.
 
Project Member

Comment 1 by bugdroid1@chromium.org, Nov 4 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/ee2314de40741b97283ad4325b284c063cc1fa48

commit ee2314de40741b97283ad4325b284c063cc1fa48
Author: Xiaohan Wang <xhwang@chromium.org>
Date: Fri Nov 03 23:23:37 2017

media: Add trace events for MojoCdmFileIO and CdmAdapter

Currently MojoCdmFileIO and CdmAdapter run on the same thread. So it's
possible that file read/write could block audio/video decoding. Adding
tracing events so that we can understand the performance impact. We'll
use this data to decide whether we need to move file read/write
operations to a different thread.

BUG= 774160 

Change-Id: I5f7a216dfb01cb797d628fecdd095cffb682e4e5
Reviewed-on: https://chromium-review.googlesource.com/748882
Reviewed-by: John Rummell <jrummell@chromium.org>
Commit-Queue: Xiaohan Wang <xhwang@chromium.org>
Cr-Commit-Position: refs/heads/master@{#513951}
[modify] https://crrev.com/ee2314de40741b97283ad4325b284c063cc1fa48/media/cdm/cdm_adapter.cc
[modify] https://crrev.com/ee2314de40741b97283ad4325b284c063cc1fa48/media/mojo/services/mojo_cdm_file_io.cc
[modify] https://crrev.com/ee2314de40741b97283ad4325b284c063cc1fa48/media/mojo/services/mojo_cdm_file_io.h

Project Member

Comment 2 by bugdroid1@chromium.org, Nov 10 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/adda6e11072e39d0034c3bc795169a6132f0d972

commit adda6e11072e39d0034c3bc795169a6132f0d972
Author: John Rummell <jrummell@chromium.org>
Date: Fri Nov 10 23:02:59 2017

media: Record time taken for CDM to read/write files

Currently MojoCdmFileIO and CdmAdapter run on the same thread. So it's
possible that file read/write could block audio/video decoding. Adding a
UMA to log the actual time taken, so we can understand if the IO takes too
long on actual user machines and should be moved to a seperate thread.

BUG= 774160 

Change-Id: I25a98e2124b431707c7e9efcdbf4da4cbdfccd2f
Reviewed-on: https://chromium-review.googlesource.com/758458
Reviewed-by: Xiaohan Wang <xhwang@chromium.org>
Reviewed-by: Ilya Sherman <isherman@chromium.org>
Commit-Queue: John Rummell <jrummell@chromium.org>
Cr-Commit-Position: refs/heads/master@{#515726}
[modify] https://crrev.com/adda6e11072e39d0034c3bc795169a6132f0d972/media/mojo/services/mojo_cdm_file_io.cc
[modify] https://crrev.com/adda6e11072e39d0034c3bc795169a6132f0d972/tools/metrics/histograms/histograms.xml

Project Member

Comment 3 by bugdroid1@chromium.org, Nov 17 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/f45580a8857e186a038745049e595bd31280f1cf

commit f45580a8857e186a038745049e595bd31280f1cf
Author: John Rummell <jrummell@chromium.org>
Date: Fri Nov 17 05:11:49 2017

media: Add additional trace events for MojoCdmFileIO

Adds trace events for opening the file, as well as when Write() and
WriteDone() are called to understand the impact of opening a temporary
file and renaming it after it's written to. Also adds fileName to the
event data saved.

BUG= 774160 

Change-Id: Id0476d028865802e1ddda22eac6620cd6f16f106
Reviewed-on: https://chromium-review.googlesource.com/775654
Commit-Queue: John Rummell <jrummell@chromium.org>
Reviewed-by: Xiaohan Wang <xhwang@chromium.org>
Cr-Commit-Position: refs/heads/master@{#517313}
[modify] https://crrev.com/f45580a8857e186a038745049e595bd31280f1cf/media/mojo/services/mojo_cdm_file_io.cc

Comment 4 by xhw...@chromium.org, Nov 28 2017

Labels: -Pri-3 M-65 OS-Chrome Pri-2
Re #2: What does the UMA number say? Let's watch the number periodically and by M-65 timeframe we should be able to make a decision on whether we need to do anything on this.
For Media.EME.CdmFileIO.ReadTime (Windows), 99th percentile is about 1.5ms. In the last 30 days (all OS), less than 0.01% of reports > 135ms. Largest value is <1062ms.

For Media.EME.CdmFileIO.WriteTime (Windows), 99th percentile is around 2ms. In the last 30 days (all OS), less than 0.01% of reports > 190ms. Largest value is <3553ms.

However, this is canary only. Will have to check again once it reaches more users.
Status: Fixed (was: Assigned)
Updating with latest results.

For Media.EME.CdmFileIO.ReadTime (Windows), 95th percentile is ~ 1.0ms, 99th percentile is < 1.6ms.
For Media.EME.CdmFileIO.WriteTime (Windows), 95th percentile is ~ 1.4ms, 99th percentile is < 3.0ms.

Numbers look good, so resolving this as done.

Sign in to add a comment