aboutsummaryrefslogtreecommitdiffstats
path: root/src/statfile.h
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@rambler-co.ru>2012-10-05 20:37:54 +0400
committerVsevolod Stakhov <vsevolod@rambler-co.ru>2012-10-05 20:37:54 +0400
commit21f0f09256917dd5dff8d3cf4680322f96c67b7f (patch)
tree512bff36311841fbd9ac1e3ad91f30f43ae7d3a0 /src/statfile.h
parent3789849b7b2e617d0a287fe77490b6643f3a6b74 (diff)
downloadrspamd-21f0f09256917dd5dff8d3cf4680322f96c67b7f.tar.gz
rspamd-21f0f09256917dd5dff8d3cf4680322f96c67b7f.zip
* Use mlock to speed up classifiers by locking statfiles in the RAM.
Diffstat (limited to 'src/statfile.h')
-rw-r--r--src/statfile.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/statfile.h b/src/statfile.h
index edb58e5db..5f7e856e5 100644
--- a/src/statfile.h
+++ b/src/statfile.h
@@ -94,6 +94,7 @@ typedef struct statfile_pool_s {
memory_pool_mutex_t *lock; /**< mutex */
struct event *invalidate_event; /**< event for pool invalidation */
struct timeval invalidate_tv;
+ gboolean mlock_ok; /**< whether it is possible to use mlock (2) to avoid statfiles unloading */
} statfile_pool_t;
/* Forwarded declarations */
@@ -140,6 +141,12 @@ gint statfile_pool_close (statfile_pool_t *pool, stat_file_t *file, gboolean kee
void statfile_pool_delete (statfile_pool_t *pool);
/**
+ * Try to lock all statfiles in memory
+ * @param pool statfile pool object
+ */
+void statfile_pool_lockall (statfile_pool_t *pool);
+
+/**
* Lock specified file for exclusive use (eg. learning)
* @param pool statfile pool object
* @param filename name of statfile