Welcome! Log In Create A New Profile

Advanced

[PATCH 0/5] staging: zsmalloc: remove SPARSEMEM dependency

Posted by Seth Jennings 
Seth Jennings
[PATCH 0/5] staging: zsmalloc: remove SPARSEMEM dependency
March 05, 2012 06:42PM
This patch series removes the dependency zsmalloc has on SPARSEMEM;
more specifically the assumption that MAX_PHYSMEM_BITS is defined.

Based on greg/staging-next.

Seth Jennings (5):
staging: zsmalloc: move object/handle masking defines
staging: zsmalloc: add ZS_MAX_PAGES_PER_ZSPAGE
staging: zsmalloc: calculate MAX_PHYSMEM_BITS if not defined
staging: zsmalloc: change ZS_MIN_ALLOC_SIZE
staging: zsmalloc: remove SPARSEMEM dep from Kconfig

drivers/staging/zsmalloc/Kconfig | 2 +-
drivers/staging/zsmalloc/zsmalloc-main.c | 14 +---------
drivers/staging/zsmalloc/zsmalloc_int.h | 43 +++++++++++++++++++++++++-----
3 files changed, 38 insertions(+), 21 deletions(-)

--
1.7.5.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
This patch provides a way to determine or "set a
reasonable value for" MAX_PHYSMEM_BITS in the case that
it is not defined (i.e. !SPARSEMEM)

Signed-off-by: Seth Jennings <[email protected]>
---
drivers/staging/zsmalloc/zsmalloc_int.h | 14 ++++++++++++++
1 files changed, 14 insertions(+), 0 deletions(-)

diff --git a/drivers/staging/zsmalloc/zsmalloc_int.h b/drivers/staging/zsmalloc/zsmalloc_int.h
index 4d66d2d..ffb272f 100644
--- a/drivers/staging/zsmalloc/zsmalloc_int.h
+++ b/drivers/staging/zsmalloc/zsmalloc_int.h
@@ -39,7 +39,21 @@
* Note that object index <obj_idx> is relative to system
* page <PFN> it is stored in, so for each sub-page belonging
* to a zspage, obj_idx starts with 0.
+ *
+ * This is made more complicated by various memory models and PAE.
+ */
+
+#ifndef MAX_PHYSMEM_BITS
+#ifdef CONFIG_HIGHMEM64G
+#define MAX_PHYSMEM_BITS 36
+#else /* !CONFIG_HIGHMEM64G */
+/*
+ * If this definition of MAX_PHYSMEM_BITS is used, OBJ_INDEX_BITS will just
+ * be PAGE_SHIFT
*/
+#define MAX_PHYSMEM_BITS BITS_PER_LONG
+#endif
+#endif
#define _PFN_BITS (MAX_PHYSMEM_BITS - PAGE_SHIFT)
#define OBJ_INDEX_BITS (BITS_PER_LONG - _PFN_BITS)
#define OBJ_INDEX_MASK ((_AC(1, UL) << OBJ_INDEX_BITS) - 1)
--
1.7.5.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
On 03/05/2012 12:33 PM, Seth Jennings wrote:

> This patch series removes the dependency zsmalloc has on SPARSEMEM;
> more specifically the assumption that MAX_PHYSMEM_BITS is defined.
>
> Based on greg/staging-next.
>
> Seth Jennings (5):
> staging: zsmalloc: move object/handle masking defines
> staging: zsmalloc: add ZS_MAX_PAGES_PER_ZSPAGE
> staging: zsmalloc: calculate MAX_PHYSMEM_BITS if not defined
> staging: zsmalloc: change ZS_MIN_ALLOC_SIZE
> staging: zsmalloc: remove SPARSEMEM dep from Kconfig
>
> drivers/staging/zsmalloc/Kconfig | 2 +-
> drivers/staging/zsmalloc/zsmalloc-main.c | 14 +---------
> drivers/staging/zsmalloc/zsmalloc_int.h | 43 +++++++++++++++++++++++++-----
> 3 files changed, 38 insertions(+), 21 deletions(-)
>


For the entire series:

Acked-by: Nitin Gupta <[email protected]>


Thanks for the fixes.
Nitin
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Sorry, only registered users may post in this forum.

Click here to login