Thread (6 messages) 6 messages, 4 authors, 2015-03-25
STALE4139d

[PATCH 1/2] zsmalloc: do not remap dst page while prepare next src page

From: Sergey Senozhatsky <hidden>
Date: 2015-03-24 15:24:39
Also in: lkml
Subsystem: memory management, the rest, zsmalloc compressed slab memory allocator · Maintainers: Andrew Morton, Linus Torvalds, Minchan Kim, Sergey Senozhatsky

object may belong to different pages. zs_object_copy() handles
this case and maps a new source page (get_next_page() and
kmap_atomic()) when object crosses boundaries of the current
source page. But it also performs unnecessary kunmap/kmap_atomic
of the destination page (it remains unchanged), which can be
avoided.

Signed-off-by: Sergey Senozhatsky <redacted>
---
 mm/zsmalloc.c | 2 --
 1 file changed, 2 deletions(-)
diff --git a/mm/zsmalloc.c b/mm/zsmalloc.c
index d920e8b..7af4456 100644
--- a/mm/zsmalloc.c
+++ b/mm/zsmalloc.c
@@ -1536,12 +1536,10 @@ static void zs_object_copy(unsigned long src, unsigned long dst,
 			break;
 
 		if (s_off + size >= PAGE_SIZE) {
-			kunmap_atomic(d_addr);
 			kunmap_atomic(s_addr);
 			s_page = get_next_page(s_page);
 			BUG_ON(!s_page);
 			s_addr = kmap_atomic(s_page);
-			d_addr = kmap_atomic(d_page);
 			s_size = class->size - written;
 			s_off = 0;
 		} else {
-- 
2.3.4

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help