summaryrefslogtreecommitdiff
path: root/slabs.h
diff options
context:
space:
mode:
authordormando <dormando@rydia.net>2011-12-18 22:53:10 -0800
committerdormando <dormando@rydia.net>2011-12-19 17:53:22 -0800
commit10698bae63a034c14d2fdbc3027a1308ce90faba (patch)
tree7a147adb894d0fa0ca3a2165424a8f516a6aa320 /slabs.h
parent40b7b4b2b62d67062eb536cb5395e74172c0c31c (diff)
downloadmemcached-10698bae63a034c14d2fdbc3027a1308ce90faba.tar.gz
slab reassignment
Adds a "slabs reassign src dst" manual command, and a thread to safely process slab moves in the background. - slab freelist is now a linked list, reusing the item structure - is -o slab_reassign is enabled, an extra background thread is started - thread attempts to safely free up items when it's been told to move a page from one slab to another. -o slab_automove is stubbed. There are some limitations. Most notable is that you cannot repeatedly move pages around without first having items use up the memory. Slabs with newly assigned memory work off of a pointer, handing out chunks individually. We would need to change that to quickly split chunks for all newly assigned pages into that slabs freelist. Further testing is required to ensure such is possible without impacting performance.
Diffstat (limited to 'slabs.h')
-rw-r--r--slabs.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/slabs.h b/slabs.h
index 21da116..ea83e45 100644
--- a/slabs.h
+++ b/slabs.h
@@ -33,4 +33,14 @@ bool get_stats(const char *stat_type, int nkey, ADD_STAT add_stats, void *c);
/** Fill buffer with stats */ /*@null@*/
void slabs_stats(ADD_STAT add_stats, void *c);
+int start_slab_maintenance_thread(void);
+void stop_slab_maintenance_thread(void);
+
+enum reassign_result_type {
+ REASSIGN_OK=0, REASSIGN_RUNNING, REASSIGN_BADCLASS, REASSIGN_NOSPARE,
+ REASSIGN_DEST_NOT_FULL, REASSIGN_SRC_NOT_SAFE
+};
+
+enum reassign_result_type slabs_reassign(int src, int dst);
+
#endif