|
|
DescriptionMinor fixes to Mojo MemoryDumpProvider.
* Allow values from Mojo MemoryDumpProviders to be captured by slow reports by whitelisting them for background traces.
* Add a unit test.
* Fix destructor to correctly unregister the MemoryDumpProvider.
BUG=705785
Review-Url: https://codereview.chromium.org/2930533003
Cr-Commit-Position: refs/heads/master@{#478327}
Committed: https://chromium.googlesource.com/chromium/src/+/337e9da889a1982924a7d730ca3e8d6b0bc073d7
Patch Set 1 #Patch Set 2 : Comments from sid. #
Total comments: 10
Patch Set 3 : comments from ssid, fix unittest. #
Total comments: 1
Patch Set 4 : comments from ssid. #
Messages
Total messages: 38 (18 generated)
erikchen@chromium.org changed reviewers: + dskiba@chromium.org
dskiba: Please review.
dskiba@chromium.org changed reviewers: + ssid@chromium.org
LGTM +ssid to double-check.
On 2017/06/07 00:10:02, DmitrySkiba wrote: > LGTM > > +ssid to double-check. Added some comments to the other CL. Please fix them before this CL.
Description was changed from ========== Allow value from Mojo MemoryDumpProviders to be captured by slow reports. Whitelist the relevant fields for capturing during tracing in background mode. BUG=705785 ========== to ========== Minor fixes to Mojo MemoryDumpProvider. * Allow values from Mojo MemoryDumpProviders to be captured by slow reports by whitelisting them for background traces. * Add a unit test. * Fix destructor to correctly unregister the MemoryDumpProvider. BUG=705785 ==========
Description was changed from ========== Minor fixes to Mojo MemoryDumpProvider. * Allow values from Mojo MemoryDumpProviders to be captured by slow reports by whitelisting them for background traces. * Add a unit test. * Fix destructor to correctly unregister the MemoryDumpProvider. BUG=705785 ========== to ========== Minor fixes to Mojo MemoryDumpProvider. * Allow values from Mojo MemoryDumpProviders to be captured by slow reports by whitelisting them for background traces. * Add a unit test. * Fix destructor to correctly unregister the MemoryDumpProvider. BUG=705785 ==========
The CQ bit was checked by erikchen@chromium.org to run a CQ dry run
ssid: PTAL
Dry run: CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: Try jobs failed on following builders: linux_chromium_rel_ng on master.tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_...)
On 2017/06/07 02:58:32, erikchen wrote: > ssid: PTAL ssdi: PTAL
RS-LGTM for base/trace_event/memory_infra_background_whitelist.cc once ssid is happy. I wish I could help more but you folks are talking about "other CL" and I have no idea what it is :)
Thanks for fixing the provider. The provider does not seem to add size at all. Is it just the first version of the provider and we want to get some data? The slow reports process currently only takes "size" parameter in the graphs. If we do not have size the provider will not show up in the aggregates. I'd also have to change the processing js script to emit these metrics, which means changing the processing jobs (just dremel queries on the database won't work). https://codereview.chromium.org/2930533003/diff/20001/base/trace_event/memory... File base/trace_event/memory_infra_background_whitelist.cc (right): https://codereview.chromium.org/2930533003/diff/20001/base/trace_event/memory... base/trace_event/memory_infra_background_whitelist.cc:40: "MojoHandleTable", nit: please place it in order, move to line 31 https://codereview.chromium.org/2930533003/diff/20001/mojo/edk/system/core.cc File mojo/edk/system/core.cc (right): https://codereview.chromium.org/2930533003/diff/20001/mojo/edk/system/core.cc... mojo/edk/system/core.cc:148: ->UnregisterAndDeleteDumpProviderSoon(std::move(handles_)); Can we clear the memory used by |handles_| befoe passing to MDM? { base::AutoLock lock(handles_->GetLock()); handles_->handles_.clear(); } Just to make sure that we don't keep around extra memory just because memory-infra is hung / taking time. https://codereview.chromium.org/2930533003/diff/20001/mojo/edk/system/handle_... File mojo/edk/system/handle_table.cc (right): https://codereview.chromium.org/2930533003/diff/20001/mojo/edk/system/handle_... mojo/edk/system/handle_table.cc:169: handle_count[Dispatcher::Type::PLATFORM_HANDLE]; Are these lines required? The last time I tested just the statement below works fine.
https://codereview.chromium.org/2930533003/diff/20001/base/trace_event/memory... File base/trace_event/memory_infra_background_whitelist.cc (right): https://codereview.chromium.org/2930533003/diff/20001/base/trace_event/memory... base/trace_event/memory_infra_background_whitelist.cc:40: "MojoHandleTable", On 2017/06/08 18:12:36, ssid wrote: > nit: please place it in order, move to line 31 Done. https://codereview.chromium.org/2930533003/diff/20001/mojo/edk/system/core.cc File mojo/edk/system/core.cc (right): https://codereview.chromium.org/2930533003/diff/20001/mojo/edk/system/core.cc... mojo/edk/system/core.cc:148: ->UnregisterAndDeleteDumpProviderSoon(std::move(handles_)); On 2017/06/08 18:12:36, ssid wrote: > Can we clear the memory used by |handles_| befoe passing to MDM? > > { > base::AutoLock lock(handles_->GetLock()); > handles_->handles_.clear(); > } > > Just to make sure that we don't keep around extra memory just because > memory-infra is hung / taking time. > Sorry, I feel strongly about *not* doing what you suggested. Either this is a serious issue that should be indicated in the comments and uniformly followed by all MDPs that invoke this method, presumably with investigation to figure out why it's hung/taking time to fix it, or else we shouldn't worry about this and assume that the MemoryDumpManager is functioning appropriately. "defensive programming" against potential issues clutters code without [frequently] addressing the root cause of the potential issues. https://codereview.chromium.org/2930533003/diff/20001/mojo/edk/system/handle_... File mojo/edk/system/handle_table.cc (right): https://codereview.chromium.org/2930533003/diff/20001/mojo/edk/system/handle_... mojo/edk/system/handle_table.cc:169: handle_count[Dispatcher::Type::PLATFORM_HANDLE]; On 2017/06/08 18:12:36, ssid wrote: > Are these lines required? The last time I tested just the statement below works > fine. As I commented above, this causes the entries to be created in the map, which causes us to emit "0" for entries that otherwise would be omitted entirely.
The CQ bit was checked by erikchen@chromium.org to run a CQ dry run
Dry run: CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
thanks https://codereview.chromium.org/2930533003/diff/20001/mojo/edk/system/core.cc File mojo/edk/system/core.cc (right): https://codereview.chromium.org/2930533003/diff/20001/mojo/edk/system/core.cc... mojo/edk/system/core.cc:148: ->UnregisterAndDeleteDumpProviderSoon(std::move(handles_)); On 2017/06/09 00:18:12, erikchen wrote: > On 2017/06/08 18:12:36, ssid wrote: > > Can we clear the memory used by |handles_| befoe passing to MDM? > > > > { > > base::AutoLock lock(handles_->GetLock()); > > handles_->handles_.clear(); > > } > > > > Just to make sure that we don't keep around extra memory just because > > memory-infra is hung / taking time. > > > > Sorry, I feel strongly about *not* doing what you suggested. > > Either this is a serious issue that should be indicated in the comments and The comment on the api says "The |mdp| will be deleted at some point in the near future." which means it could take a long time too. > uniformly followed by all MDPs that invoke this method, presumably with > investigation to figure out why it's hung/taking time to fix it, or else we > shouldn't worry about this and assume that the MemoryDumpManager is functioning > appropriately. > > "defensive programming" against potential issues clutters code without > [frequently] addressing the root cause of the potential issues. It need not be just the case where memory-infra hangs. It is a possible scenario where the main threads are busy and the background thread of memory-infra never got to execute tasks for a long time. This would still mean we keep around extra memory for that time, especially when the table can be big. I do not think this is defensive programming, i think it is more efficient programming. https://codereview.chromium.org/2930533003/diff/20001/mojo/edk/system/handle_... File mojo/edk/system/handle_table.cc (right): https://codereview.chromium.org/2930533003/diff/20001/mojo/edk/system/handle_... mojo/edk/system/handle_table.cc:169: handle_count[Dispatcher::Type::PLATFORM_HANDLE]; On 2017/06/09 00:18:12, erikchen wrote: > On 2017/06/08 18:12:36, ssid wrote: > > Are these lines required? The last time I tested just the statement below > works > > fine. > > As I commented above, this causes the entries to be created in the map, which > causes us to emit "0" for entries that otherwise would be omitted entirely. Acknowledged. https://codereview.chromium.org/2930533003/diff/40001/mojo/edk/system/handle_... File mojo/edk/system/handle_table.cc (right): https://codereview.chromium.org/2930533003/diff/40001/mojo/edk/system/handle_... mojo/edk/system/handle_table.cc:179: pmd->CreateAllocatorDump("mojo"); This line is not required.
On 2017/06/08 12:55:19, Primiano Tucci wrote: > RS-LGTM for base/trace_event/memory_infra_background_whitelist.cc once ssid is > happy. > I wish I could help more but you folks are talking about "other CL" and I have > no idea what it is :) Sorry link: https://codereview.chromium.org/2915013006/
@Eric: The provider does not seem to add size at all. Is it just the first version of the provider and we want to start getting any data? How are you planning to use this? The slow reports process currently only takes "size" parameter in the graphs. If we do not have size the provider will not show up in the aggregates. I'd also have to change the processing js script to emit these metrics, which means changing the processing jobs (just dremel queries on the database won't work).
The CQ bit was unchecked by commit-bot@chromium.org
Dry run: This issue passed the CQ dry run.
On 2017/06/09 00:42:02, ssid wrote: > @Eric: > The provider does not seem to add size at all. Is it just the first version of > the provider and we want to start getting any data? How are you planning to use > this? I'd like to be able to count number of mojo handles in memory-infra dumps. > > The slow reports process currently only takes "size" parameter in the graphs. If > we do not have size the provider will not show up in the aggregates. I'd also > have to change the processing js script to emit these metrics, which means > changing the processing jobs (just dremel queries on the database won't work). I only added slow reports code at dskiba's request. I'm happy to remove it as well.
https://codereview.chromium.org/2930533003/diff/20001/mojo/edk/system/core.cc File mojo/edk/system/core.cc (right): https://codereview.chromium.org/2930533003/diff/20001/mojo/edk/system/core.cc... mojo/edk/system/core.cc:148: ->UnregisterAndDeleteDumpProviderSoon(std::move(handles_)); > The comment on the api says "The |mdp| will be deleted at some point in the near > future." which means it could take a long time too. I read "near future" as not taking a long time. > > > uniformly followed by all MDPs that invoke this method, presumably with > > investigation to figure out why it's hung/taking time to fix it, or else we > > shouldn't worry about this and assume that the MemoryDumpManager is > functioning > > appropriately. > > > > "defensive programming" against potential issues clutters code without > > [frequently] addressing the root cause of the potential issues. > > It need not be just the case where memory-infra hangs. It is a possible scenario > where the main threads are busy and the background thread of memory-infra never > got to execute tasks for a long time. This would still mean we keep around extra > memory for that time, especially when the table can be big. > > I do not think this is defensive programming, i think it is more efficient > programming. I guess we disagree about this point. I'm happy to do whatever rockot@ prefers.
On 2017/06/09 02:06:25, erikchen wrote: > https://codereview.chromium.org/2930533003/diff/20001/mojo/edk/system/core.cc > File mojo/edk/system/core.cc (right): > > https://codereview.chromium.org/2930533003/diff/20001/mojo/edk/system/core.cc... > mojo/edk/system/core.cc:148: > ->UnregisterAndDeleteDumpProviderSoon(std::move(handles_)); > > > The comment on the api says "The |mdp| will be deleted at some point in the > near > > future." which means it could take a long time too. > I read "near future" as not taking a long time. > > > > > > uniformly followed by all MDPs that invoke this method, presumably with > > > investigation to figure out why it's hung/taking time to fix it, or else we > > > shouldn't worry about this and assume that the MemoryDumpManager is > > functioning > > > appropriately. > > > > > > "defensive programming" against potential issues clutters code without > > > [frequently] addressing the root cause of the potential issues. > > > > It need not be just the case where memory-infra hangs. It is a possible > scenario > > where the main threads are busy and the background thread of memory-infra > never > > got to execute tasks for a long time. This would still mean we keep around > extra > > memory for that time, especially when the table can be big. > > > > I do not think this is defensive programming, i think it is more efficient > > programming. > I guess we disagree about this point. I'm happy to do whatever rockot@ prefers. Okay lgtm for other bits. Don't feel so strongly about clearing the map.
primiano@chromium.org changed reviewers: + primiano@chromium.org
https://codereview.chromium.org/2930533003/diff/20001/mojo/edk/system/core.cc File mojo/edk/system/core.cc (right): https://codereview.chromium.org/2930533003/diff/20001/mojo/edk/system/core.cc... mojo/edk/system/core.cc:148: ->UnregisterAndDeleteDumpProviderSoon(std::move(handles_)); On 2017/06/09 02:06:25, erikchen wrote: > > > The comment on the api says "The |mdp| will be deleted at some point in the > near > > future." which means it could take a long time too. > I read "near future" as not taking a long time. > > > > > > uniformly followed by all MDPs that invoke this method, presumably with > > > investigation to figure out why it's hung/taking time to fix it, or else we > > > shouldn't worry about this and assume that the MemoryDumpManager is > > functioning > > > appropriately. > > > > > > "defensive programming" against potential issues clutters code without > > > [frequently] addressing the root cause of the potential issues. > > > > It need not be just the case where memory-infra hangs. It is a possible > scenario > > where the main threads are busy and the background thread of memory-infra > never > > got to execute tasks for a long time. This would still mean we keep around > extra > > memory for that time, especially when the table can be big. > > > > I do not think this is defensive programming, i think it is more efficient > > programming. > I guess we disagree about this point. I'm happy to do whatever rockot@ prefers. Hmm I am no OWNERz of this file but I lean towards Erik's way of thinking here. That UnregisterAndDeleteDumpProviderSoon at most should defer the deletion to the time it takes to complete the currently outstanding dump (if any). Essentially is there to prevent that we delete the MDP while we iterate on it, and guarantees linearization of the dtor. So realistically I expect that object to be freed in <1s or so. If we have issues of the form "the object is not really deleted soon" that is a bug and we should fix the bug, not work around that to minimize the impact. If there are cases where the dump can get stuck (probably there are) we should introduce a timeout mechanism to recover and blacklist (I think we should do that regardless, today we rely too much on MDP behaving sanely)
On 2017/06/09 11:29:58, Primiano Tucci wrote: > https://codereview.chromium.org/2930533003/diff/20001/mojo/edk/system/core.cc > File mojo/edk/system/core.cc (right): > > https://codereview.chromium.org/2930533003/diff/20001/mojo/edk/system/core.cc... > mojo/edk/system/core.cc:148: > ->UnregisterAndDeleteDumpProviderSoon(std::move(handles_)); > On 2017/06/09 02:06:25, erikchen wrote: > > > > > The comment on the api says "The |mdp| will be deleted at some point in the > > near > > > future." which means it could take a long time too. > > I read "near future" as not taking a long time. > > > > > > > > > uniformly followed by all MDPs that invoke this method, presumably with > > > > investigation to figure out why it's hung/taking time to fix it, or else > we > > > > shouldn't worry about this and assume that the MemoryDumpManager is > > > functioning > > > > appropriately. > > > > > > > > "defensive programming" against potential issues clutters code without > > > > [frequently] addressing the root cause of the potential issues. > > > > > > It need not be just the case where memory-infra hangs. It is a possible > > scenario > > > where the main threads are busy and the background thread of memory-infra > > never > > > got to execute tasks for a long time. This would still mean we keep around > > extra > > > memory for that time, especially when the table can be big. > > > > > > I do not think this is defensive programming, i think it is more efficient > > > programming. > > I guess we disagree about this point. I'm happy to do whatever rockot@ > prefers. > > Hmm I am no OWNERz of this file but I lean towards Erik's way of thinking here. > That UnregisterAndDeleteDumpProviderSoon at most should defer the deletion to > the time it takes to complete the currently outstanding dump (if any). > Essentially is there to prevent that we delete the MDP while we iterate on it, > and guarantees linearization of the dtor. > So realistically I expect that object to be freed in <1s or so. > If we have issues of the form "the object is not really deleted soon" that is a > bug and we should fix the bug, not work around that to minimize the impact. > If there are cases where the dump can get stuck (probably there are) we should > introduce a timeout mechanism to recover and blacklist (I think we should do > that regardless, today we rely too much on MDP behaving sanely) Um, what I was suggesting was let's not keep the memory alive even for the 1 second. In no way I meant to say we should let go of bugs. I felt keeping like 10mb around for a second more than necessary could be avoided.
erikchen@chromium.org changed reviewers: + rockot@chromium.org
rockot: Please review.
lgtm
The CQ bit was checked by erikchen@chromium.org
The patchset sent to the CQ was uploaded after l-g-t-m from dskiba@chromium.org, primiano@chromium.org Link to the patchset: https://codereview.chromium.org/2930533003/#ps60001 (title: "comments from ssid.")
CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.or...
CQ is committing da patch. Bot data: {"patchset_id": 60001, "attempt_start_ts": 1497025532560600, "parent_rev": "e4815989660c3ef60e99b55d9b936246714e4719", "commit_rev": "337e9da889a1982924a7d730ca3e8d6b0bc073d7"}
Message was sent while issue was closed.
Description was changed from ========== Minor fixes to Mojo MemoryDumpProvider. * Allow values from Mojo MemoryDumpProviders to be captured by slow reports by whitelisting them for background traces. * Add a unit test. * Fix destructor to correctly unregister the MemoryDumpProvider. BUG=705785 ========== to ========== Minor fixes to Mojo MemoryDumpProvider. * Allow values from Mojo MemoryDumpProviders to be captured by slow reports by whitelisting them for background traces. * Add a unit test. * Fix destructor to correctly unregister the MemoryDumpProvider. BUG=705785 Review-Url: https://codereview.chromium.org/2930533003 Cr-Commit-Position: refs/heads/master@{#478327} Committed: https://chromium.googlesource.com/chromium/src/+/337e9da889a1982924a7d730ca3e... ==========
Message was sent while issue was closed.
Committed patchset #4 (id:60001) as https://chromium.googlesource.com/chromium/src/+/337e9da889a1982924a7d730ca3e... |