The patch titled Subject: mm/zsmalloc: allocate exactly size of struct zs_pool has been added to the -mm tree. Its filename is mm-zsmalloc-allocate-exactly-size-of-struct-zs_pool.patch This patch should soon appear at http://ozlabs.org/~akpm/mmots/broken-out/mm-zsmalloc-allocate-exactly-size-of-struct-zs_pool.patch and later at http://ozlabs.org/~akpm/mmotm/broken-out/mm-zsmalloc-allocate-exactly-size-of-struct-zs_pool.patch Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/SubmitChecklist when testing your code *** The -mm tree is included into linux-next and is updated there every 3-4 working days ------------------------------------------------------ From: Ganesh Mahendran <opensource.ganesh@xxxxxxxxx> Subject: mm/zsmalloc: allocate exactly size of struct zs_pool In zs_create_pool(), we allocate memory more then sizeof(struct zs_pool) ovhd_size = roundup(sizeof(*pool), PAGE_SIZE); This patch allocate memory of exactly needed size. Signed-off-by: Ganesh Mahendran <opensource.ganesh@xxxxxxxxx> Acked-by: Minchan Kim <minchan@xxxxxxxxxx> Cc: Nitin Gupta <ngupta@xxxxxxxxxx> Cc: Dan Streetman <ddstreet@xxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- mm/zsmalloc.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff -puN mm/zsmalloc.c~mm-zsmalloc-allocate-exactly-size-of-struct-zs_pool mm/zsmalloc.c --- a/mm/zsmalloc.c~mm-zsmalloc-allocate-exactly-size-of-struct-zs_pool +++ a/mm/zsmalloc.c @@ -979,12 +979,11 @@ static bool can_merge(struct size_class */ struct zs_pool *zs_create_pool(gfp_t flags) { - int i, ovhd_size; + int i; struct zs_pool *pool; struct size_class *prev_class = NULL; - ovhd_size = roundup(sizeof(*pool), PAGE_SIZE); - pool = kzalloc(ovhd_size, GFP_KERNEL); + pool = kzalloc(sizeof(*pool), GFP_KERNEL); if (!pool) return NULL; _ Patches currently in -mm which might be from opensource.ganesh@xxxxxxxxx are zsmalloc-fix-zs_init-cpu-notifier-error-handling.patch zsmalloc-fix-zs_init-cpu-notifier-error-handling-fix-2.patch zsmalloc-fix-zs_init-cpu-notifier-error-handling-fix.patch mm-zsmalloc-support-allocating-obj-with-size-of-zs_max_alloc_size.patch mm-zsmalloc-support-allocating-obj-with-size-of-zs_max_alloc_size-fix.patch mm-zram-correct-zram_zero-flag-bit-position.patch mm-zsmalloc-avoid-duplicate-assignment-of-prev_class.patch mm-zsmalloc-avoid-duplicate-assignment-of-prev_class-fix.patch mm-zsmalloc-allocate-exactly-size-of-struct-zs_pool.patch mm-zswap-add-__init-to-some-functions-in-zswap.patch -- To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html