[dovecot-cvs] dovecot/src/lib file-cache.c,1.1,1.2
cras at dovecot.org
cras at dovecot.org
Mon Nov 8 03:02:55 EET 2004
- Previous message: [dovecot-cvs] dovecot/src/lib-index mail-cache-fields.c, 1.9,
1.10 mail-cache-transaction.c, 1.32, 1.33 mail-cache.c, 1.52, 1.53
- Next message: [dovecot-cvs] dovecot/src/lib-index mail-cache-sync-update.c, 1.2,
1.3 mail-cache.c, 1.53, 1.54 mail-index-private.h, 1.34,
1.35 mail-index-sync-private.h, 1.15,
1.16 mail-index-sync-update.c, 1.54,
1.55 mail-index-view-sync.c, 1.27, 1.28 mail-index.c, 1.162, 1.163
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Update of /var/lib/cvs/dovecot/src/lib
In directory talvi:/tmp/cvs-serv19145/lib
Modified Files:
file-cache.c
Log Message:
Use madvise(MADV_DONTNEED) for invalidated pages to free memory.
Index: file-cache.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib/file-cache.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- file-cache.c 8 Nov 2004 00:40:36 -0000 1.1
+++ file-cache.c 8 Nov 2004 01:02:52 -0000 1.2
@@ -171,6 +171,15 @@
offset /= page_size;
size -= offset;
+ if (size != 1) {
+ /* tell operating system that we don't need the memory anymore
+ and it may free it. don't bother to do it for single pages,
+ there's a good chance that they get re-read back
+ immediately. */
+ (void)madvise(PTR_OFFSET(cache->mmap_base, offset * page_size),
+ size * page_size, MADV_DONTNEED);
+ }
+
bits = buffer_get_space_unsafe(cache->page_bitmask, offset / CHAR_BIT,
(size + CHAR_BIT - 1) / CHAR_BIT);
- Previous message: [dovecot-cvs] dovecot/src/lib-index mail-cache-fields.c, 1.9,
1.10 mail-cache-transaction.c, 1.32, 1.33 mail-cache.c, 1.52, 1.53
- Next message: [dovecot-cvs] dovecot/src/lib-index mail-cache-sync-update.c, 1.2,
1.3 mail-cache.c, 1.53, 1.54 mail-index-private.h, 1.34,
1.35 mail-index-sync-private.h, 1.15,
1.16 mail-index-sync-update.c, 1.54,
1.55 mail-index-view-sync.c, 1.27, 1.28 mail-index.c, 1.162, 1.163
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the dovecot-cvs
mailing list