Changeset 80bcaed in mainline for kernel/generic/include/mm/slab.h
- Timestamp:
- 2007-02-03T13:22:24Z (18 years ago)
- Branches:
- lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
- Children:
- f619ec11
- Parents:
- fa8e7d2
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
kernel/generic/include/mm/slab.h
rfa8e7d2 r80bcaed 57 57 58 58 /* slab_reclaim constants */ 59 #define SLAB_RECLAIM_ALL 0x1 /**< Reclaim all possible memory, because we are in memory stress */ 59 60 /** Reclaim all possible memory, because we are in memory stress */ 61 #define SLAB_RECLAIM_ALL 0x1 60 62 61 63 /* cache_create flags */ 62 #define SLAB_CACHE_NOMAGAZINE 0x1 /**< Do not use per-cpu cache */ 63 #define SLAB_CACHE_SLINSIDE 0x2 /**< Have control structure inside SLAB */ 64 #define SLAB_CACHE_MAGDEFERRED (0x4 | SLAB_CACHE_NOMAGAZINE) /**< We add magazine cache later, if we have this flag */ 64 65 /** Do not use per-cpu cache */ 66 #define SLAB_CACHE_NOMAGAZINE 0x1 67 /** Have control structure inside SLAB */ 68 #define SLAB_CACHE_SLINSIDE 0x2 69 /** We add magazine cache later, if we have this flag */ 70 #define SLAB_CACHE_MAGDEFERRED (0x4 | SLAB_CACHE_NOMAGAZINE) 65 71 66 72 typedef struct { … … 82 88 83 89 link_t link; 90 84 91 /* Configuration */ 85 size_t size; /**< Size of slab position - align_up(sizeof(obj)) */ 92 /** Size of slab position - align_up(sizeof(obj)) */ 93 size_t size; 94 86 95 int (*constructor)(void *obj, int kmflag); 87 96 int (*destructor)(void *obj); 88 int flags; /**< Flags changing behaviour of cache */ 97 98 /** Flags changing behaviour of cache */ 99 int flags; 89 100 90 101 /* Computed values */ … … 96 107 atomic_t allocated_objs; 97 108 atomic_t cached_objs; 98 atomic_t magazine_counter; /**< How many magazines in magazines list */ 109 /** How many magazines in magazines list */ 110 atomic_t magazine_counter; 99 111 100 112 /* Slabs */ … … 110 122 } slab_cache_t; 111 123 112 extern slab_cache_t * slab_cache_create(char *name, 113 size_t size, 114 size_t align, 115 int (*constructor)(void *obj, int kmflag), 116 int (*destructor)(void *obj), 117 int flags); 124 extern slab_cache_t * slab_cache_create(char *name, size_t size, size_t align, 125 int (*constructor)(void *obj, int kmflag), int (*destructor)(void *obj), 126 int flags); 118 127 extern void slab_cache_destroy(slab_cache_t *cache); 119 128 … … 122 131 extern count_t slab_reclaim(int flags); 123 132 124 /* * Initialize slab subsytem*/133 /* slab subsytem initialization */ 125 134 extern void slab_cache_init(void); 126 135 extern void slab_enable_cpucache(void);
Note:
See TracChangeset
for help on using the changeset viewer.