diff options
-rw-r--r-- | mm/slob.c | 11 |
1 files changed, 9 insertions, 2 deletions
@@ -60,6 +60,8 @@ static DEFINE_SPINLOCK(slob_lock); | |||
60 | static DEFINE_SPINLOCK(block_lock); | 60 | static DEFINE_SPINLOCK(block_lock); |
61 | 61 | ||
62 | static void slob_free(void *b, int size); | 62 | static void slob_free(void *b, int size); |
63 | static void slob_timer_cbk(void); | ||
64 | |||
63 | 65 | ||
64 | static void *slob_alloc(size_t size, gfp_t gfp, int align) | 66 | static void *slob_alloc(size_t size, gfp_t gfp, int align) |
65 | { | 67 | { |
@@ -326,7 +328,7 @@ const char *kmem_cache_name(struct kmem_cache *c) | |||
326 | EXPORT_SYMBOL(kmem_cache_name); | 328 | EXPORT_SYMBOL(kmem_cache_name); |
327 | 329 | ||
328 | static struct timer_list slob_timer = TIMER_INITIALIZER( | 330 | static struct timer_list slob_timer = TIMER_INITIALIZER( |
329 | (void (*)(unsigned long))kmem_cache_init, 0, 0); | 331 | (void (*)(unsigned long))slob_timer_cbk, 0, 0); |
330 | 332 | ||
331 | int kmem_cache_shrink(struct kmem_cache *d) | 333 | int kmem_cache_shrink(struct kmem_cache *d) |
332 | { | 334 | { |
@@ -339,7 +341,12 @@ int kmem_ptr_validate(struct kmem_cache *a, const void *b) | |||
339 | return 0; | 341 | return 0; |
340 | } | 342 | } |
341 | 343 | ||
342 | void kmem_cache_init(void) | 344 | void __init kmem_cache_init(void) |
345 | { | ||
346 | slob_timer_cbk(); | ||
347 | } | ||
348 | |||
349 | static void slob_timer_cbk(void) | ||
343 | { | 350 | { |
344 | void *p = slob_alloc(PAGE_SIZE, 0, PAGE_SIZE-1); | 351 | void *p = slob_alloc(PAGE_SIZE, 0, PAGE_SIZE-1); |
345 | 352 | ||