Advise the kernel that we will scan DB files sequentially.
authorMichael Poole <mdpoole@troilus.org>
Wed, 5 Apr 2006 00:11:31 +0000 (00:11 +0000)
committerMichael Poole <mdpoole@troilus.org>
Wed, 5 Apr 2006 00:11:31 +0000 (00:11 +0000)
src/recdb.c (parse_database): Advise the kernel that we will scan the
    recdb file sequentially, just in case it cannot notice the access
    pattern on its own.
git-archimport-id: srvx@srvx.net--2006/srvx--devo--1.3--patch-6

ChangeLog
src/recdb.c

index 973a4e80ceddeb8975877890a3729c5edcd02ee7..8e41512a03d8373b796ec7b5a5355587b00377e3 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,6 +2,21 @@
 # arch-tag: automatic-ChangeLog--srvx@srvx.net--2006/srvx--devo--1.3
 #
 
+2006-04-05 00:11:31 GMT        Michael Poole <mdpoole@troilus.org>     patch-6
+
+    Summary:
+      Advise the kernel that we will scan DB files sequentially.
+    Revision:
+      srvx--devo--1.3--patch-6
+
+    src/recdb.c (parse_database): Advise the kernel that we will scan the
+        recdb file sequentially, just in case it cannot notice the access
+        pattern on its own.
+
+    modified files:
+     ChangeLog src/recdb.c
+
+
 2006-04-05 00:09:48 GMT        Michael Poole <mdpoole@troilus.org>     patch-5
 
     Summary:
index 67c3e7054b195b1ef98ddb0a1fd5854fcee4bd2a..17dbccc958b9f4c85aba4774e45a84745fd3c387 100644 (file)
@@ -621,6 +621,7 @@ parse_database(const char *filename)
     /* Try mmap */
     if (!mmap_error && (recdb.s = mmap(NULL, recdb.length, PROT_READ|PROT_WRITE, MAP_PRIVATE, fileno(recdb.f), 0)) != MAP_FAILED) {
         recdb.type = RECDB_MMAP;
+        madvise(recdb.s, recdb.length, MADV_SEQUENTIAL);
     } else {
         /* Fall back to stdio */
         if (!mmap_error) {