aboutsummaryrefslogtreecommitdiffstats
path: root/mm
diff options
context:
space:
mode:
authorMinchan Kim <minchan@kernel.org>2014-10-09 15:29:50 -0700
committerAndreas Blaesius <skate4life@gmx.de>2016-06-05 21:21:53 +0200
commitcbf57168504350c48f52dc9476cc0126f0fe16a4 (patch)
tree5d30cfc719c0f5c4c0fcb0d49e3962436161a796 /mm
parent44d313fa11ce166c081dd9556ee89b23643e26a3 (diff)
downloadkernel_samsung_espresso10-cbf57168504350c48f52dc9476cc0126f0fe16a4.zip
kernel_samsung_espresso10-cbf57168504350c48f52dc9476cc0126f0fe16a4.tar.gz
kernel_samsung_espresso10-cbf57168504350c48f52dc9476cc0126f0fe16a4.tar.bz2
zsmalloc: change return value unit of zs_get_total_size_bytes
zs_get_total_size_bytes returns a amount of memory zsmalloc consumed with *byte unit* but zsmalloc operates *page unit* rather than byte unit so let's change the API so benefit we could get is that reduce unnecessary overhead (ie, change page unit with byte unit) in zsmalloc. Since return type is pages, "zs_get_total_pages" is better than "zs_get_total_size_bytes". Signed-off-by: Minchan Kim <minchan@kernel.org> Reviewed-by: Dan Streetman <ddstreet@ieee.org> Cc: Sergey Senozhatsky <sergey.senozhatsky@gmail.com> Cc: Jerome Marchand <jmarchan@redhat.com> Cc: <juno.choi@lge.com> Cc: <seungho1.park@lge.com> Cc: Luigi Semenzato <semenzato@google.com> Cc: Nitin Gupta <ngupta@vflare.org> Cc: Seth Jennings <sjennings@variantweb.net> Cc: David Horner <ds2horner@gmail.com> Cc: Joonsoo Kim <iamjoonsoo.kim@lge.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Conflicts: mm/zsmalloc.c Change-Id: If5697d7b7f8ebaab3b58c1f9f84de747eb909ca3
Diffstat (limited to 'mm')
-rw-r--r--mm/zsmalloc.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/mm/zsmalloc.c b/mm/zsmalloc.c
index e3b6909..8ac9230 100644
--- a/mm/zsmalloc.c
+++ b/mm/zsmalloc.c
@@ -239,7 +239,6 @@ struct mapping_area {
enum zs_mapmode vm_mm; /* mapping mode */
};
-
/* per-cpu VM mapping areas for zspage accesses that cross page boundaries */
static DEFINE_PER_CPU(struct mapping_area, zs_map_area);
@@ -1086,12 +1085,11 @@ void zs_unmap_object(struct zs_pool *pool, unsigned long handle)
}
EXPORT_SYMBOL_GPL(zs_unmap_object);
-u64 zs_get_total_size_bytes(struct zs_pool *pool)
+unsigned long zs_get_total_pages(struct zs_pool *pool)
{
- u64 npages = atomic_long_read(&pool->pages_allocated);
- return npages << PAGE_SHIFT;
+ return atomic_long_read(&pool->pages_allocated);
}
-EXPORT_SYMBOL_GPL(zs_get_total_size_bytes);
+EXPORT_SYMBOL_GPL(zs_get_total_pages);
module_init(zs_init);
module_exit(zs_exit);