Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1242018

Re: [PATCH 1/3] page: add new flags "PG_movable" and add interfaces to control these pages

From "Kirill A. Shutemov" <kirill@shutemov.name>
Newsgroups linux.kernel
Subject Re: [PATCH 1/3] page: add new flags "PG_movable" and add interfaces to control these pages
Date 2015-10-08 09:30 +0200
Message-ID <qhdOi-553-9@gated-at.bofh.it> (permalink)
References <qhduW-4Hx-15@gated-at.bofh.it> <qhdOh-553-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Thu, Oct 08, 2015 at 02:35:50PM +0800, 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);
>  }

That's no-go. We are not going to add three pointers to struct page. It
would cost ~0.5% of system memory.

NAK.

-- 
 Kirill A. Shutemov
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | Next | Find similar | Unroll thread


Thread

Re: [PATCH 1/3] page: add new flags "PG_movable" and add interfaces  to control these pages "Kirill A. Shutemov" <kirill@shutemov.name> - 2015-10-08 09:30 +0200

csiph-web