zsmalloc: introduce zspage structure
[email protected]
maintainerPATCH 49/126 zsmalloc: introduce zspage structure
From: Minchan Kim <[email protected]>
Subject: zsmalloc: introduce zspage structure
We have squeezed meta data of zspage into first page's descriptor. So, to get meta data from subpage, we should get first page first of all. But it makes trouble to implment page migration feature of zsmalloc because any place where to get first page from subpage can be raced with first page migration. IOW, first page it got could be stale. For preventing it, I have tried several approahces but it made code complicated so finally, I concluded to separate metadata from first page. Of course, it consumes more memory. IOW, 16bytes per zspage on 32bit at the moment. It means we lost 1% at *worst case*(40B/4096B) which is not bad I think at the cost of maintenance.
---
mm/compaction.c | 1 mm/zsmalloc.c | 531 ++++++++++++++++++++-------------------------- 2 files changed, 242 insertions(+), 290 deletions(-)
mm/compaction.c renamed from mm/compaction.c~zsmalloc-introduce-zspage-structure +0 -1
@@ -15,7 +15,6 @@#include <linux/backing-dev.h> #include <linux/sysctl.h> #include <linux/sysfs.h> -#include <linux/balloon_compaction.h> #include <linux/page-isolation.h> #include <linux/kasan.h> #include <linux/kthread.h>
mm/zsmalloc.c renamed from mm/zsmalloc.c~zsmalloc-introduce-zspage-structure +242 -289
1,029 lines not on this page · raw message
_