Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(392)

Issue 2255503002: New cache for the activity tracker. (Closed)

Created:
4 years, 4 months ago by bcwhite
Modified:
4 years, 3 months ago
CC:
chromium-reviews
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

New internal cache (stack) class for recording available memories. This is extracted to its own class for simplicity and ease-of-reuse. It was also originally intended to be a lock-free object but that ended up being overly complicated so has been put on indefinite hold. BUG=620813 Committed: https://crrev.com/4c361942b436b45ddcaab02d6829921b8f3c9e81 Cr-Commit-Position: refs/heads/master@{#416282}

Patch Set 1 #

Patch Set 2 : some clean up #

Total comments: 23

Patch Set 3 : addressed some review comments by manzagop #

Total comments: 1

Patch Set 4 : simplify fifo design #

Total comments: 8

Patch Set 5 : refactor fifo (now queue) to allocate slot before updating it #

Total comments: 8

Patch Set 6 : addressed review comments by manzagop #

Patch Set 7 : fix broken pop operation #

Total comments: 6

Patch Set 8 : new test #

Patch Set 9 : switch from queue to stack (only one atomic pointer) #

Patch Set 10 : fixed some compile problems #

Total comments: 10

Patch Set 11 : comment improvements #

Total comments: 4

Patch Set 12 : more comment improvements #

Total comments: 3

Patch Set 13 : forgo lock-free; use regular lock to create thread-safe stack #

Total comments: 2

Patch Set 14 : fixed comment #

Unified diffs Side-by-side diffs Delta from patch set Stats (+112 lines, -134 lines) Patch
M base/debug/activity_tracker.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 4 chunks +47 lines, -5 lines 0 comments Download
M base/debug/activity_tracker.cc View 1 2 3 4 5 6 7 8 9 10 11 12 4 chunks +62 lines, -127 lines 0 comments Download
M base/debug/activity_tracker_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 2 chunks +3 lines, -2 lines 0 comments Download

Messages

