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

Issue 149218: Disk cache: Keep a map of all open entries.... (Closed)

Created:
11 years, 5 months ago by rvargas (doing something else)
Modified:
9 years, 6 months ago
Reviewers:
Nicolas Sylvain
CC:
chromium-reviews_googlegroups.com, darin (slow to review), willchan no longer on Chromium
Visibility:
Public.

Description

Disk cache: Keep a map of all open entries. We still have a few crashes when for some reason we believe an entry is not dirty and we follow the pointer stored by its rankings node only to crash while accessing the memory. I have no explanation to why the dirty id matches the current one (a page boundary issue maybe?), but having a map with all open entries solves the issue of having to follow pointers from disk. BUG=15596 , b/1120346 TEST=unittests Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=20067

Patch Set 1 #

Patch Set 2 : '' #

Patch Set 3 : '' #

Total comments: 4
Unified diffs Side-by-side diffs Delta from patch set Stats (+162 lines, -40 lines) Patch
A net/data/cache_tests/dirty_entry2/contents.txt View 1 chunk +67 lines, -0 lines 0 comments Download
A net/data/cache_tests/dirty_entry2/data_0 View Binary file 0 comments Download
A net/data/cache_tests/dirty_entry2/data_1 View Binary file 0 comments Download
A net/data/cache_tests/dirty_entry2/data_2 View Binary file 0 comments Download
A net/data/cache_tests/dirty_entry2/data_3 View Binary file 0 comments Download
A net/data/cache_tests/dirty_entry2/index View Binary file 0 comments Download
M net/disk_cache/backend_impl.h View 4 chunks +11 lines, -2 lines 0 comments Download
M net/disk_cache/backend_impl.cc View 1 6 chunks +45 lines, -5 lines 4 comments Download
M net/disk_cache/backend_unittest.cc View 3 chunks +14 lines, -5 lines 0 comments Download
M net/disk_cache/entry_impl.h View 1 chunk +4 lines, -4 lines 0 comments Download
M net/disk_cache/entry_impl.cc View 1 2 chunks +13 lines, -20 lines 0 comments Download
M net/disk_cache/eviction.cc View 2 chunks +4 lines, -2 lines 0 comments Download
M net/disk_cache/rankings.cc View 1 chunk +4 lines, -2 lines 0 comments Download

Messages

Total messages: 4 (0 generated)
rvargas (doing something else)
The first patch set is the core of the change. The second one is some ...
11 years, 5 months ago (2009-07-07 00:21:27 UTC) #1
Nicolas Sylvain
LGTM http://codereview.chromium.org/149218/diff/1009/1011 File net/disk_cache/backend_impl.cc (right): http://codereview.chromium.org/149218/diff/1009/1011#newcode727 Line 727: EntriesMap::iterator it = open_entries_.find(address.value()); why would it ...
11 years, 5 months ago (2009-07-07 17:47:14 UTC) #2
rvargas (doing something else)
Thanks. http://codereview.chromium.org/149218/diff/1009/1011 File net/disk_cache/backend_impl.cc (right): http://codereview.chromium.org/149218/diff/1009/1011#newcode727 Line 727: EntriesMap::iterator it = open_entries_.find(address.value()); On 2009/07/07 17:47:14, ...
11 years, 5 months ago (2009-07-07 18:13:24 UTC) #3
Nicolas Sylvain
11 years, 5 months ago (2009-07-07 18:38:22 UTC) #4
On Tue, Jul 7, 2009 at 11:13 AM, <rvargas@chromium.org> wrote:

> Thanks.
>
>
> http://codereview.chromium.org/149218/diff/1009/1011
> File net/disk_cache/backend_impl.cc (right):
>
> http://codereview.chromium.org/149218/diff/1009/1011#newcode727
> Line 727: EntriesMap::iterator it = open_entries_.find(address.value());
> On 2009/07/07 17:47:14, Nicolas Sylvain wrote:
>
>> why would it not be in the map? dirty maybe? should we dcheck when
>>
> it's not?
>
> Yes and no. We don't store dirty entries in the map, but it should be a
> frequent thing to open dirty entries so we cannot dcheck here (the dirty
> flag is cleared before the destruction of the entry)
>
> http://codereview.chromium.org/149218/diff/1009/1011#newcode1163
> Line 1163: cache_entry = NULL;
> On 2009/07/07 17:47:14, Nicolas Sylvain wrote:
>
>> do you really need this here? since you do it below too. Well, i guess
>>
> it makes
>
>> it clearer.
>>
>
> if I don't set it to null, we'll copy an invalid pointer into
> parent_entry.


ah, got it, lgtm


> I guess that now we have more calls to Release() than
> assignments to plain pointers so I could see how this function looks
> after replacing cache_entry and parent_entry with scoped pointers, but
> I'll leave that for another cl.
>
>
> http://codereview.chromium.org/149218
>

Powered by Google App Engine
This is Rietveld 408576698