Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S934260AbcKJPfn (ORCPT ); Thu, 10 Nov 2016 10:35:43 -0500 Received: from mail-bl2nam02on0114.outbound.protection.outlook.com ([104.47.38.114]:58912 "EHLO NAM02-BL2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S933690AbcKJPfl (ORCPT ); Thu, 10 Nov 2016 10:35:41 -0500 X-Greylist: delayed 5624 seconds by postgrey-1.27 at vger.kernel.org; Thu, 10 Nov 2016 10:35:41 EST Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=zy56@cs.rutgers.edu; From: Zi Yan To: Naoya Horiguchi CC: Anshuman Khandual , "linux-mm@kvack.org" , "Kirill A. Shutemov" , Hugh Dickins , Andrew Morton , Dave Hansen , Andrea Arcangeli , Mel Gorman , Michal Hocko , Vlastimil Babka , Pavel Emelyanov , Balbir Singh , "linux-kernel@vger.kernel.org" , Naoya Horiguchi Subject: Re: [PATCH v2 00/12] mm: page migration enhancement for thp Date: Thu, 10 Nov 2016 09:01:48 -0500 Message-ID: In-Reply-To: <20161109235223.GA31285@hori1.linux.bs1.fc.nec.co.jp> References: <1478561517-4317-1-git-send-email-n-horiguchi@ah.jp.nec.com> <5822FB60.5040905@linux.vnet.ibm.com> <20161109235223.GA31285@hori1.linux.bs1.fc.nec.co.jp> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=_MailMate_0ACBB506-96A6-4514-8595-8A694F6D6551_="; micalg=pgp-sha512; protocol="application/pgp-signature" X-Mailer: MailMate (1.9.5r5292) X-Originating-IP: [100.8.208.152] X-ClientProxiedBy: BN6PR10CA0015.namprd10.prod.outlook.com (10.172.16.153) To CY4PR14MB1654.namprd14.prod.outlook.com (10.171.166.16) X-Microsoft-Exchange-Diagnostics: 1;CY4PR14MB1654;2:8IDes69YNlxB5HzLWNPgCwenApnpdPJLnTmbw3s2RQ9+6rjFyB4aWfr0M3VacdYhYuzcwUeVw18GG2JO7+ToQzuCa5XTuq50zUN9Zr8wMi7YeNdenUiBt+gLO9j3arNmUEMrJ6yKp5c1si0wAtqi5LK5mqH9kFWf4T2uC8NgPMc=;3:+bdhpzRzXfepRYYoYMYzCApcWcmjvbJSqjGHa2TGzzNgHjKL29/d4pBPsFYpNd/UZIbILcB0Xw8IWxD1JXC6vEPaIUhR6mN61Jqs9DM3fXcAQYQuc/CjyEk9vzGQcXCRFuTpQiJ/J/hOukklnqIZUynJDn/mtTccRwLMIvJJxUQ= X-MS-Office365-Filtering-Correlation-Id: eadfa15d-8393-49f9-23d6-08d4097220aa X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001);SRVR:CY4PR14MB1654; X-Microsoft-Exchange-Diagnostics: 1;CY4PR14MB1654;25:tfBmgltMMXX84QGF+Qu5QPsV/PQ/h3QmEK6k36cB4xDS8+f9fsCw5X7CM/ok0rhbdQAOaRTZZnwyJnRkk/yh6VW2wGqiGyTSnrDhGAE1pBq0KAXdZVG1dJRilbVm56AqtSYb8PGPWufBgIA202pO7VuMHwH1WSOq1gAXdkB+QwRKPBr03m14IY2p+evKnEfCV4FsvwKZLGRDqZiWQHQdfM0jhZZ4D+S0Nk/mCCteBX2evemnoq6fdg1qFbFKr80BWNQqLQxuVWJUpOm3AVwq2An3dEvjL4IIsXC3OSSZACfnK/2OowLn/u/yg5rgzhB5ZPYj0Oe1gL8MxMQAuMUaWIPZS55oohZq1Fi7bnyyCfusID7Qzn8RDN5DQSBFtfYyYkmQMpVd1YrEH8DuBiz3aKTGFGtl+dV/qSVKE5wEcIS+YbNoCC9yy/bIGFJoez7kwwrkt3/ws5KO3n6ttc6Eol2jSxOaQpxm7OqjXfZzRrSKVJQZ5thBm8HRIlAWTSjjvdyse2Mc9Dks/ZVXLBuJbMITpIKJt44gz7AWl70HR7f1tHC2uwbhMkMFR7uVLiqXQycN11UMFjcYTI+p0N40aQYssRhUCWPXUMZnkd9GOli85Yer1rrh3UE19KFfBa84W4vmLLakmw4gGFNO/brbuQHUp3/amqoQdznc7eAEMd4II6PNz4sG+TuIuihUJYLeMmF88+zFeEBs/B1mop4aVjEPRnRQcqWKTX/geqO0nmGKBUrqqT0aCKQ86LaK2mJVkVw6yNcGWD6Xke0R2y1ZqA== X-Microsoft-Exchange-Diagnostics: 1;CY4PR14MB1654;31:Hu9rRjOCHs+lERk10Oj1D3fq4FWx+TGdjhgwJ/XFf2ajYxNuisMzkWLftrdxIS3AtGH5VIT3+8lCUes48L8i9W9kgxZaxp5zQTkTK0W2BVWcmtCPJFh5uuafVjIV7sA+z5x87FFOx4YvYCv2ssVJsZ6BLqqegdnfJDRfj/qg6upt/rgpJtnTWRx57UWV2pQFr0UuCumX8hTCAfINg/2qISm6HmBG0aQMm1lwbTNoAxtfeu9EhFXgNqPpNq26jpydiNiCmAHUzhSQYHn20AoHiA==;20:pB8YQwExtFCrzA60PS8cYSX34Fh/Awf/QpjII43Nu6Mq7Ikguj2yu82OYOOLQ9wKnZEVSqWcHRv6w2GfPplo8tKuC3I+x4Z46uywm//ejHunUeTCoMuV9wPsIYIuwxVw/MVGOTeEaYsSTynPWBYeGuIu7e0zSDk55CZq/umc/oSwT5Y6xp6t+qUPRyso6aRSd5oFayg3J3TfBKg8DlWswu8DGngV7N/WCrqBxDEQVXVwResVGeAQJg5XZKz45dQmiyGuHNMCwfZwYtHm/Hl9xAPP7x9YeJsBPR00kb/1Ju6VZzrxSS9SJ9WTC3YgdK4yO5ZG5P/DN0qxUB4PIh07mvH0Ruke9cO0i99Gt1x7evPAAVzknTjGXzORwq+YTyP/y4NzHNM8G3sp2oIqSjOkPLqXEOuSH/BT6zMc99yHNJ0LefNhFdsCsuDbaL/tqaFIqKn641OWfphen8WdPG+0bb1Oie9cLWEE1e3F+/SHQoafqqpi4JWVOp3qQ1TWWw9s X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(278428928389397); X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(6040176)(601004)(2401047)(5005006)(8121501046)(3002001)(10201501046)(6042046)(6043046);SRVR:CY4PR14MB1654;BCL:0;PCL:0;RULEID:;SRVR:CY4PR14MB1654; X-Microsoft-Exchange-Diagnostics: 1;CY4PR14MB1654;4:Oi8eFlrJzOe9B/T6DsifORQjl4ZhO+hmXLxuypt05ZK0EebkzSbnu2cNRlFw07JUp3kLtzVo/qM6tgo/V26v45GLnef4sp41ScEkW2rakK8i57WVF3wExQ5BtwbxHptLTqeGwBnCl75lkX6wjstL1YliJTY059bLcrs7UAzsNhMtFkifScELO7TxbM3xccJm5uIMhqCFoSvH10TYVwevM20ZQkdq6ABQ8Wtf5lgy8fm7oFylnzxrXMbJdN6bHEmYZ59VUAuffFE+rOXfJ9OaCAzqma42IcDNscLTZSNYNPGNCjelTx6xASbHRUpPn44zzY7Pm8AY+Bt7peAbcjT/r2Y7sZ8VJQ27HimcCetncqngP40lK4H9bZ5jN+m1qzBU5k/veJjLXAMpx74PcWETm7TZOUFswDwrlKgME1vpMsYXvL2YeOj2mTyXLMTNlddfEBSGQ7GAixXy8sFwHRU1X0mh0ETReBEYQE7CjH7ULXs= X-Forefront-PRVS: 01221E3973 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10019020)(4630300001)(6009001)(6049001)(7916002)(53754006)(24454002)(189002)(377454003)(199003)(51444003)(21480400002)(105586002)(66066001)(7736002)(101416001)(106356001)(50226002)(68736007)(586003)(512874002)(88552002)(7416002)(6116002)(3846002)(345774005)(42186005)(117156001)(305945005)(82746002)(189998001)(7846002)(77096005)(6916009)(42882006)(2950100002)(97736004)(75432002)(84326002)(8676002)(110136003)(2906002)(83716003)(4326007)(81156014)(33656002)(81166006)(50986999)(76176999)(92566002)(89122001)(5890100001)(568964002)(5660300001)(229853002)(4001150100001)(6666003)(72826003)(104396002);DIR:OUT;SFP:1102;SCL:1;SRVR:CY4PR14MB1654;H:[192.168.1.153];FPR:;SPF:None;PTR:InfoNoRecords;MX:1;A:1;LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;CY4PR14MB1654;23:p87Q/bg9gVbZGzDscQDyHKJEGlXDZH5hmBRLIDI5w?= =?us-ascii?Q?RG18SenuhQej1+/+OcdC28JFDzLsyZDbE7H1r85xKs3x41ShS0xjl7+tojSj?= =?us-ascii?Q?AbvVhZot9Vx0b78tqiFTQQkpNRcKZhFDTVeoMoeVc6WsMUb0xPxN5Wzs0yuT?= =?us-ascii?Q?JHYhABKhKJlOtiYS6bGRG1+xHIniwAxJ024eZTTdrQT+CIkkp0Jy/ukd8ciW?= =?us-ascii?Q?7SsuHvu+BTKWiy5VCaddMPVamMvPoWzyrGqkdWBRB0TAm4Mb/sfAPoKGIxeH?= =?us-ascii?Q?BVDjgAg2XIIYWeJejCbs+LYHzyASt8UHnH1VkwDUPGyCX54QrB6bNwPSwGG9?= =?us-ascii?Q?+7IGSyqB9cvV/X15nmUfE1dIXeYjXrQw9YTBnzTAxUOzZ0IBvdyESe2iQWvB?= =?us-ascii?Q?JjFgkL93rAeRdoAeHeSN0ia+uN0vx3B6Zi+5nV2Bv4xtQsFwo5w+Cv06oFcc?= =?us-ascii?Q?nOfctzStgdC1XX3g2od0c7ulapVGQH1mlQGqEbDaT68xvBh2D9GFqEmAWHJR?= =?us-ascii?Q?BS1SOXj8LCE3XV32QJ87WfzPDLz0i5h6YNhloXx65vjzr2ODJKnhCvYmcGHP?= =?us-ascii?Q?uxqmHLXpYjyuoIAPBe+th2DCUAca6ekqFfpBF2tuhG5gbnQTCLp6HQ+HKKm+?= =?us-ascii?Q?FJesKqBT3roQDQ8dtnAAufLAs1PcOr9D64rOLsORTET3YelrL887XLzURSJX?= =?us-ascii?Q?4FfVv6S6UlKFsuHUVue1Si+PRPs0TDMpG5V0oanHXnfDihbBEgE7qBp80YlY?= =?us-ascii?Q?DmpzpiJAEr++6q5MaoSobrng4Ob/PMTDIKohr67uep8eYahVd+8J2fNUJh/0?= =?us-ascii?Q?+s+jUYp4p5NjxQqDNqdL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hhgJKjckIwpkAJRNGPbEq4uvWl7TWGwuxiFoXBem9PYJgs3MA1L9Bw==;5:RDGYDYuapKX0lXUs2DRDHW43YhpaJPXH/7QId42+rrNHTbaPhp9sN5oGbfM3Qm8EJ1Mtx1x7zyO4JKagrDsK4HKcKbIGiRqNS3S+wqkISzxTkGlDhBQuNXLcys/V0+l5P2llI1fK6fqkLFQcDHieDw==;24:fpLE/uYNzeWss7KBrMpWJOhyN6szJXzqFJTGuqZtVqgLgANDWRAQaOHwruCWYPqf/Pd0RLjQ5d0RcX8kcw//wfdMZqHJ67VwokAxfQ73s6I= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;CY4PR14MB1654;7:VD3PiZNDhl5zc81lcNkV/loJHw0H01dhkGgwSy6FjdCSPuSoLmCfDV3njue6jciXs4QrjaN+rTd/OY7PzEfLrI+pw1D7k9u+zlyUg4qEk7j0+SCr1QCq3KLGBnJBRW/iG2YlNrrjBAZoBqHvL+j280DJub3J/M6P42a+GtCvhRWnzOiSQkcC/nmQM6guZNA2gmOOP2oQ5jRB+TXuxTwxl3zlmXRYbMVa+Gvuny43ZR/XJHC0waADoB/+auXeYKxxIMtjeNxyq/+VrD3aFW+whrtGBNZ78aAExbV7sVubkYEfCAsBTP/hPx5ZruguoY5bN67bVjGFJCIP9hieYSeh8rzKlh2dYb3CdeoSGipiJos= X-OriginatorOrg: cs.rutgers.edu X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Nov 2016 14:01:53.2435 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR14MB1654 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3407 Lines: 103 --=_MailMate_0ACBB506-96A6-4514-8595-8A694F6D6551_= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 9 Nov 2016, at 18:52, Naoya Horiguchi wrote: > Hi Anshuman, > > On Wed, Nov 09, 2016 at 04:03:04PM +0530, Anshuman Khandual wrote: >> On 11/08/2016 05:01 AM, Naoya Horiguchi wrote: >>> Hi everyone, >>> >>> I've updated thp migration patches for v4.9-rc2-mmotm-2016-10-27-18-2= 7 >>> with feedbacks for ver.1. >>> >>> General description (no change since ver.1) >>> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >>> >>> This patchset enhances page migration functionality to handle thp mig= ration >>> for various page migration's callers: >>> - mbind(2) >>> - move_pages(2) >>> - migrate_pages(2) >>> - cgroup/cpuset migration >>> - memory hotremove >>> - soft offline >>> >>> The main benefit is that we can avoid unnecessary thp splits, which h= elps us >>> avoid performance decrease when your applications handles NUMA optimi= zation on >>> their own. >>> >>> The implementation is similar to that of normal page migration, the k= ey point >>> is that we modify a pmd to a pmd migration entry in swap-entry like f= ormat. >> >> Will it be better to have new THP_MIGRATE_SUCCESS and THP_MIGRATE_FAIL= >> VM events to capture how many times the migration worked without first= >> splitting the huge page and how many time it did not work ? > > Thank you for the suggestion. > I think that's helpful, so will try it in next version. > >> Also do you >> have a test case which demonstrates this THP migration and kind of sho= ws >> its better than the present split and move method ? > > I don't have test cases which compare thp migration and split-then-migr= ation > with some numbers. Maybe measuring/comparing the overhead of migration = is > a good start point, although I think the real benefit of thp migration = comes > from workload "after migration" by avoiding thp split. Migrating 4KB pages has much lower (~1/3) throughput than 2MB pages. What I get is that on average it takes 1987.38 us to migrate 512 4KB page= s and 658.54 us to migrate 1 2MB page= =2E I did the test in a two-socket Intel Xeon E5-2640v4 box. I used migrate_p= ages() system call to migrate pages. MADV_NOHUGEPAGE and MADV_HUGEPAGE are used = to make 4KB and 2MB pages and each page=E2=80=99s flags are checked to make = sure the page size is 4KB or 2MB THP. There is no split page. But the page migration time already tells the sto= ry. =E2=80=94 Best Regards, Yan Zi --=_MailMate_0ACBB506-96A6-4514-8595-8A694F6D6551_= Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- Comment: GPGTools - https://gpgtools.org iQEcBAEBCgAGBQJYJH3NAAoJEEGLLxGcTqbMz1oH/2Nnz4H2znvV1IbF4ZbQMgZq AaI60jTj/aUgeE1YAlAfc1F4z0XDAnWWOGdE4poCcbT+PlHUPqTbqe0nyRP+io1B YFyTO0/dEHxBqjju7vBH/vT9TTNuAp8WNFqmmKedeJqS7k2xh2GACwjfZvG2i7Xg hbHH2SNkubVWc5KttHwoo+NH4KtNycLP4qOMoLsDSjeOaZJaMQAz80SrPrcdrHPm HyKS5zKp8mMKoxBiCz6t+gBAsHQkL39kqDzCSRXpgvU6VeGB6RMPAnxHgKIc9dnw 3DghqiXEVGaDlIsq7ZN2705N/s0Yr0KoqY//74mwuFVu2JVdI3fkBPf8ORNkpoM= =33eG -----END PGP SIGNATURE----- --=_MailMate_0ACBB506-96A6-4514-8595-8A694F6D6551_=--