linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Vlastimil Babka <vbabka@suse.cz>
To: Hui Zhu <zhuhui@xiaomi.com>, Minchan Kim <minchan@kernel.org>,
	Nitin Gupta <ngupta@vflare.org>,
	Sergey Senozhatsky <sergey.senozhatsky.work@gmail.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	"Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>,
	Mel Gorman <mgorman@suse.de>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	Johannes Weiner <hannes@cmpxchg.org>,
	Michal Hocko <mhocko@suse.com>,
	Konstantin Khlebnikov <khlebnikov@yandex-team.ru>,
	Andrea Arcangeli <aarcange@redhat.com>,
	Alexander Duyck <alexander.h.duyck@redhat.com>,
	Tejun Heo <tj@kernel.org>, Joonsoo Kim <iamjoonsoo.kim@lge.com>,
	Naoya Horiguchi <n-horiguchi@ah.jp.nec.com>,
	Jennifer Herbert <jennifer.herbert@citrix.com>,
	Hugh Dickins <hughd@google.com>,
	Vladimir Davydov <vdavydov@parallels.com>,
	David Rientjes <rientjes@google.com>,
	Sasha Levin <sasha.levin@oracle.com>,
	"Steven Rostedt (Red Hat)" <rostedt@goodmis.org>,
	"Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com>,
	Wanpeng Li <wanpeng.li@hotmail.com>,
	Geert Uytterhoeven <geert+renesas@glider.be>,
	Greg Thelen <gthelen@google.com>,
	Al Viro <viro@zeniv.linux.org.uk>,
	linux-kernel@vger.kernel.org, linux-mm@kvack.org
Cc: teawater@gmail.com
Subject: Re: [PATCH 1/3] page: add new flags "PG_movable" and add interfaces to control these pages
Date: Thu, 8 Oct 2015 09:23:50 +0200	[thread overview]
Message-ID: <56161A06.4060502@suse.cz> (raw)
In-Reply-To: <1444286152-30175-2-git-send-email-zhuhui@xiaomi.com>

On 10/08/2015 08:35 AM, Hui Zhu wrote:
> This patch add PG_movable to mark a page as movable.
> And when system call migrate function, it will call the interfaces isolate,
> put and migrate to control it.
>
> There is a patch for page migrate interface in LKML.  But for zsmalloc,
> it is too deep inside the file system.  So I add another one.
>
> Signed-off-by: Hui Zhu <zhuhui@xiaomi.com>
> ---
>   include/linux/mm_types.h   |  6 ++++++
>   include/linux/page-flags.h |  3 +++
>   mm/compaction.c            |  6 ++++++
>   mm/debug.c                 |  1 +
>   mm/migrate.c               | 17 +++++++++++++----
>   mm/vmscan.c                |  2 +-
>   6 files changed, 30 insertions(+), 5 deletions(-)
>
> diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h
> index 3d6baa7..132afb0 100644
> --- a/include/linux/mm_types.h
> +++ b/include/linux/mm_types.h
> @@ -12,6 +12,7 @@
>   #include <linux/cpumask.h>
>   #include <linux/uprobes.h>
>   #include <linux/page-flags-layout.h>
> +#include <linux/migrate_mode.h>
>   #include <asm/page.h>
>   #include <asm/mmu.h>
>
> @@ -196,6 +197,11 @@ struct page {
>   #ifdef LAST_CPUPID_NOT_IN_PAGE_FLAGS
>   	int _last_cpupid;
>   #endif
> +
> +	int (*isolate)(struct page *page);
> +	void (*put)(struct page *page);
> +	int (*migrate)(struct page *page, struct page *newpage, int force,
> +		       enum migrate_mode mode);

Three new function pointers in a struct page? No way! Nowadays it has 
around 64 bytes IIRC and we do quite some crazy stuff to keep it packed.
We can't just like this add extra 24 bytes of overhead per 4096 bytes of 
useful data.

>   }
>   /*
>    * The struct page can be forced to be double word aligned so that atomic ops
> diff --git a/include/linux/page-flags.h b/include/linux/page-flags.h
> index 416509e..d91e98a 100644
> --- a/include/linux/page-flags.h
> +++ b/include/linux/page-flags.h
> @@ -113,6 +113,7 @@ enum pageflags {
>   	PG_young,
>   	PG_idle,
>   #endif
> +	PG_movable,		/* MOVABLE */

Page flag space is also a rare resource and we shouldn't add new ones if 
it's possible to do otherwise - and it should be in this case.

Since Sergey already responded to the cover letter with links to the 
prior relevant series, I just wanted to point out the biggest reasons 
why this cannot be accepted technically.

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

  reply	other threads:[~2015-10-08  7:23 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-08  6:35 [RFC 0/3] zsmalloc: make its pages movable Hui Zhu
2015-10-08  6:35 ` [PATCH 1/3] page: add new flags "PG_movable" and add interfaces to control these pages Hui Zhu
2015-10-08  7:23   ` Vlastimil Babka [this message]
2015-10-08  7:24   ` Kirill A. Shutemov
2015-10-08  6:35 ` [PATCH 2/3] zsmalloc: mark its page "PG_movable" Hui Zhu
2015-10-08  6:35 ` [PATCH 3/3] zram: make create "__GFP_MOVABLE" pool Hui Zhu
2015-10-08  7:03 ` [RFC 0/3] zsmalloc: make its pages movable Sergey Senozhatsky

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=56161A06.4060502@suse.cz \
    --to=vbabka@suse.cz \
    --cc=aarcange@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=alexander.h.duyck@redhat.com \
    --cc=aneesh.kumar@linux.vnet.ibm.com \
    --cc=dave.hansen@linux.intel.com \
    --cc=geert+renesas@glider.be \
    --cc=gthelen@google.com \
    --cc=hannes@cmpxchg.org \
    --cc=hughd@google.com \
    --cc=iamjoonsoo.kim@lge.com \
    --cc=jennifer.herbert@citrix.com \
    --cc=khlebnikov@yandex-team.ru \
    --cc=kirill.shutemov@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mgorman@suse.de \
    --cc=mhocko@suse.com \
    --cc=minchan@kernel.org \
    --cc=n-horiguchi@ah.jp.nec.com \
    --cc=ngupta@vflare.org \
    --cc=rientjes@google.com \
    --cc=rostedt@goodmis.org \
    --cc=sasha.levin@oracle.com \
    --cc=sergey.senozhatsky.work@gmail.com \
    --cc=teawater@gmail.com \
    --cc=tj@kernel.org \
    --cc=vdavydov@parallels.com \
    --cc=viro@zeniv.linux.org.uk \
    --cc=wanpeng.li@hotmail.com \
    --cc=zhuhui@xiaomi.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).