Thread (47 messages) 47 messages, 3 authors, 2017-09-28

[PATCHv7 02/19] mm/zsmalloc: Prepare to variable MAX_PHYSMEM_BITS

From: Kirill A. Shutemov <hidden>
Date: 2017-09-18 11:00:50
Also in: lkml
Subsystem: memory management, the rest, zsmalloc compressed slab memory allocator · Maintainers: Andrew Morton, Linus Torvalds, Minchan Kim, Sergey Senozhatsky

With boot-time switching between paging mode we will have variable
MAX_PHYSMEM_BITS.

Let's use the maximum variable possible for CONFIG_X86_5LEVEL=y
configuration to define zsmalloc data structures.

Signed-off-by: Kirill A. Shutemov <redacted>
Cc: Minchan Kim <minchan@kernel.org>
Cc: Nitin Gupta <redacted>
Cc: Sergey Senozhatsky <redacted>
---
 mm/zsmalloc.c | 6 ++++++
 1 file changed, 6 insertions(+)
diff --git a/mm/zsmalloc.c b/mm/zsmalloc.c
index 7c38e850a8fc..fe22661f2fe5 100644
--- a/mm/zsmalloc.c
+++ b/mm/zsmalloc.c
@@ -93,7 +93,13 @@
 #define MAX_PHYSMEM_BITS BITS_PER_LONG
 #endif
 #endif
+
+#ifdef CONFIG_X86_5LEVEL
+/* MAX_PHYSMEM_BITS is variable, use maximum value here */
+#define _PFN_BITS		(52 - PAGE_SHIFT)
+#else
 #define _PFN_BITS		(MAX_PHYSMEM_BITS - PAGE_SHIFT)
+#endif
 
 /*
  * Memory for allocating for handle keeps object position by
-- 
2.14.1

--
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