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

Issue 11649028: Add an IO thread index bitmap to disk cache. (Closed)

Created:
8 years ago by gavinp
Modified:
7 years, 10 months ago
CC:
chromium-reviews, MAD, jar (doing other things), cbentzel+watch_chromium.org, darin-cc_chromium.org, erikwright+watch_chromium.org, Ilya Sherman, gavinp+disk_chromium.org
Visibility:
Public.

Description

Add an IO thread index bitmap to disk cache. Keep a bitmap on the IO thread tracking which cache entries exist, to allow faster cache misses. R=rvargas@chromium.org, felipeg@chromium.org, pasko@google.com BUG=None

Patch Set 1 #

Patch Set 2 : fix control group #

Patch Set 3 : better control group #

Patch Set 4 : more control groups #

Patch Set 5 : better debug #

Patch Set 6 : fix control group #

Patch Set 7 : about:flags it is #

Patch Set 8 : rebase onto trunk #

Patch Set 9 : rebase onto 11649028 #

Patch Set 10 : fix merge #

Patch Set 11 : move bitmap into backend, remove testing code #

Patch Set 12 : narrow slightly #

Patch Set 13 : windows build fix #

Total comments: 14

Patch Set 14 : rebase only #

Patch Set 15 : remediate #

Total comments: 7
Unified diffs Side-by-side diffs Delta from patch set Stats (+68 lines, -1 line) Patch
M net/disk_cache/backend_impl.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 4 chunks +11 lines, -1 line 1 comment Download
M net/disk_cache/backend_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 7 chunks +51 lines, -0 lines 5 comments Download
M net/disk_cache/entry_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +3 lines, -0 lines 1 comment Download
M net/disk_cache/sparse_control.cc View 1 2 3 4 5 6 7 8 9 10 1 chunk +3 lines, -0 lines 0 comments Download

Messages

Total messages: 10 (0 generated)
gavinp
Here's a really sketchy hacked up zero latency cache to play with. Pull this patch ...
8 years ago (2012-12-19 23:02:45 UTC) #1
gavinp
Now control groups are more complex: Control == don't do any fancy stuff with bitmaps. ...
8 years ago (2012-12-20 00:04:00 UTC) #2
gavinp
Merge in https://chromiumcodereview.appspot.com/11633020/ for about:flags joy
8 years ago (2012-12-20 16:16:42 UTC) #3
gavinp
I've rebased this to trunk, and at Egor's request, made this CL dependent on https://chromiumcodereview.appspot.com/11633020/ ...
7 years, 11 months ago (2013-01-06 23:09:11 UTC) #4
gavinp
Ricardo, Egor: PTAL. Just uploaded patch set 12, which narrows this patch to just tracking ...
7 years, 11 months ago (2013-01-21 09:56:49 UTC) #5
rvargas (doing something else)
https://codereview.chromium.org/11649028/diff/34001/net/disk_cache/backend_impl.cc File net/disk_cache/backend_impl.cc (right): https://codereview.chromium.org/11649028/diff/34001/net/disk_cache/backend_impl.cc#newcode432 net/disk_cache/backend_impl.cc:432: int BackendImpl::SyncInit(scoped_refptr<base::MessageLoopProxy> async_thread) { We should be able to ...
7 years, 11 months ago (2013-01-22 22:31:51 UTC) #6
gavinp
Thanks for the review. I will rev this advancing the bitmap corrections on the IO ...
7 years, 11 months ago (2013-01-22 23:15:47 UTC) #7
rvargas (doing something else)
https://codereview.chromium.org/11649028/diff/34001/net/disk_cache/backend_impl.cc File net/disk_cache/backend_impl.cc (right): https://codereview.chromium.org/11649028/diff/34001/net/disk_cache/backend_impl.cc#newcode432 net/disk_cache/backend_impl.cc:432: int BackendImpl::SyncInit(scoped_refptr<base::MessageLoopProxy> async_thread) { On 2013/01/22 23:15:47, gavinp wrote: ...
7 years, 11 months ago (2013-01-22 23:46:14 UTC) #8
gavinp
Ricardo, This should be closer, it's a remediation to your comments. I'm working in the ...
7 years, 10 months ago (2013-02-09 16:46:51 UTC) #9
rvargas (doing something else)
7 years, 10 months ago (2013-02-12 01:58:33 UTC) #10
https://codereview.chromium.org/11649028/diff/34001/net/disk_cache/backend_im...
File net/disk_cache/backend_impl.h (right):

https://codereview.chromium.org/11649028/diff/34001/net/disk_cache/backend_im...
net/disk_cache/backend_impl.h:403: std::vector<bool> index_bitmap_;
On 2013/02/09 16:46:51, gavinp wrote:
> On 2013/01/22 22:31:51, rvargas wrote:
> > use disk_cache::Bitmap instead.
> 
> Can you please tell me more about why this is preferable to the C++ library?

In this particular instance there's probably not that much of a difference
(given that the use pattern is look up one bit, set one bit). But the full
Bitmap class is already linked for this module so it's better to reuse that code
rather than linking another implementation.

https://codereview.chromium.org/11649028/diff/48002/net/disk_cache/backend_im...
File net/disk_cache/backend_impl.cc (right):

https://codereview.chromium.org/11649028/diff/48002/net/disk_cache/backend_im...
net/disk_cache/backend_impl.cc:262: DCHECK_NE(0, bitmap.Size()) << "Call site
should provide default behaviour";
nit: Can we just have the comment in the code (reduce executable size).

https://codereview.chromium.org/11649028/diff/48002/net/disk_cache/backend_im...
net/disk_cache/backend_impl.cc:485: if (!restarted_) {
Maybe we should move this to InitBitmap()

https://codereview.chromium.org/11649028/diff/48002/net/disk_cache/backend_im...
net/disk_cache/backend_impl.cc:492: for (size_t i = 0; i <= mask_; ++i)
nit: int

https://codereview.chromium.org/11649028/diff/48002/net/disk_cache/backend_im...
net/disk_cache/backend_impl.cc:1406: if (index_bitmap_.Size() != 0 &&
!IndexBitmapLookup(index_bitmap_, key)) {
when would Size be 0?

https://codereview.chromium.org/11649028/diff/48002/net/disk_cache/backend_im...
net/disk_cache/backend_impl.cc:1407: VLOG(4) << "BackendImpl::OpenEntry missed
on bitmap";
remove tracing before checking in.

https://codereview.chromium.org/11649028/diff/48002/net/disk_cache/backend_im...
File net/disk_cache/backend_impl.h (right):

https://codereview.chromium.org/11649028/diff/48002/net/disk_cache/backend_im...
net/disk_cache/backend_impl.h:67: // |async_thread| is non null, then |bitmap_|
may be initialized on that
I'm guessing the comment is stale now.

https://codereview.chromium.org/11649028/diff/48002/net/disk_cache/entry_unit...
File net/disk_cache/entry_unittest.cc (right):

https://codereview.chromium.org/11649028/diff/48002/net/disk_cache/entry_unit...
net/disk_cache/entry_unittest.cc:2007: cache_impl_->ClearIndexBitmapForTest();
why is this needed?

Powered by Google App Engine
This is Rietveld 408576698