Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1335997

[PATCH] zsmalloc: drop unused member 'mapping_area->huge'

From YiPing Xu <xuyiping@huawei.com>
Newsgroups linux.kernel
Subject [PATCH] zsmalloc: drop unused member 'mapping_area->huge'
Date 2016-02-17 03:00 +0100
Message-ID <r2Zzl-7EN-17@gated-at.bofh.it> (permalink)
Organization linux.* mail to news gateway

Show all headers | View raw


When unmapping a huge class page in zs_unmap_object, the page will
be unmapped by kmap_atomic. the "!area->huge" branch in
__zs_unmap_object is alway true, and no code set "area->huge" now,
so we can drop it.

Signed-off-by: YiPing Xu <xuyiping@huawei.com>
---
 mm/zsmalloc.c | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/mm/zsmalloc.c b/mm/zsmalloc.c
index 2d7c4c1..43e4cbc 100644
--- a/mm/zsmalloc.c
+++ b/mm/zsmalloc.c
@@ -281,7 +281,6 @@ struct mapping_area {
 #endif
 	char *vm_addr; /* address of kmap_atomic()'ed pages */
 	enum zs_mapmode vm_mm; /* mapping mode */
-	bool huge;
 };
 
 static int create_handle_cache(struct zs_pool *pool)
@@ -1127,11 +1126,9 @@ static void __zs_unmap_object(struct mapping_area *area,
 		goto out;
 
 	buf = area->vm_buf;
-	if (!area->huge) {
-		buf = buf + ZS_HANDLE_SIZE;
-		size -= ZS_HANDLE_SIZE;
-		off += ZS_HANDLE_SIZE;
-	}
+	buf = buf + ZS_HANDLE_SIZE;
+	size -= ZS_HANDLE_SIZE;
+	off += ZS_HANDLE_SIZE;
 
 	sizes[0] = PAGE_SIZE - off;
 	sizes[1] = size - sizes[0];
-- 
1.8.3.2

Back to linux.kernel | Previous | NextNext in thread | Find similar | Unroll thread


Thread

[PATCH] zsmalloc: drop unused member 'mapping_area->huge' YiPing Xu <xuyiping@huawei.com> - 2016-02-17 03:00 +0100
  Re: [PATCH] zsmalloc: drop unused member 'mapping_area->huge' Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com> - 2016-02-17 03:30 +0100
    Re: [PATCH] zsmalloc: drop unused member 'mapping_area->huge' xuyiping <xuyiping@hisilicon.com> - 2016-02-17 04:40 +0100
      Re: [PATCH] zsmalloc: drop unused member 'mapping_area->huge' Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com> - 2016-02-17 05:00 +0100
  Re: [PATCH] zsmalloc: drop unused member 'mapping_area->huge' Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com> - 2016-02-17 06:20 +0100
  Re: [PATCH] zsmalloc: drop unused member 'mapping_area->huge' Minchan Kim <minchan@kernel.org> - 2016-02-17 16:40 +0100

csiph-web