diff options
author | Seth Jennings <sjenning@linux.vnet.ibm.com> | 2012-07-02 16:15:52 -0500 |
---|---|---|
committer | Ziyan <jaraidaniel@gmail.com> | 2016-01-05 18:21:56 +0100 |
commit | 7b9a73b755eb1fdd31f2f60f062c449ab47c5808 (patch) | |
tree | 9e9bea6ddd250c7842050cc4730cd9ae544dcff6 /drivers/staging | |
parent | 554d91c833ef5fe454b2c23e91ae32b5014df62f (diff) | |
download | kernel_samsung_tuna-7b9a73b755eb1fdd31f2f60f062c449ab47c5808.zip kernel_samsung_tuna-7b9a73b755eb1fdd31f2f60f062c449ab47c5808.tar.gz kernel_samsung_tuna-7b9a73b755eb1fdd31f2f60f062c449ab47c5808.tar.bz2 |
staging: zsmalloc: add mapping modes
This patch improves mapping performance in zsmalloc by getting
usage information from the user in the form of a "mapping mode"
and using it to avoid unnecessary copying for objects that span
pages.
Signed-off-by: Seth Jennings <sjenning@linux.vnet.ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Conflicts:
drivers/staging/zram/zram_drv.c
drivers/staging/zsmalloc/zsmalloc-main.c
drivers/staging/zsmalloc/zsmalloc.h
drivers/staging/zsmalloc/zsmalloc_int.h
Change-Id: I0b7a97e21eb3b26270bd2949697ef6d14bf7ae27
Diffstat (limited to 'drivers/staging')
-rw-r--r-- | drivers/staging/zcache/zcache-main.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/staging/zcache/zcache-main.c b/drivers/staging/zcache/zcache-main.c index 2532c97..752390d 100644 --- a/drivers/staging/zcache/zcache-main.c +++ b/drivers/staging/zcache/zcache-main.c @@ -709,7 +709,7 @@ static unsigned long zv_create(struct zs_pool *pool, uint32_t pool_id, goto out; atomic_inc(&zv_curr_dist_counts[chunks]); atomic_inc(&zv_cumul_dist_counts[chunks]); - zv = zs_map_object(pool, handle); + zv = zs_map_object(pool, handle, ZS_MM_WO); zv->index = index; zv->oid = *oid; zv->pool_id = pool_id; @@ -728,7 +728,7 @@ static void zv_free(struct zs_pool *pool, unsigned long handle) uint16_t size; int chunks; - zv = zs_map_object(pool, handle); + zv = zs_map_object(pool, handle, ZS_MM_RW); ASSERT_SENTINEL(zv, ZVH); size = zv->size + sizeof(struct zv_hdr); INVERT_SENTINEL(zv, ZVH); @@ -750,7 +750,7 @@ static void zv_decompress(struct page *page, unsigned long handle) int ret; struct zv_hdr *zv; - zv = zs_map_object(zcache_host.zspool, handle); + zv = zs_map_object(zcache_host.zspool, handle, ZS_MM_RO); BUG_ON(zv->size == 0); ASSERT_SENTINEL(zv, ZVH); to_va = kmap_atomic(page, KM_USER0); |