Skip to content
Newer
Older
100644 54 lines (38 sloc) 1.84 KB
77dde9f multiple cleanups/refactoring, see ChangeLog
Paul Lindner authored Mar 6, 2007
1 /* slabs memory allocation */
d9220d6 Refactor: move the slabs mutex (and all usage of it) into slabs.c
Trond Norbye authored Mar 5, 2009
2 #ifndef SLABS_H
3 #define SLABS_H
77dde9f multiple cleanups/refactoring, see ChangeLog
Paul Lindner authored Mar 6, 2007
4
516e7dc Minimal doxygen configuration
Paul Lindner authored Jul 10, 2007
5 /** Init the subsystem. 1st argument is the limit on no. of bytes to allocate,
6 0 if no limit. 2nd argument is the growth factor; each slab will use a chunk
a6b35b4 Enable use of large memory pages (Trond Norbye) <Trond.Norbye@Sun.COM>
Trond Norbye authored Feb 25, 2008
7 size equal to the previous slab's chunk size times this factor.
8 3rd argument specifies if the slab allocator should allocate all memory
9 up front (if true), or allocate memory in chunks as it is needed (if false)
10 */
11 void slabs_init(const size_t limit, const double factor, const bool prealloc);
77dde9f multiple cleanups/refactoring, see ChangeLog
Paul Lindner authored Mar 6, 2007
12
13
516e7dc Minimal doxygen configuration
Paul Lindner authored Jul 10, 2007
14 /**
77dde9f multiple cleanups/refactoring, see ChangeLog
Paul Lindner authored Mar 6, 2007
15 * Given object size, return id to use when allocating/freeing memory for object
16 * 0 means error: can't store such a large object
17 */
18
19 unsigned int slabs_clsid(const size_t size);
20
516e7dc Minimal doxygen configuration
Paul Lindner authored Jul 10, 2007
21 /** Allocate object of given length. 0 on error */ /*@null@*/
b1debc4 @dormando try harder to save items
dormando authored Oct 9, 2015
22 #define SLABS_ALLOC_NO_NEWPAGE 1
23 void *slabs_alloc(const size_t size, unsigned int id, unsigned int *total_chunks, unsigned int flags);
77dde9f multiple cleanups/refactoring, see ChangeLog
Paul Lindner authored Mar 6, 2007
24
516e7dc Minimal doxygen configuration
Paul Lindner authored Jul 10, 2007
25 /** Free previously allocated object */
d9220d6 Refactor: move the slabs mutex (and all usage of it) into slabs.c
Trond Norbye authored Mar 5, 2009
26 void slabs_free(void *ptr, size_t size, unsigned int id);
77dde9f multiple cleanups/refactoring, see ChangeLog
Paul Lindner authored Mar 6, 2007
27
efad616 @trondn Issue 163: Buggy mem_requested values
trondn authored Nov 12, 2010
28 /** Adjust the stats for memory requested */
29 void slabs_adjust_mem_requested(unsigned int id, size_t old, size_t ntotal);
30
f4a8e7f The slabber is now given a callback to perform binary stats.
Toru Maesaka authored Jul 8, 2008
31 /** Return a datum for stats in binary protocol */
17df5c0 Don't expose the protocol used to the client api of the stats
Trond Norbye authored Apr 2, 2009
32 bool get_stats(const char *stat_type, int nkey, ADD_STAT add_stats, void *c);
4c77f59 Initial attempt of supporting stats in binary protocol.
Toru Maesaka authored Jul 3, 2008
33
516e7dc Minimal doxygen configuration
Paul Lindner authored Jul 10, 2007
34 /** Fill buffer with stats */ /*@null@*/
17df5c0 Don't expose the protocol used to the client api of the stats
Trond Norbye authored Apr 2, 2009
35 void slabs_stats(ADD_STAT add_stats, void *c);
77dde9f multiple cleanups/refactoring, see ChangeLog
Paul Lindner authored Mar 6, 2007
36
fb26989 @dormando first pass at LRU maintainer thread
dormando authored Jan 3, 2015
37 /* Hints as to freespace in slab class */
d6e9646 @dormando first half of new slab automover
dormando authored Sep 29, 2015
38 unsigned int slabs_available_chunks(unsigned int id, bool *mem_flag, unsigned int *total_chunks, unsigned int *chunks_perslab);
fb26989 @dormando first pass at LRU maintainer thread
dormando authored Jan 4, 2015
39
10698ba @dormando slab reassignment
dormando authored Dec 18, 2011
40 int start_slab_maintenance_thread(void);
41 void stop_slab_maintenance_thread(void);
42
43 enum reassign_result_type {
44 REASSIGN_OK=0, REASSIGN_RUNNING, REASSIGN_BADCLASS, REASSIGN_NOSPARE,
423b9fd @dormando remove end_page_ptr business from slabs
dormando authored Jul 14, 2012
45 REASSIGN_SRC_DST_SAME
10698ba @dormando slab reassignment
dormando authored Dec 19, 2011
46 };
47
48 enum reassign_result_type slabs_reassign(int src, int dst);
49
1c94e12 @dormando item locks now lock hash table buckets
dormando authored Aug 18, 2012
50 void slabs_rebalancer_pause(void);
51 void slabs_rebalancer_resume(void);
52
d9220d6 Refactor: move the slabs mutex (and all usage of it) into slabs.c
Trond Norbye authored Mar 5, 2009
53 #endif
Something went wrong with that request. Please try again.