Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1162310AbdDURIZ (ORCPT ); Fri, 21 Apr 2017 13:08:25 -0400 Received: from mail-sn1nam02on0090.outbound.protection.outlook.com ([104.47.36.90]:4329 "EHLO NAM02-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1422761AbdDURIT (ORCPT ); Fri, 21 Apr 2017 13:08:19 -0400 Authentication-Results: linux.vnet.ibm.com; dkim=none (message not signed) header.d=none;linux.vnet.ibm.com; dmarc=none action=none header.from=cs.rutgers.edu; Message-ID: <58FA2C9C.5030107@cs.rutgers.edu> Date: Fri, 21 Apr 2017 11:00:28 -0500 From: Zi Yan User-Agent: Postbox 5.0.12 (Windows/20170323) MIME-Version: 1.0 To: Anshuman Khandual CC: Zi Yan , n-horiguchi@ah.jp.nec.com, kirill.shutemov@linux.intel.com, linux-kernel@vger.kernel.org, linux-mm@kvack.org, akpm@linux-foundation.org, minchan@kernel.org, vbabka@suse.cz, mgorman@techsingularity.net, mhocko@kernel.org, dnellans@nvidia.com Subject: Re: [PATCH v5 09/11] mm: mempolicy: mbind and migrate_pages support thp migration References: <20170420204752.79703-1-zi.yan@sent.com> <20170420204752.79703-10-zi.yan@sent.com> <1ebd80d1-7bb1-db6d-a60c-7f4b7b6afe0f@linux.vnet.ibm.com> In-Reply-To: <1ebd80d1-7bb1-db6d-a60c-7f4b7b6afe0f@linux.vnet.ibm.com> X-Enigmail-Version: 1.2.3 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="------------enig205088B714ED82955BB884A6" X-Originating-IP: [12.1.252.66] X-ClientProxiedBy: DM3PR12CA0060.namprd12.prod.outlook.com (10.161.151.28) To MWHPR14MB1662.namprd14.prod.outlook.com (10.171.146.144) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 15f96c50-50af-4189-4017-08d488cf8b68 X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001)(201703131423075)(201703031133081);SRVR:MWHPR14MB1662; X-Microsoft-Exchange-Diagnostics: 1;MWHPR14MB1662;3:e2WIKLSZMyEYAkEg4+Sc3ZPfVlX1Gqo9G270TTyjVBnvFJrSUe/QEXdxxCPRq7M30Frp8zlSOZjhpesQzu68mpU7e6Pb8zlOAuKJ+xIfHSVX+I0EbFaEmjdqB/i18YwPehD3F8tz4bsoSUA6f/TAEUff7z5yhyHy5kBLFDvBxQkybyVimV2iS+M1wF5536i9QqvRzpzOM6MoBGavVaEic2ro+IKD55uGFR2DsaiV4pF+OvxzAlZpE7OBZwRT75DCRr/A3H2XiEziS8rhti3hOyYS0lX/Bw/PlYG4IvO0Zg3I/tyonrT6ssASwQj8DKijuaTDI5yuozdXByVs0vX0Pw==;25:mg2KaPvizdOa3Lw1mhuHwStErT7oCdkIsvyuhYPwQLxUOqoPNffJqyv4CMxIH+dtwDupjocqR14C57PA+Sg+DX3H2PssKkJMrNkQBNgJXTjzgXQWBx+ZD0NZQlmp8wTwulfPufMWx/MT75PhGgQyV43tXC7CFzUVIs4Oe2gbB+sSOetTdrBKne8upQq0wtyWAFFEtl40v7fSKmelakYOeb+Ip30kmWy8LyAwmO+hIpt1Qy0TvoUHDZgp3o70PmTY3nE+M53jClvBoA7Bw+t6YrIwBJtAjM6sGPGJHNOW203dcz1ZR0tGMb4PrlrzlKhWKXHs80jw3FLnNKMv5BL7BHTl9LDuiLvI2sXgr9Uvhn20dKbIAoUjjhyMjiAzYA3/aV48Zdk6tusHsT52DfWoW5LCYcKTXMyOnnHfllCr4t62flStk7dMgguP4j5klxbELChq9+8ogXVJy2+2rbVsQQ== X-Microsoft-Exchange-Diagnostics: 1;MWHPR14MB1662;31:Cs30wxeLAoC06SHWYyKJ5IbhLuFDoo+lnClsb041qUllxhfHk9Dl2WMIjGm82uaxlo41ghX9cLRQrVdaO+ESsFc/NjEQMcyu31fn0OP4ovPjNH4wCtP94joO4YV4lRYgR97wvo1o0BAhwTV1ObtRnr7x70BM2pNdZtPx1QygS/IyJdb/wabwQSG3dZ+spjjcf/Sn6nmjr1aBMaW+9KfQN87Wj3Vec38NWPIycmjknAw=;20:Juh9OjQre+aPKRKrN00NC6k8o/Ti03ngfBjYzvrlxudcyVQqsduSDNwDQqTeWIDZH5Jq2pTJtX1ssRhMfbFs9EcmRIgvqgs1PlKJgVxkMnuvmcTY9Drd1xnvpYWxBs0xCgqflwEXx+EWvCCxptdhAIAU8lzup3SuL+F9lB9FB5hyx3SrMHz8nSOW9sEgi7zJUtniS4riLxQ2834WH/msqURer0VUXSWTEIcw+XDwzsykIZcQkpllZ58FJgkIpls3n8MkqNYgFGT7QLSoptox6GWwS5y6aSYma/UkMNwYuAho1rUabbnRG8El9b/dDlxLJx9EJ+wuJH4Sp2Ihrw/dG/tRyoGiNqU4R2ezx+SEz+O9BRomLlLadQpx03nIszfwylYgueAa4BNFfUycNEOpdzEtDs8XmGqN0hqr593FZkwkh7nKl1r2dRp1RFQCWwDyMP9FHzQUFliYhaddi4K26yhCyHDfbWzA1HC+L7j5Xu/kiZyQLAFoipRbpIAq4+XM X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(6040450)(601004)(2401047)(8121501046)(5005006)(3002001)(93006095)(93001095)(10201501046)(6041248)(201703131423075)(201702281529075)(201702281528075)(201703061421075)(20161123560025)(20161123564025)(20161123562025)(20161123555025)(6072148);SRVR:MWHPR14MB1662;BCL:0;PCL:0;RULEID:;SRVR:MWHPR14MB1662; X-Microsoft-Exchange-Diagnostics: 1;MWHPR14MB1662;4:bEtg0WbfYwll+c9WrY+WjxzVZ1js1WeAz4aE4O7TFLE4wGsQ+eaJBuu2qA6gYpijKqzBO+Ckt/k7InppABX9zgq9Ra9giuP3CBBJIcxF/ObjWtrNTfBUyI0SWqwjT6bEDnhalPtIFDJFVDIUGUX5cJZKxdFIUIIwwKL9O4UmbAX4UKsTCi0E1Od6qEP5kThHcfRJRlW+h5W/k2IhjsuQY/uwy3co3jiMrhZwRdf5Pj+X3pL8+W7MgY+9GOtnSk+Xa9dkkvpiOjCMg3DBQu2fyWneVJf2zAIBsXkv7fBXLxNXyA8/5xXyZuBRd2vL3Rniry84sDY2S3a2m9hpAJd1fdUKWW1Q4317dMzFeZF8BRtECQ/X08+CTaLXtA453gvM29nS6kmSOllrIsPncKSILs5jtSKYeZVhkocy9mxjUMSGCXRYIS1ewsphUVSXKGs4SNTYDADbt65N0lpZJixWZ+agiaKoXdQSorTQT5L4qvbU/pSokskg6vMUZW1HfYTWWjdkPkn8WNrOrtZv7dXqCJKDRWxt6ugBc4vU5iSM5Cgr/YbIPUcAr2gdOZVhExiFlvwmJibKJsCc5Nbf/JHY3cOW6aEzQHWk6ZciE0lmiG6bU9zcvP3eZODt5kSS4HABg7UyVS9jv+gzp+RcMJUs1w5FUc7Wg4hNnmdMKKljH3Xb979ffbVLZfDPGRgocUCsTQAXN18kN/i9f8r/3RkoLkeG1EMJ/346hr82NtFXk0rDqDjFfxcDjL26gj9kxznz X-Forefront-PRVS: 02843AA9E0 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10019020)(4630300001)(6049001)(6009001)(39840400002)(39860400002)(39410400002)(39850400002)(39450400003)(39400400002)(377454003)(24454002)(77096006)(65816999)(59896002)(87266999)(33656002)(81166006)(38730400002)(66066001)(568964002)(110136004)(76176999)(54356999)(90366009)(6486002)(189998001)(75432002)(50986999)(21480400002)(229853002)(8656002)(8676002)(42186005)(2950100002)(86362001)(6116002)(2906002)(3846002)(42882006)(6916009)(6666003)(88552002)(80316001)(4001350100001)(5660300001)(53936002)(84326002)(83506001)(25786009)(7416002)(53546009)(4326008)(305945005)(7736002)(6246003)(5890100001);DIR:OUT;SFP:1102;SCL:1;SRVR:MWHPR14MB1662;H:[10.20.179.35];FPR:;SPF:None;MLV:sfv;LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;MWH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AOZeLNUnWBxgfP/af8/E0BJ9NqFu3pVGMbBXkmyqtZFDQLB6Ksa6cfAE8D4PWIqezchmkuyahtjl6hpvzZj5MQR+VK5rKbgjs4A3dGe9JLZJqsEvMHDqDSsbodvA==;5:uh2aLzYCdxYAiXxCJVDbJwair1YSpDEUFgyAyKoVYqu7yB77aQey/qUsWXaiQjTBRaofI57JR+Q9TwI0BKacyldKTospSL8RXFNuNjjGIs5tNGcm4oSa4AOP9KbQTq3f+CPi1KlcSTuubu70T054EA==;24:F9t2FeMXmFNZQP6aCu7HMsYWXXoQND3QBqL2ieaDDDcHiEEuIOcBqNR0CphnqpZ+9aNjyTGpb0K7iz/HCtK5mSw6wIAoN/UkV75lfah4Q10= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;MWHPR14MB1662;7:FWG7/Qkv702PUsJpBDCtYrmvnQTNpoqrBCqrsIW95hO7k9n7+0rnGykzmfmq/dIXqkl9o+/QM5LBaY4qfLPrYaf3RgTqduL/Ifg4ak3O1MEy7ISftgdso5DDopDCjAtu75RXqSl5SpfGv/vn9vvrUWlK2iGB0gjMi29JXjvvWLIvoBE3yedKqliMVabB8ILStuD4BXhoRIIDgx5bss9wnxKCLb3BuCtpR48GuqF9w4nZhw/pMF7uk1WGmUM0siLJmZX2b1Bwy1Ise0wmR63RZt3USDLxvG4LazxX0a0aDswC9xZ8m0ZOzRf5XeAIl1u3YPmvhOwhsUgbyGz3gKY+jw== X-OriginatorOrg: cs.rutgers.edu X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Apr 2017 16:00:32.5259 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR14MB1662 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2958 Lines: 94 This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig205088B714ED82955BB884A6 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Anshuman Khandual wrote: > On 04/21/2017 02:17 AM, Zi Yan wrote: >> From: Naoya Horiguchi >> >> This patch enables thp migration for mbind(2) and migrate_pages(2). >> >> Signed-off-by: Naoya Horiguchi >> --- >> ChangeLog v1 -> v2: >> - support pte-mapped and doubly-mapped thp >> --- >> mm/mempolicy.c | 108 +++++++++++++++++++++++++++++++++++++++++-------= --------- >> 1 file changed, 79 insertions(+), 29 deletions(-) >=20 > Snip >=20 >> @@ -981,7 +1012,17 @@ static struct page *new_node_page(struct page *p= age, unsigned long node, int **x >> if (PageHuge(page)) >> return alloc_huge_page_node(page_hstate(compound_head(page)), >> node); >> - else >> + else if (thp_migration_supported() && PageTransHuge(page)) { >> + struct page *thp; >> + >> + thp =3D alloc_pages_node(node, >> + (GFP_TRANSHUGE | __GFP_THISNODE) & ~__GFP_RECLAIM, >> + HPAGE_PMD_ORDER); >> + if (!thp) >> + return NULL; >> + prep_transhuge_page(thp); >> + return thp; >> + } else >> return __alloc_pages_node(node, GFP_HIGHUSER_MOVABLE | >> __GFP_THISNODE, 0); >> } >> @@ -1147,6 +1188,15 @@ static struct page *new_page(struct page *page,= unsigned long start, int **x) >> if (PageHuge(page)) { >> BUG_ON(!vma); >> return alloc_huge_page_noerr(vma, address, 1); >> + } else if (thp_migration_supported() && PageTransHuge(page)) { >> + struct page *thp; >> + >> + thp =3D alloc_hugepage_vma(GFP_TRANSHUGE, vma, address, >> + HPAGE_PMD_ORDER); >> + if (!thp) >> + return NULL; >> + prep_transhuge_page(thp); >> + return thp; >=20 > GFP flags in both these new page allocation functions should be the sam= e. > Does alloc_hugepage_vma() will eventually call page allocation with the= > following flags. >=20 > (GFP_TRANSHUGE | __GFP_THISNODE) & ~__GFP_RECLAIM Sure. This is equivalent to (GFP_TRANSHUGE_LIGHT | __GFP_THISNODE), which I am going to use. --=20 Best Regards, Yan Zi --------------enig205088B714ED82955BB884A6 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iQEcBAEBCAAGBQJY+iycAAoJEEGLLxGcTqbMyJsH/3PAy8AjdqxW0GcLsg/Cvgm5 +o/dKUWmtCQTdqSTI+RmY/zp+ml3nuyZG7dZKhnrFBsy1691a28xmjVgNpSFs8WP TdPv361dfIxPprfA57z8lTPVz2KulrIus5IXQEk0b7nckL5CW+4FDwnlZZEtpiYW 5HXErmgsvyMU5tdh2NWk6K1aDTcOtig+5/FBaFLG09rXEkQsb5NuFJXApJgLZscd GIUpMIpUkQyg+AAcbVVTFzPzlFG9K7v+GPpbUt83dToD1UAS14Ifmi/driraaIAU UkQWGhBBJzPneXT+t5SuDqZVzZF3yvZaxYnt0jP3cLymYSj5mxKe6MHbs3PlSxY= =5D4c -----END PGP SIGNATURE----- --------------enig205088B714ED82955BB884A6--