Bug 142810

Summary: Prune least valuable cache entries first
Product: WebKit Reporter: Antti Koivisto <koivisto>
Component: Page LoadingAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: barraclough, cdumez
Priority: P2 Keywords: InRadar
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on:    
Bug Blocks: 229003    
Attachments:
Description Flags
patch
none
patch darin: review+

Antti Koivisto
Reported 2015-03-17 22:21:00 PDT
Estimat entry value based on its age and access time.
Attachments
patch (12.49 KB, patch)
2015-03-17 22:41 PDT, Antti Koivisto
no flags
patch (12.41 KB, patch)
2015-03-17 22:53 PDT, Antti Koivisto
darin: review+
Antti Koivisto
Comment 1 2015-03-17 22:41:29 PDT
Antti Koivisto
Comment 2 2015-03-17 22:53:02 PDT
Darin Adler
Comment 3 2015-03-18 08:33:43 PDT
Comment on attachment 248913 [details] patch View in context: https://bugs.webkit.org/attachment.cgi?id=248913&action=review > Source/WebKit2/NetworkProcess/cache/NetworkCacheFileSystemPosix.h:87 > + auto times = fileTimes(path); It’s a little bit irritating that this function calls fileSystemRepresentation on the path twice, allocating two separate C strings. > Source/WebKit2/NetworkProcess/cache/NetworkCacheStorage.cpp:312 > + auto entry = decodeEntry(fileData, channel->fileDescriptor(), read.key); Is there something that guarantees that the file descriptor is still open at this point? Just extending the lifetime of the IOChannel alone doesn’t seem to guarantee that. > Source/WebKit2/NetworkProcess/cache/NetworkCacheStorage.cpp:592 > + if (age <= seconds::zero() || accessAge > age) > + return maximumProbability; No check for accessAge < 0?
Antti Koivisto
Comment 4 2015-03-18 08:58:16 PDT
Comment on attachment 248913 [details] patch View in context: https://bugs.webkit.org/attachment.cgi?id=248913&action=review >> Source/WebKit2/NetworkProcess/cache/NetworkCacheStorage.cpp:312 >> + auto entry = decodeEntry(fileData, channel->fileDescriptor(), read.key); > > Is there something that guarantees that the file descriptor is still open at this point? Just extending the lifetime of the IOChannel alone doesn’t seem to guarantee that. It should, slightly indirectly. File closes when the underlying dispatch_io closes and IOChannel refs it: m_dispatchIO = adoptDispatch(dispatch_io_create(DISPATCH_IO_RANDOM, fd, dispatch_get_main_queue(), [fd](int) { close(fd); }));
Chris Dumez
Comment 5 2015-03-18 09:25:13 PDT
Comment on attachment 248913 [details] patch View in context: https://bugs.webkit.org/attachment.cgi?id=248913&action=review > Source/WebKit2/ChangeLog:5 > + <rdar://problem/19632130> > Source/WebKit2/NetworkProcess/cache/NetworkCacheStorage.cpp:292 > + // We update access time nit: Missing period at the end.
Antti Koivisto
Comment 6 2015-03-18 10:41:33 PDT
Note You need to log in before you can comment on or make changes to this bug.