summaryrefslogtreecommitdiffstats
path: root/net/disk_cache/eviction.cc
Commit message (Collapse)AuthorAgeFilesLines
* Disk cache: Fix handling of invalid entries that are detectedrvargas@google.com2009-07-231-10/+16
| | | | | | | | | | | | | | | | | | | | when doing evictions or enumerations. This cl fixes an issue with dirty entries being deleted twice from disk, and improves the whole thing so that different flavors or corrupt entries are removed gracefully. We started deleting things twice when we created the map of currently-open entries, because we don't want to have dirty entries on that map, so it is possible to have multiple EntryImpl objects that refer to the same entry (for corrupt entries). BUG=17474 TEST=Unittests, stress_cache.exe Review URL: http://codereview.chromium.org/155951 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@21360 0039d316-1c4b-4281-b951-d872f2087c98
* Disk cache: Don't evict entries if we are busy doing other stuff.rvargas@google.com2009-07-091-10/+29
| | | | | | | | | BUG=10727 TEST=none Review URL: http://codereview.chromium.org/155314 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@20330 0039d316-1c4b-4281-b951-d872f2087c98
* Disk cache: Keep a map of all open entries.rvargas@google.com2009-07-071-2/+4
| | | | | | | | | | | | | | | | | 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 Review URL: http://codereview.chromium.org/149218 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@20067 0039d316-1c4b-4281-b951-d872f2087c98
* Disk Cache: Split some time histograms in groups basedrvargas@google.com2009-06-251-2/+2
| | | | | | | | | | | on the cache size. BUG=10727 TEST=none Review URL: http://codereview.chromium.org/146129 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@19256 0039d316-1c4b-4281-b951-d872f2087c98
* Disk cache: Avoid recursion when trimming entries.rvargas@google.com2009-06-101-2/+7
| | | | | | | | | | | | | | TrimCacheV2() calls EvictEntry() to move a given entry to the "deleted" list. EvictEntry() deletes the actual data, and that may end up calling ModifyStorageSize() and TrimCacheV2() again. BUG=b/1909376 TEST=none Review URL: http://codereview.chromium.org/121002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@18115 0039d316-1c4b-4281-b951-d872f2087c98
* Disk cache: Report more info from the current experiment.rvargas@google.com2009-06-051-2/+14
| | | | | | | | | BUG=none TEST=none Review URL: http://codereview.chromium.org/119218 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@17772 0039d316-1c4b-4281-b951-d872f2087c98
* Fix a few broken histograms.rvargas@google.com2009-04-301-1/+1
| | | | | | Review URL: http://codereview.chromium.org/99214 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@14984 0039d316-1c4b-4281-b951-d872f2087c98
* Disk cache: Set up a new experiment on the dev channel.rvargas@google.com2009-04-221-2/+30
| | | | | | | | | Enable the new eviction algorithm for 10% of the current users on the dev channel. Review URL: http://codereview.chromium.org/79064 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@14229 0039d316-1c4b-4281-b951-d872f2087c98
* Disk cache: Modify the unit tests so that they test bothrvargas@google.com2009-04-171-1/+0
| | | | | | | | eviction algorithms without having to recompile the code. Review URL: http://codereview.chromium.org/79031 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@13909 0039d316-1c4b-4281-b951-d872f2087c98
* Disk cache: Finish the current experiment.rvargas@google.com2009-04-101-1/+1
| | | | | | Review URL: http://codereview.chromium.org/67046 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@13535 0039d316-1c4b-4281-b951-d872f2087c98
* Disk Cache: Second pass (and final) to allow multiple instancesrvargas@google.com2009-03-271-11/+5
| | | | | | | | | | | | | | | | | | | of BackendImpl. This cl takes care of all the histograms on the disk cache. Most of them have to be splitted in three so that we get separate data from different cache types. There are a few places where the complexity of splitting the histogram is not worth it so we just keep either all data together (if it makes sense), or just ignore data for some types of caches. note: Having multiple versions of a histogram but only one "active" for a given client is not the same as having multiple histograms working at the same time for different objects. Review URL: http://codereview.chromium.org/42682 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@12692 0039d316-1c4b-4281-b951-d872f2087c98
* Disk cache: First pass to make it possible to havervargas@google.com2009-03-251-3/+3
| | | | | | | | | | | | multiple instances of BackendImpl. We need multiple objects to be able to support media files on the cache. After this change, histograms will be the only thing that get messed up by multiple disk caches. Review URL: http://codereview.chromium.org/49027 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@12520 0039d316-1c4b-4281-b951-d872f2087c98
* Disk cache: fix the report of first-eviction data to include onlyrvargas@google.com2009-03-251-1/+1
| | | | | | | | | | new users (so the file format has a valid create_time) Histograms from dev channel (171) are incorrect. Review URL: http://codereview.chromium.org/49032 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@12505 0039d316-1c4b-4281-b951-d872f2087c98
* Add a new histogram macro to replace a few explicit calls.rvargas@google.com2009-03-241-3/+6
| | | | | | | | There is no real change in functionality. Review URL: http://codereview.chromium.org/42514 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@12400 0039d316-1c4b-4281-b951-d872f2087c98
* Disk cache: More instrumentation for the cache.rvargas@google.com2009-03-201-5/+13
| | | | | | | | | | | | | | Now we separate data between before and after the cache is full. Also, reduce the rate at which a particular client sends data to be only once a week. The effect is that the histogram data will only have one value per client, and the same client will not be "voting" on more than one version (release) at the same time. Review URL: http://codereview.chromium.org/50063 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@12218 0039d316-1c4b-4281-b951-d872f2087c98
* Disk cache: First implementation of TrimDeleted() and a fewrvargas@google.com2009-03-181-4/+57
| | | | | | | | | | other fixes related to the new eviction code. As before, almost everything is disabled by default. Review URL: http://codereview.chromium.org/48112 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@11995 0039d316-1c4b-4281-b951-d872f2087c98
* New disk cache eviction algorithm (partial implementation).rvargas@google.com2009-03-061-11/+248
| | | | | | | | | | | | | | | | | | | | | | | | Disabled by a #def. When enabled, file format 2.1 is used, with a possible update from ver 2.0. If a version with this code disabled is run after the upgrade, it will just discard the file and go back to 2.0. We now put some of those extra list to use! Entries are separated into various lists depending on how often are used, and we keep track of previously evicted entries. If the new algorithm is not enabled, most of the code just goes through a different path (with the old code instead of the new one). One notable exception is OpenFollowingEntry, used to enumerate the entries on the cache; the code changed significantly to support the new version of the "cache iterator", but functionally should do the same as the current code. Review URL: http://codereview.chromium.org/27345 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@11145 0039d316-1c4b-4281-b951-d872f2087c98
* Use string for Histogram names since these are all ASCII anyway.dsh@google.com2009-02-241-3/+3
| | | | | | | | Wide-character literals cause problems between platforms. Review URL: http://codereview.chromium.org/28046 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@10276 0039d316-1c4b-4281-b951-d872f2087c98
* Disk cache: move eviction code to a separate file.rvargas@google.com2008-12-181-0/+122
There should be no change in behavior with this CL. Review URL: http://codereview.chromium.org/14183 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@7190 0039d316-1c4b-4281-b951-d872f2087c98