Closed
Bug 592520
Opened 13 years ago
Closed 13 years ago
Do not fragment the hell out of CACHE__00[1-3]__
Categories
(Core :: Networking: Cache, defect)
Tracking
()
RESOLVED
FIXED
Tracking | Status | |
---|---|---|
blocking2.0 | --- | betaN+ |
People
(Reporter: taras.mozilla, Assigned: taras.mozilla)
References
(Blocks 1 open bug)
Details
Attachments
(2 files, 6 obsolete files)
11.77 KB,
patch
|
taras.mozilla
:
review+
|
Details | Diff | Splinter Review |
709 bytes,
patch
|
taras.mozilla
:
review+
|
Details | Diff | Splinter Review |
No description provided.
Assignee | ||
Comment 1•13 years ago
|
||
This starts the cache files at 1mb. Then grows them by doubling the file size.
Assignee | ||
Comment 2•13 years ago
|
||
This works on Linux/Windows and likely on osx(will test on try)
Attachment #471013 -
Attachment is obsolete: true
Assignee | ||
Updated•13 years ago
|
Attachment #471214 -
Flags: review?(byronm)
Assignee | ||
Updated•13 years ago
|
Attachment #471214 -
Flags: superreview?(benjamin)
Comment 3•13 years ago
|
||
Comment on attachment 471214 [details] [diff] [review] no frags Mac doesn't have posix_fallocate, so the ifdef is definitely incorrect. It's not entirely clear to me whether we expect this method to be unimplemented in normal cases, and whether it's an advisory call or actually changes the file size in important ways. Can you explain (preferably in the doccomment).
Attachment #471214 -
Flags: superreview?(benjamin) → superreview-
Assignee | ||
Comment 4•13 years ago
|
||
Added HAVE_POSIX_FALLOCATE(which turns out to be needed for equivalent functionality in sqlite http://mxr.mozilla.org/mozilla-central/source/db/sqlite3/src/sqlite3.c#25687) + fallback.
Attachment #471214 -
Attachment is obsolete: true
Attachment #471320 -
Flags: review?(benjamin)
Attachment #471214 -
Flags: review?(byronm)
Assignee | ||
Updated•13 years ago
|
Attachment #471320 -
Flags: review?(benjamin)
Assignee | ||
Comment 5•13 years ago
|
||
This passes try.
Attachment #471320 -
Attachment is obsolete: true
Attachment #471714 -
Flags: review?(benjamin)
Updated•13 years ago
|
Blocks: http_cache
Assignee | ||
Comment 6•13 years ago
|
||
Found http://lists.apple.com/archives/darwin-dev/2007/Dec/msg00040.html which seems to show to how to do this on osx so I can avoid the glibc-style workaround and do this properly on all supported platforms.
Comment 7•13 years ago
|
||
Comment on attachment 471714 [details] [diff] [review] no frags with a fallback for posix_fallocate r=me on the XPCOM bits. I did not review the necko bits.
Attachment #471714 -
Flags: review?(benjamin) → review+
Assignee | ||
Comment 8•13 years ago
|
||
Comment on attachment 471714 [details] [diff] [review] no frags with a fallback for posix_fallocate Can you review the network bits? I'd like to land this asap. I found a profile where disk io is magnitudes slower than the network.
Attachment #471714 -
Flags: review?(jduell.mcbugs)
Assignee | ||
Comment 9•13 years ago
|
||
Jason, I've been waiting for a review for a week, can you give me an ETA? I'd like to land this asap.
Assignee | ||
Comment 10•13 years ago
|
||
This is an addon patch that implement low-fragmentation allocation on mac. Trivia: Mac is special in some ways, it allows one to demand a continuous chunk of disk... Which is cool. This allows one to also detect fragmentation. On the other hand ftruncate seems to actually write out zeros to disk instead of doing clever things on fs metadata level.
Attachment #474233 -
Flags: review?(benjamin)
Comment 11•13 years ago
|
||
Blocking per discussion with Taras, high return fix here.
blocking2.0: --- → betaN+
Comment 12•13 years ago
|
||
Comment on attachment 471714 [details] [diff] [review] no frags with a fallback for posix_fallocate >+bool >+nsDiskCacheBlockFile::Write(PRInt32 offset, const void *buf, PRInt32 amount) >+ if (upTo > maxPreallocate) { >+ mFileSize = upTo; >+ } else { >+ // Grow quickly between 1MB to 20MB >+ if (mFileSize) >+ while(mFileSize < upTo) >+ mFileSize *= 2; >+ } So we're doubling file size until we hit 20 MB, then just adding blocks incrementally? It it worth doing continuing to do large fallocates after >20MB, esp on non-OSX? (maybe not always doubling, but at least grabbing big fixed sized amounts). Either way, +r.
Attachment #471714 -
Flags: review?(jduell.mcbugs) → review+
Updated•13 years ago
|
Attachment #474233 -
Flags: review?(benjamin) → review+
Assignee | ||
Comment 13•13 years ago
|
||
Carrying over review from bsmedberg/jduel.
Attachment #471714 -
Attachment is obsolete: true
Attachment #474233 -
Attachment is obsolete: true
Attachment #475666 -
Flags: review+
Assignee | ||
Updated•13 years ago
|
Keywords: checkin-needed
Comment 14•13 years ago
|
||
Comment on attachment 475666 [details] [diff] [review] no frags with a fallback for posix_fallocate/fcntl This patch doesn't have the "start at 4mb, then grow by 4mb after we hit 20 mb" logic we talked about. Another patch coming?
Assignee | ||
Comment 15•13 years ago
|
||
Attachment #475666 -
Attachment is obsolete: true
Attachment #475681 -
Flags: review+
Comment 16•13 years ago
|
||
Comment on attachment 475681 [details] [diff] [review] no frags with a fallback for posix_fallocate/fcntl(for real) So, just to be clear, this patch has the cache file grow in this series: 4, 8, 16, 20, 24, 28, ... Almost doesn't seem worth the fuss to have the doubling logic in place when it's only used once. How about 5 MB units, so 5, 10, 20, 25, 30, ...? I'm still not completely clear on the significance of the 20 MB filesize on OSX. What do we lose after files get bigger than that?
Assignee | ||
Comment 17•13 years ago
|
||
(In reply to comment #16) > Comment on attachment 475681 [details] [diff] [review] > no frags with a fallback for posix_fallocate/fcntl(for real) > > So, just to be clear, this patch has the cache file grow in this series: 4, 8, > 16, 20, 24, 28, ... > > Almost doesn't seem worth the fuss to have the doubling logic in place when > it's only used once. How about 5 MB units, so 5, 10, 20, 25, 30, ...? > > I'm still not completely clear on the significance of the 20 MB filesize on > OSX. What do we lose after files get bigger than that? Can get rid of the doubling logic if you like. So my growing approach minimizes fragmentation, but the file is still likely to be fragmented at least once per growth cycle. ie with your 5mb increment, there would be at least 4 fragments for a 20mb file. So as long as the file is <20mb OSX will turn that into a single fragment.
Comment 18•13 years ago
|
||
http://hg.mozilla.org/mozilla-central/rev/26e2971eeec9
Comment 19•13 years ago
|
||
Attachment #476041 -
Flags: review?
Updated•13 years ago
|
Attachment #476041 -
Flags: review? → review?(tglek)
Assignee | ||
Updated•13 years ago
|
Attachment #476041 -
Flags: review?(tglek) → review+
Assignee | ||
Comment 20•13 years ago
|
||
nonlibxul bustage fix http://hg.mozilla.org/mozilla-central/rev/a9a27874f1c9
You need to log in
before you can comment on or make changes to this bug.
Description
•