lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <56161A06.4060502@suse.cz>
Date:	Thu, 8 Oct 2015 09:23:50 +0200
From:	Vlastimil Babka <vbabka@...e.cz>
To:	Hui Zhu <zhuhui@...omi.com>, Minchan Kim <minchan@...nel.org>,
	Nitin Gupta <ngupta@...are.org>,
	Sergey Senozhatsky <sergey.senozhatsky.work@...il.com>,
	Andrew Morton <akpm@...ux-foundation.org>,
	"Kirill A. Shutemov" <kirill.shutemov@...ux.intel.com>,
	Mel Gorman <mgorman@...e.de>,
	Dave Hansen <dave.hansen@...ux.intel.com>,
	Johannes Weiner <hannes@...xchg.org>,
	Michal Hocko <mhocko@...e.com>,
	Konstantin Khlebnikov <khlebnikov@...dex-team.ru>,
	Andrea Arcangeli <aarcange@...hat.com>,
	Alexander Duyck <alexander.h.duyck@...hat.com>,
	Tejun Heo <tj@...nel.org>,
	Joonsoo Kim <iamjoonsoo.kim@....com>,
	Naoya Horiguchi <n-horiguchi@...jp.nec.com>,
	Jennifer Herbert <jennifer.herbert@...rix.com>,
	Hugh Dickins <hughd@...gle.com>,
	Vladimir Davydov <vdavydov@...allels.com>,
	David Rientjes <rientjes@...gle.com>,
	Sasha Levin <sasha.levin@...cle.com>,
	"Steven Rostedt (Red Hat)" <rostedt@...dmis.org>,
	"Aneesh Kumar K.V" <aneesh.kumar@...ux.vnet.ibm.com>,
	Wanpeng Li <wanpeng.li@...mail.com>,
	Geert Uytterhoeven <geert+renesas@...der.be>,
	Greg Thelen <gthelen@...gle.com>,
	Al Viro <viro@...iv.linux.org.uk>,
	linux-kernel@...r.kernel.org, linux-mm@...ck.org
Cc:	teawater@...il.com
Subject: Re: [PATCH 1/3] page: add new flags "PG_movable" and add interfaces
 to control these pages

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@...omi.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 from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