From: Michael Poole Date: Wed, 5 Apr 2006 00:11:31 +0000 (+0000) Subject: Advise the kernel that we will scan DB files sequentially. X-Git-Tag: v1.4.0-rc1~150 X-Git-Url: http://git.pk910.de/?p=srvx.git;a=commitdiff_plain;h=dff192d5a04b4c792c2204ae6c5773ca031f0d95 Advise the kernel that we will scan DB files sequentially. 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 --- diff --git a/ChangeLog b/ChangeLog index 973a4e8..8e41512 100644 --- 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 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 patch-5 Summary: diff --git a/src/recdb.c b/src/recdb.c index 67c3e70..17dbccc 100644 --- a/src/recdb.c +++ b/src/recdb.c @@ -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) {