From ea3e6ca9e595ebfba82b964ee2eaf1ddd7076f0f Mon Sep 17 00:00:00 2001 From: Brian Behlendorf Date: Fri, 30 Jan 2009 20:54:49 -0800 Subject: kmem_cache hardening and performance improvements - Added slab work queue task which gradually ages and free's slabs from the cache which have not been used recently. - Optimized slab packing algorithm to ensure each slab contains the maximum number of objects without create to large a slab. - Fix deadlock, we can never call kv_free() under the skc_lock. We now unlink the objects and slabs from the cache itself and attach them to a private work list. The contents of the list are then subsequently freed outside the spin lock. - Move magazine create/destroy operation on to local cpu. - Further performace optimizations by minimize the usage of the large per-cache skc_lock. This includes the addition of KMC_BIT_REAPING bit mask which is used to prevent concurrent reaping, and to defer new slab creation when reaping is occuring. - Add KMC_BIT_DESTROYING bit mask which is set when the cache is being destroyed, this is used to catch any task accessing the cache while it is being destroyed. - Add comments to all the functions and additional comments to try and make everything as clear as possible. - Major cleanup and additions to the SPLAT kmem tests to more rigerously stress the cache implementation and look for any problems. This includes correctness and performance tests. - Updated portable work queue interfaces --- include/sys/sysmacros.h | 12 ------------ 1 file changed, 12 deletions(-) (limited to 'include/sys/sysmacros.h') diff --git a/include/sys/sysmacros.h b/include/sys/sysmacros.h index 94ff3f84e..b82812385 100644 --- a/include/sys/sysmacros.h +++ b/include/sys/sysmacros.h @@ -203,18 +203,6 @@ extern int ddi_strtoul(const char *str, char **nptr, #define offsetof(s, m) ((size_t)(&(((s *)0)->m))) #endif -#ifdef HAVE_3ARGS_INIT_WORK - -#define spl_init_work(wq,cb,d) INIT_WORK((wq), (void *)(cb), (void *)(d)) -#define spl_get_work_data(type,field,data) (data) - -#else - -#define spl_init_work(wq,cb,d) INIT_WORK((wq), (void *)(cb)); -#define spl_get_work_data(type,field,data) container_of(data,type,field) - -#endif - #ifdef __cplusplus } #endif -- cgit v1.2.3