Thread (17 messages) 17 messages, 1 author, 2016-07-12

[PATCH RT 02/15] mm/zsmalloc: Use get/put_cpu_light in zs_map_object()/zs_unmap_object()

STALE3737d

From: Steven Rostedt <rostedt@goodmis.org>
Date: 2016-07-12 14:29:37
Also in: lkml
Subsystem: memory management, the rest, zsmalloc compressed slab memory allocator · Maintainers: Andrew Morton, Linus Torvalds, Minchan Kim, Sergey Senozhatsky

3.18.36-rt38-rc1 stable review patch.
If anyone has any objections, please let me know.

------------------

From: Mike Galbraith <redacted>

Otherwise, we get a ___might_sleep() splat.

Signed-off-by: Mike Galbraith <redacted>
Signed-off-by: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 mm/zsmalloc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/mm/zsmalloc.c b/mm/zsmalloc.c
index 839a48c3ca27..1db2077e38f7 100644
--- a/mm/zsmalloc.c
+++ b/mm/zsmalloc.c
@@ -1127,7 +1127,7 @@ void *zs_map_object(struct zs_pool *pool, unsigned long handle,
 	class = &pool->size_class[class_idx];
 	off = obj_idx_to_offset(page, obj_idx, class->size);
 
-	area = &get_cpu_var(zs_map_area);
+	area = per_cpu_ptr(&zs_map_area, get_cpu_light());
 	area->vm_mm = mm;
 	if (off + class->size <= PAGE_SIZE) {
 		/* this object is contained entirely within a page */
@@ -1173,7 +1173,7 @@ void zs_unmap_object(struct zs_pool *pool, unsigned long handle)
 
 		__zs_unmap_object(area, pages, off, class->size);
 	}
-	put_cpu_var(zs_map_area);
+	put_cpu_light();
 }
 EXPORT_SYMBOL_GPL(zs_unmap_object);
 
-- 
2.8.1
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help