+ zsmalloc-fix-obj_to_head-use-page_privatepage-as-value-but-not-pointer.patch added to -mm tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The patch titled
     Subject: zsmalloc: fix obj_to_head use page_private(page) as value but not pointer
has been added to the -mm tree.  Its filename is
     zsmalloc-fix-obj_to_head-use-page_privatepage-as-value-but-not-pointer.patch

This patch should soon appear at
    http://ozlabs.org/~akpm/mmots/broken-out/zsmalloc-fix-obj_to_head-use-page_privatepage-as-value-but-not-pointer.patch
and later at
    http://ozlabs.org/~akpm/mmotm/broken-out/zsmalloc-fix-obj_to_head-use-page_privatepage-as-value-but-not-pointer.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: Hui Zhu <zhuhui@xxxxxxxxxx>
Subject: zsmalloc: fix obj_to_head use page_private(page) as value but not pointer

In obj_malloc():

	if (!class->huge)
		/* record handle in the header of allocated chunk */
		link->handle = handle;
	else
		/* record handle in first_page->private */
		set_page_private(first_page, handle);

In the hugepage we save handle to private directly.

But in obj_to_head():

	if (class->huge) {
		VM_BUG_ON(!is_first_page(page));
		return *(unsigned long *)page_private(page);
	} else
		return *(unsigned long *)obj;

It is used as a pointer.

The reason why there is no problem until now is huge-class page is born
with ZS_FULL so it can't be migrated.  However, we need this patch for
future work: "VM-aware zsmalloced page migration" to reduce external
fragmentation.

Signed-off-by: Hui Zhu <zhuhui@xxxxxxxxxx>
Acked-by: Minchan Kim <minchan@xxxxxxxxxx>
Cc: Sergey Senozhatsky <sergey.senozhatsky@xxxxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
---

 mm/zsmalloc.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff -puN mm/zsmalloc.c~zsmalloc-fix-obj_to_head-use-page_privatepage-as-value-but-not-pointer mm/zsmalloc.c
--- a/mm/zsmalloc.c~zsmalloc-fix-obj_to_head-use-page_privatepage-as-value-but-not-pointer
+++ a/mm/zsmalloc.c
@@ -825,7 +825,7 @@ static unsigned long obj_to_head(struct
 {
 	if (class->huge) {
 		VM_BUG_ON(!is_first_page(page));
-		return *(unsigned long *)page_private(page);
+		return page_private(page);
 	} else
 		return *(unsigned long *)obj;
 }
_

Patches currently in -mm which might be from zhuhui@xxxxxxxxxx are

zsmalloc-add-comments-for-inuse-to-zspage.patch
zsmalloc-fix-obj_to_head-use-page_privatepage-as-value-but-not-pointer.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



[Index of Archives]     [Kernel Newbies FAQ]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Photo]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux