linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mm/zsmalloc: fix comment in zsmalloc
@ 2017-02-09  3:23 Yisheng Xie
  2017-02-09  3:55 ` Sergey Senozhatsky
  0 siblings, 1 reply; 2+ messages in thread
From: Yisheng Xie @ 2017-02-09  3:23 UTC (permalink / raw)
  To: akpm
  Cc: linux-mm, linux-kernel, minchan, sergey.senozhatsky, ngupta, guohanjun

The class index and fullness group are not encoded in
(first)page->mapping any more, after commit 3783689a1aa8 ("zsmalloc:
introduce zspage structure"). Instead, they are store in struct zspage.

Cc: Minchan Kim <minchan@kernel.org>
Cc: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
Cc: Nitin Gupta <ngupta@vflare.org>
Cc: Hanjun Guo <guohanjun@huawei.com>
Signed-off-by: Yisheng Xie <xieyisheng1@huawei.com>
---
 mm/zsmalloc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mm/zsmalloc.c b/mm/zsmalloc.c
index 9cc3c0b..4b87225 100644
--- a/mm/zsmalloc.c
+++ b/mm/zsmalloc.c
@@ -270,7 +270,7 @@ struct zs_pool {
 
 /*
  * A zspage's class index and fullness group
- * are encoded in its (first)page->mapping
+ * are stored in struct zspage.
  */
 #define FULLNESS_BITS	2
 #define CLASS_BITS	8
-- 
1.7.12.4

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] mm/zsmalloc: fix comment in zsmalloc
  2017-02-09  3:23 [PATCH] mm/zsmalloc: fix comment in zsmalloc Yisheng Xie
@ 2017-02-09  3:55 ` Sergey Senozhatsky
  0 siblings, 0 replies; 2+ messages in thread
From: Sergey Senozhatsky @ 2017-02-09  3:55 UTC (permalink / raw)
  To: Yisheng Xie
  Cc: akpm, linux-mm, linux-kernel, minchan, sergey.senozhatsky,
	ngupta, guohanjun

On (02/09/17 11:23), Yisheng Xie wrote:
> The class index and fullness group are not encoded in
> (first)page->mapping any more, after commit 3783689a1aa8 ("zsmalloc:
> introduce zspage structure"). Instead, they are store in struct zspage.
> 
> Cc: Minchan Kim <minchan@kernel.org>
> Cc: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
> Cc: Nitin Gupta <ngupta@vflare.org>
> Cc: Hanjun Guo <guohanjun@huawei.com>
> Signed-off-by: Yisheng Xie <xieyisheng1@huawei.com>

no objections from my side.

Reviewed-by: Sergey Senozhatsky <sergey.senozhatsky@gmail.com>




a side note - may be we don't need this comment at all.
the code looks like this:

/*
 * A zspage's class index and fullness group
 * are stored in struct zspage.
 */
#define FULLNESS_BITS	2
#define CLASS_BITS	8
#define ISOLATED_BITS	3
#define MAGIC_VAL_BITS	8

struct zspage {
	struct {
		unsigned int fullness:FULLNESS_BITS;
		unsigned int class:CLASS_BITS;
		unsigned int isolated:ISOLATED_BITS;
		unsigned int magic:MAGIC_VAL_BITS;
	};
	unsigned int inuse;
	unsigned int freeobj;
	struct page *first_page;
	struct list_head list; /* fullness list */
#ifdef CONFIG_COMPACTION
	rwlock_t lock;
#endif
};


so, basically, the comment just "repeats" the next 5 lines.
but, like I said, that's just a side note.

	-ss

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-02-09  4:02 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-02-09  3:23 [PATCH] mm/zsmalloc: fix comment in zsmalloc Yisheng Xie
2017-02-09  3:55 ` Sergey Senozhatsky

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).