X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=mm%2Fzsmalloc.c;h=f135b1b6fcdcab49aaf0845e078c6fc299b4b28b;hb=90b0fc26d5dbe21c7a21668320b276af9b2281d7;hp=ce08d043becd22dd65b832cd99d4a617dd53c3c0;hpb=6cbf16b3b66a61b9c6df8f2ed4ac346cb427f28a;p=firefly-linux-kernel-4.4.55.git diff --git a/mm/zsmalloc.c b/mm/zsmalloc.c index ce08d043becd..f135b1b6fcdc 100644 --- a/mm/zsmalloc.c +++ b/mm/zsmalloc.c @@ -288,8 +288,7 @@ static int create_handle_cache(struct zs_pool *pool) static void destroy_handle_cache(struct zs_pool *pool) { - if (pool->handle_cachep) - kmem_cache_destroy(pool->handle_cachep); + kmem_cache_destroy(pool->handle_cachep); } static unsigned long alloc_handle(struct zs_pool *pool) @@ -312,7 +311,8 @@ static void record_obj(unsigned long handle, unsigned long obj) #ifdef CONFIG_ZPOOL -static void *zs_zpool_create(char *name, gfp_t gfp, struct zpool_ops *zpool_ops, +static void *zs_zpool_create(char *name, gfp_t gfp, + const struct zpool_ops *zpool_ops, struct zpool *zpool) { return zs_create_pool(name, gfp); @@ -1710,8 +1710,6 @@ static struct page *isolate_source_page(struct size_class *class) * * Based on the number of unused allocated objects calculate * and return the number of pages that we can free. - * - * Should be called under class->lock. */ static unsigned long zs_can_compact(struct size_class *class) { @@ -1834,9 +1832,7 @@ static unsigned long zs_shrinker_count(struct shrinker *shrinker, if (class->index != i) continue; - spin_lock(&class->lock); pages_to_free += zs_can_compact(class); - spin_unlock(&class->lock); } return pages_to_free;