Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F152537251
D32249.id96185.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D32249.id96185.diff
View Options
diff --git a/stand/common/bcache.c b/stand/common/bcache.c
--- a/stand/common/bcache.c
+++ b/stand/common/bcache.c
@@ -238,17 +238,27 @@
if (BCACHE_LOOKUP(bc, (daddr_t)(blk + i))) {
bcache_misses += (nblk - i);
complete = 0;
- if (nblk - i > BCACHE_MINREADAHEAD && bc->ra > BCACHE_MINREADAHEAD)
- bc->ra >>= 1; /* reduce read ahead */
break;
} else {
bcache_hits++;
}
}
- if (complete) { /* whole set was in cache, return it */
+ /*
+ * Adjust read-ahead size if appropriate. Subject to the requirement
+ * that bc->ra must stay in between MINREADAHEAD and READAHEAD, we
+ * increase it when we notice that readahead was useful and decrease
+ * it when we notice that readahead was not useful.
+ */
+ if (complete) {
if (bc->ra < BCACHE_READAHEAD)
- bc->ra <<= 1; /* increase read ahead */
+ bc->ra <<= 1; /* increase read ahead */
+ } else {
+ if (nblk - i > BCACHE_MINREADAHEAD && bc->ra > BCACHE_MINREADAHEAD)
+ bc->ra >>= 1; /* reduce read ahead */
+ }
+
+ if (complete) { /* whole set was in cache, return it */
bcopy(bc->bcache_data + (bcache_blksize * BHASH(bc, blk)), buf, size);
goto done;
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Thu, Apr 16, 1:34 PM (15 h, 15 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
31606860
Default Alt Text
D32249.id96185.diff (1 KB)
Attached To
Mode
D32249: loader bcache: Refactor adjustment of ra
Attached
Detach File
Event Timeline
Log In to Comment