Total messages: 147 (92 generated)
bcwhite
4 years, 4 months ago (2016-08-16 18:44:01 UTC) #21
manzagop (departed)
Nothing of substance but I still need to go over push/pop in detail. https://codereview.chromium.org/2255503002/diff/80001/base/debug/activity_tracker.cc File ...
4 years, 4 months ago (2016-08-16 21:44:32 UTC) #24
manzagop (departed)
https://codereview.chromium.org/2255503002/diff/80001/base/debug/activity_tracker.h File base/debug/activity_tracker.h (right): https://codereview.chromium.org/2255503002/diff/80001/base/debug/activity_tracker.h#newcode151 base/debug/activity_tracker.h:151: // false failure doesn't occur. I'm wondering if there's ...
4 years, 4 months ago (2016-08-16 22:05:00 UTC) #25
bcwhite
https://codereview.chromium.org/2255503002/diff/80001/base/debug/activity_tracker.cc File base/debug/activity_tracker.cc (right): https://codereview.chromium.org/2255503002/diff/80001/base/debug/activity_tracker.cc#newcode506 base/debug/activity_tracker.cc:506: // Get the first available memory from the top ...
4 years, 4 months ago (2016-08-17 19:29:23 UTC) #26
manzagop (departed)
https://codereview.chromium.org/2255503002/diff/80001/base/debug/activity_tracker.h File base/debug/activity_tracker.h (right): https://codereview.chromium.org/2255503002/diff/80001/base/debug/activity_tracker.h#newcode151 base/debug/activity_tracker.h:151: // false failure doesn't occur. On 2016/08/17 19:29:23, bcwhite ...
4 years, 4 months ago (2016-08-18 14:14:46 UTC) #27
bcwhite
https://codereview.chromium.org/2255503002/diff/80001/base/debug/activity_tracker.h File base/debug/activity_tracker.h (right): https://codereview.chromium.org/2255503002/diff/80001/base/debug/activity_tracker.h#newcode50 base/debug/activity_tracker.h:50: template <typename T, size_t SIZE, T INVALID_VALUE> On 2016/08/16 ...
4 years, 4 months ago (2016-08-18 19:26:43 UTC) #29
manzagop (departed)
https://codereview.chromium.org/2255503002/diff/120001/base/debug/activity_tracker.h File base/debug/activity_tracker.h (right): https://codereview.chromium.org/2255503002/diff/120001/base/debug/activity_tracker.h#newcode123 base/debug/activity_tracker.h:123: // Pushing the "invalid" value is not allowed; it ...
4 years, 4 months ago (2016-08-19 20:44:50 UTC) #33
bcwhite
https://codereview.chromium.org/2255503002/diff/120001/base/debug/activity_tracker.h File base/debug/activity_tracker.h (right): https://codereview.chromium.org/2255503002/diff/120001/base/debug/activity_tracker.h#newcode164 base/debug/activity_tracker.h:164: // for this to fail since only one thread ...
4 years, 4 months ago (2016-08-22 12:59:41 UTC) #34
manzagop (departed)
https://codereview.chromium.org/2255503002/diff/120001/base/debug/activity_tracker.h File base/debug/activity_tracker.h (right): https://codereview.chromium.org/2255503002/diff/120001/base/debug/activity_tracker.h#newcode164 base/debug/activity_tracker.h:164: // for this to fail since only one thread ...
4 years, 4 months ago (2016-08-22 14:49:29 UTC) #35
bcwhite
https://codereview.chromium.org/2255503002/diff/120001/base/debug/activity_tracker.h File base/debug/activity_tracker.h (right): https://codereview.chromium.org/2255503002/diff/120001/base/debug/activity_tracker.h#newcode123 base/debug/activity_tracker.h:123: // Pushing the "invalid" value is not allowed; it ...
4 years, 4 months ago (2016-08-23 14:52:38 UTC) #43
manzagop (departed)
lgtm! \o/ https://codereview.chromium.org/2255503002/diff/160001/base/debug/activity_tracker.h File base/debug/activity_tracker.h (right): https://codereview.chromium.org/2255503002/diff/160001/base/debug/activity_tracker.h#newcode195 base/debug/activity_tracker.h:195: PlatformThread::YieldCurrentThread(); Do you need to reload tail ...
4 years, 4 months ago (2016-08-23 16:02:03 UTC) #44
bcwhite
https://codereview.chromium.org/2255503002/diff/160001/base/debug/activity_tracker.h File base/debug/activity_tracker.h (right): https://codereview.chromium.org/2255503002/diff/160001/base/debug/activity_tracker.h#newcode195 base/debug/activity_tracker.h:195: PlatformThread::YieldCurrentThread(); On 2016/08/23 16:02:03, manzagop wrote: > Do you ...
4 years, 4 months ago (2016-08-23 16:12:42 UTC) #47
bcwhite
Alex, would you mind reviewing a lock-free fifo/queue in activity_tracker.h? The reason for not using ...
4 years, 4 months ago (2016-08-23 16:32:55 UTC) #49
Alexander Potapenko
Sorry, heading home already, will take a look tomorrow. +dvyukov@, who is in MTV and ...
4 years, 4 months ago (2016-08-23 16:42:21 UTC) #51
manzagop (departed)
https://codereview.chromium.org/2255503002/diff/160001/base/debug/activity_tracker_unittest.cc File base/debug/activity_tracker_unittest.cc (right): https://codereview.chromium.org/2255503002/diff/160001/base/debug/activity_tracker_unittest.cc#newcode78 base/debug/activity_tracker_unittest.cc:78: while (!queue_->empty()) On 2016/08/23 16:12:41, bcwhite wrote: > On ...
4 years, 4 months ago (2016-08-23 19:46:08 UTC) #62
bcwhite
https://codereview.chromium.org/2255503002/diff/240001/base/debug/activity_tracker.h File base/debug/activity_tracker.h (right): https://codereview.chromium.org/2255503002/diff/240001/base/debug/activity_tracker.h#newcode177 base/debug/activity_tracker.h:177: // In short: deallocate the slot at the tail ...
4 years, 4 months ago (2016-08-23 20:16:27 UTC) #63
bcwhite
https://codereview.chromium.org/2255503002/diff/160001/base/debug/activity_tracker_unittest.cc File base/debug/activity_tracker_unittest.cc (right): https://codereview.chromium.org/2255503002/diff/160001/base/debug/activity_tracker_unittest.cc#newcode78 base/debug/activity_tracker_unittest.cc:78: while (!queue_->empty()) On 2016/08/23 19:46:08, manzagop wrote: > On ...
4 years, 4 months ago (2016-08-23 20:16:46 UTC) #64
manzagop (departed)
https://codereview.chromium.org/2255503002/diff/240001/base/debug/activity_tracker.h File base/debug/activity_tracker.h (right): https://codereview.chromium.org/2255503002/diff/240001/base/debug/activity_tracker.h#newcode177 base/debug/activity_tracker.h:177: // In short: deallocate the slot at the tail ...
4 years, 4 months ago (2016-08-23 21:20:28 UTC) #65
bcwhite
https://codereview.chromium.org/2255503002/diff/240001/base/debug/activity_tracker.h File base/debug/activity_tracker.h (right): https://codereview.chromium.org/2255503002/diff/240001/base/debug/activity_tracker.h#newcode177 base/debug/activity_tracker.h:177: // In short: deallocate the slot at the tail ...
4 years, 4 months ago (2016-08-24 11:56:28 UTC) #66
manzagop (departed)
Could you add in the CL description a short blurb about the problems with the ...
4 years, 4 months ago (2016-08-24 13:17:52 UTC) #67
bcwhite
Added a new parallel pushes & pops test... and found a bug. My understanding of ...
4 years, 4 months ago (2016-08-24 13:41:21 UTC) #70
Alexander Potapenko
Can you please run the linux_tsan trybot?
4 years, 4 months ago (2016-08-24 13:47:01 UTC) #71
bcwhite
On 2016/08/24 13:47:01, Alexander Potapenko wrote: > Can you please run the linux_tsan trybot? Right! ...
4 years, 4 months ago (2016-08-24 14:12:44 UTC) #74
bcwhite
On 2016/08/24 14:12:44, bcwhite wrote: > On 2016/08/24 13:47:01, Alexander Potapenko wrote: > > Can ...
4 years, 3 months ago (2016-08-24 16:19:10 UTC) #76
bcwhite
On 2016/08/24 16:19:10, bcwhite wrote: > On 2016/08/24 14:12:44, bcwhite wrote: > > On 2016/08/24 ...
4 years, 3 months ago (2016-08-24 18:46:08 UTC) #82
Alexander Potapenko
4 years, 3 months ago (2016-08-25 12:13:59 UTC) #92
Alexander Potapenko
To the best of my understanding of "lock-free", this stack isn't lock-free. You're basically locking ...
4 years, 3 months ago (2016-08-25 13:36:08 UTC) #93
bcwhite
Every lock-free algorithm I've seen (though I'm certainly no expert) involves "spinning" or "retry" on ...
4 years, 3 months ago (2016-08-25 14:54:38 UTC) #95
manzagop (departed)
lgtm https://codereview.chromium.org/2255503002/diff/370001/base/debug/activity_tracker.h File base/debug/activity_tracker.h (right): https://codereview.chromium.org/2255503002/diff/370001/base/debug/activity_tracker.h#newcode93 base/debug/activity_tracker.h:93: std::atomic<size_t> head_; // One past the newest value; ...
4 years, 3 months ago (2016-08-25 15:26:55 UTC) #97
bcwhite
https://codereview.chromium.org/2255503002/diff/370001/base/debug/activity_tracker.h File base/debug/activity_tracker.h (right): https://codereview.chromium.org/2255503002/diff/370001/base/debug/activity_tracker.h#newcode93 base/debug/activity_tracker.h:93: std::atomic<size_t> head_; // One past the newest value; where ...
4 years, 3 months ago (2016-08-25 15:53:19 UTC) #100
Alexander Potapenko
On 2016/08/25 14:54:38, bcwhite wrote: > Every lock-free algorithm I've seen (though I'm certainly no ...
4 years, 3 months ago (2016-08-25 16:22:24 UTC) #101
bcwhite
> > Every lock-free algorithm I've seen (though I'm certainly no expert) involves > > ...
4 years, 3 months ago (2016-08-25 17:06:35 UTC) #102
Alexander Potapenko
https://codereview.chromium.org/2255503002/diff/390001/base/debug/activity_tracker.h File base/debug/activity_tracker.h (right): https://codereview.chromium.org/2255503002/diff/390001/base/debug/activity_tracker.h#newcode126 base/debug/activity_tracker.h:126: std::memory_order_acquire, I have a gut feeling that the memory ...
4 years, 3 months ago (2016-08-25 17:07:42 UTC) #103
bcwhite
https://codereview.chromium.org/2255503002/diff/390001/base/debug/activity_tracker.h File base/debug/activity_tracker.h (right): https://codereview.chromium.org/2255503002/diff/390001/base/debug/activity_tracker.h#newcode126 base/debug/activity_tracker.h:126: std::memory_order_acquire, On 2016/08/25 17:07:42, Alexander Potapenko wrote: > I ...
4 years, 3 months ago (2016-08-25 17:19:06 UTC) #104
Alexander Potapenko
@dvyukov: I've read in a couple of places that it's quite hard to make an ...
4 years, 3 months ago (2016-08-25 17:19:29 UTC) #105
Alexander Potapenko
On 2016/08/25 17:19:06, bcwhite wrote: > https://codereview.chromium.org/2255503002/diff/390001/base/debug/activity_tracker.h > File base/debug/activity_tracker.h (right): > > https://codereview.chromium.org/2255503002/diff/390001/base/debug/activity_tracker.h#newcode126 > ...
4 years, 3 months ago (2016-08-25 17:57:25 UTC) #106
bcwhite
On 2016/08/25 17:57:25, Alexander Potapenko wrote: > On 2016/08/25 17:19:06, bcwhite wrote: > > > ...
4 years, 3 months ago (2016-08-25 18:05:41 UTC) #109
Dmitry Vyukov
I can look at it over next few days if you need more eyeballs.
4 years, 3 months ago (2016-08-25 18:11:34 UTC) #110
Dmitry Vyukov
On 2016/08/25 18:11:34, Dmitry Vyukov wrote: > I can look at it over next few ...
4 years, 3 months ago (2016-08-26 09:19:47 UTC) #113
Dmitry Vyukov
On 2016/08/26 09:19:47, Dmitry Vyukov wrote: > On 2016/08/25 18:11:34, Dmitry Vyukov wrote: > > ...
4 years, 3 months ago (2016-08-26 10:37:10 UTC) #114
bcwhite
> Have not looked at the lock-free code itself yet. > It is unclear to ...
4 years, 3 months ago (2016-08-26 14:05:44 UTC) #115
Dmitry Vyukov
On 2016/08/26 14:05:44, bcwhite wrote: > > Have not looked at the lock-free code itself ...
4 years, 3 months ago (2016-08-26 14:21:30 UTC) #116
bcwhite
> > If that's not practical, then yes, there are other ways. Performance is not ...
4 years, 3 months ago (2016-08-26 14:51:46 UTC) #117
Alexander Potapenko
https://codereview.chromium.org/2255503002/diff/390001/base/debug/activity_tracker.cc File base/debug/activity_tracker.cc (right): https://codereview.chromium.org/2255503002/diff/390001/base/debug/activity_tracker.cc#newcode543 base/debug/activity_tracker.cc:543: // Dobule Failure. This shouldn't happen. But be graceful ...
4 years, 3 months ago (2016-08-26 16:26:58 UTC) #118
Alexander Potapenko
On 2016/08/26 14:51:46, bcwhite wrote: > > > If that's not practical, then yes, there ...
4 years, 3 months ago (2016-08-26 16:53:55 UTC) #119
bcwhite
> > Of course. But if one is to create a lock-free cache, why not ...
4 years, 3 months ago (2016-08-26 17:35:48 UTC) #120
Alexander Potapenko
On 2016/08/26 17:35:48, bcwhite wrote: > > > Of course. But if one is to ...
4 years, 3 months ago (2016-08-26 18:14:45 UTC) #121
bcwhite
> > Yup. I looked at some implementation of those. Sadly, nobody ever bother to ...
4 years, 3 months ago (2016-08-26 18:31:55 UTC) #122
Dmitry Vyukov
On 2016/08/26 14:51:46, bcwhite wrote: > > > If that's not practical, then yes, there ...
4 years, 3 months ago (2016-08-27 06:14:23 UTC) #123
bcwhite
Okay, giving up on the lock-free stack/queue concept. I'll just use a regular lock for ...
4 years, 3 months ago (2016-09-01 15:22:30 UTC) #132
manzagop (departed)
lgtm Could you add the motivation to the CL description? https://codereview.chromium.org/2255503002/diff/450001/base/debug/activity_tracker.h File base/debug/activity_tracker.h (right): https://codereview.chromium.org/2255503002/diff/450001/base/debug/activity_tracker.h#newcode550 ...
4 years, 3 months ago (2016-09-01 15:46:48 UTC) #133
bcwhite
https://codereview.chromium.org/2255503002/diff/450001/base/debug/activity_tracker.h File base/debug/activity_tracker.h (right): https://codereview.chromium.org/2255503002/diff/450001/base/debug/activity_tracker.h#newcode550 base/debug/activity_tracker.h:550: // These have to be lock-free because lock activity ...
4 years, 3 months ago (2016-09-02 14:20:36 UTC) #140
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2255503002/470001
4 years, 3 months ago (2016-09-02 15:25:44 UTC) #143
commit-bot: I haz the power
Committed patchset #14 (id:470001)
4 years, 3 months ago (2016-09-02 16:38:51 UTC) #145
commit-bot: I haz the power
4 years, 3 months ago (2016-09-02 16:42:31 UTC) #147
Message was sent while issue was closed.
Patchset 14 (id:??) landed as
https://crrev.com/4c361942b436b45ddcaab02d6829921b8f3c9e81
Cr-Commit-Position: refs/heads/master@{#416282}

Powered by Google App Engine
This is Rietveld 408576698