Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754594AbcK1Phx (ORCPT ); Mon, 28 Nov 2016 10:37:53 -0500 Received: from mail-bn3nam01on0123.outbound.protection.outlook.com ([104.47.33.123]:32401 "EHLO NAM01-BN3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S932357AbcK1Phq (ORCPT ); Mon, 28 Nov 2016 10:37:46 -0500 X-Greylist: delayed 2019 seconds by postgrey-1.27 at vger.kernel.org; Mon, 28 Nov 2016 10:37:46 EST Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=zy56@cs.rutgers.edu; From: Zi Yan To: Balbir Singh CC: , , , , , , , , Subject: Re: [PATCH 0/5] Parallel hugepage migration optimization Date: Mon, 28 Nov 2016 10:22:45 -0500 Message-ID: In-Reply-To: <9cf7f4c6-6dde-9dbb-cf93-7874437a442d@gmail.com> References: <20161122162530.2370-1-zi.yan@sent.com> <9cf7f4c6-6dde-9dbb-cf93-7874437a442d@gmail.com> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=_MailMate_637746C7-C397-4CC8-B358-3C32989FF3D2_="; micalg=pgp-sha512; protocol="application/pgp-signature" X-Mailer: MailMate (2.0BETAr6067) X-Originating-IP: [128.6.37.146] X-ClientProxiedBy: DM2PR11CA0020.namprd11.prod.outlook.com (10.160.91.30) To DM5PR14MB1658.namprd14.prod.outlook.com (10.171.156.16) X-MS-Office365-Filtering-Correlation-Id: ba85fe62-6d11-4534-2f90-08d417a26a9a X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001);SRVR:DM5PR14MB1658; X-Microsoft-Exchange-Diagnostics: 1;DM5PR14MB1658;3:hzBRu8oU6mVvIYWiygjpql0yK/HmoTH/IVGVVGqQPtsjfMDZa0pteH5Rt7EjXD1qbNBC48FdKoMaHTTiV1KeUFOmzN+0SrdJnXUqaeaw/JMTXLQeP7Lskq52ioTOi2j8jLxGPwZHfRchTmvgU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SA== X-Microsoft-Exchange-Diagnostics: 1;DM5PR14MB1658;31:ShvN3lu7pFumQkjf8DKetBYxSuJua385erdLUODXSuv1kRAL60Xbv3bstLxlabU8unYQK55CxlDx4aoUGojmBk5qiJbpJoLL3y3fRO9i9vEddVsvZuV6JclwThUszR5fylYR2OSbVpTsssbPp1DSbW01mDP1sYoFlcFuP3hLdn+tOUrnKuj89ipqFWix1L06Y0kzHBydzxVvE5L18JiHROQxCY2XYdHKogYuWLEk2+t+XwIKl5VYAz4wAu24d/31fjfP3lJNaa24tSyCFok28rp957ajoiww/62uG4dztHQ=;20:9XJ+sKVFruNeGHFCFPMteAFi3nzSVF5lnDNVEAvmxyQvCdaz0b+9ii6JZrBHqs87YMXnoSa6rw83klehLPQYXp3Wej18y2elsJkktrYGFqiDFMIfMI6rTtymDJxTZvHWrDawK2KPAKhmJzknyWeVFaCDqptI2PY+Mju2nWo5InEEW/e1sF5Aymfoz4zdJIMZViXkByVANmaUSiDzh5/bCGdTrYUJ6mFt2il9Wt24LJbZ3jLBkL6OsCmh7R2169GT+yL8+p7nnJUp4+eWmfytch4l8jlvZY7H9Cgr0yToP6Yc/tyzVkczm0ipJYbvHSY6z3Y0e4UlvvVPQB8yav2IEyTXFTRYMEvPW+PkcX/FVf8RMuqUy7NzaHeY3215h0f5suMFxUwlasg/oyRYv2aSc/dHohwkmp2MxrYRg1XTkn0Cm/IVHqG6x7R/TlIQMk3zR/tRSpaqpKDZPtiM+vEoLKhIz+rkEoftcOQeh/LpW7P52c6KAyMtZeb/NiiHVsXN X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(6060326)(6040361)(6045199)(601004)(2401047)(5005006)(8121501046)(3002001)(10201501046)(6041248)(6061324)(20161123560025)(20161123555025)(20161123564025)(20161123562025)(2016111802025)(6043046);SRVR:DM5PR14MB1658;BCL:0;PCL:0;RULEID:;SRVR:DM5PR14MB1658; X-Microsoft-Exchange-Diagnostics: 1;DM5PR14MB1658;4:mJydkRuas0SytA+uGbd7CUXjG7aiTbhzo2Zp7r+jYLH/LNfs5BhobK1JyBEXQb/jN+fhPzCJH9F8slQd1uvu2zjCsbREVAV6hx+V+/0yhpF15J0Fn6uC75aDEiMgbtTfX1vLmt7XIGkhNtLere2cCXE83TOf3NRrhieDKPaSmm4gBj6eYvwKDJ36YoqNENFGN/462xSxNNfUINb+xXZxICBOy8bVGOo5UQVLOxtw5apgsXConczYkvjP0EsdSkK86qROTfqp35FvHMQs7M/ss1WnuClt1nQOw/RGatbL1h9DB0WPGAT2Ah/lNKAeCOnRnmEZTTA5TbVfztXujNEvVkUZfTWgXIRtN/+bA1hHiS6EXhy43r9GWrqDQgZNtNAeZiJDejHygqDvXYeRiTvMl9KKJ7ZYdmflpBGTEXx/JR6U3gmcJ/LmihRSOQBVmpTj2Be1Ih06M7ZdQPIUXzjQS/0jeiwr6xBrwssTRMgCzslootvgM36I3GpTYXPJYIQCQiQL/X4HD5XpTCkQHVRDQxllRXwCGkJtLWBs1ZjrT5bk1ILZ7ilt4xzmkLgGjccxIfcuQBASw5UiSF6yjI1LLEfrlQq2gRajTlcXtDWkoTk5wLXXSo8qwBF92oge5Vf5Ptd82ylChK8r5+eSpwRLKtJs5z6o9jL8eWu38/oDhfs= X-Forefront-PRVS: 01401330D1 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10019020)(4630300001)(6009001)(6049001)(7916002)(11905935001)(53754006)(199003)(189002)(24454002)(76176999)(50986999)(89122001)(42186005)(5660300001)(7416002)(42882006)(21480400002)(2950100002)(97736004)(106356001)(6916009)(105586002)(50226002)(68736007)(189998001)(33656002)(66066001)(110136003)(101416001)(6666003)(1411001)(81156014)(81166006)(8676002)(568964002)(7846002)(6486002)(3846002)(7736002)(39400400001)(39380400001)(77096006)(733004)(6116002)(5890100001)(83716003)(39060400001)(88552002)(2906002)(4326007)(38730400001)(75432002)(229853002)(39410400001)(305945005)(92566002)(82746002)(39450400002)(84326002)(104396002)(72826003);DIR:OUT;SFP:1102;SCL:1;SRVR:DM5PR14MB1658;H:[172.27.42.163];FPR:;SPF:None;PTR:InfoNoRecords;A:1;MX:1;LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;DM5PR14MB1658;23:EJd0TNGlJ4xn7rLZ+MTF7mrJCoSqc+hjIyQHiY4Ud?= =?us-ascii?Q?v6kEK9+FyQQ8MiTAuRrPr8NXXWsTbkjVrpOa6swKGLMYa37wy+vGLuk96K8k?= =?us-ascii?Q?aXUIDbLN4hk1OXCdAjVJNx4RMxZC30YRL9JYatqoau3px3qpGQsqPS2XDIpu?= =?us-ascii?Q?hnlKL1c/KGKoNwxxO8amBNkH7MaBRzSWoNGGogydT0kiBT3CHJWNk4RBW0tu?= =?us-ascii?Q?Zs2AtC9b4rIoB7L1rhh6n29O2XFgn0n//aroLuJ5jk4g2BcXyFsXURjnsRZU?= =?us-ascii?Q?DfuYw9W9W7qSlKCGnieEdaw7vQlTAYw1vmaKehP++DKCgQ8ic31L1ybzKW0u?= =?us-ascii?Q?Ds2aLvIf8hg2Sn9f1A7ZgCvsm8BhyDw7blaeHwmrYYwlO/dGemRui0R6Jru0?= =?us-ascii?Q?Jh/i3N/OJ6CdNL33FoExM1aYG82KbLdC4b/y2ETLZnbryJ6xmB4K16GpamhO?= =?us-ascii?Q?Qr3sVSoLVpM4Ros5FTglHMLyW9nxwXFp5C6gtwvslKqzXkWxqM3xXwD2L5Vw?= =?us-ascii?Q?g+4RGgb2jGFe51etGZNrmnsz+2aM4ngZkFsFyo+zOGaok03340m0UgAI4K2i?= =?us-ascii?Q?oMZaCG+qkQhnwR5UfPAONJ8TpW+VVlsxcnyFJO9faoJbX7nPAAMIoDJyrJbP?= =?us-ascii?Q?kQ1QrUmghAww1C5H8/nV41llrDmD+/qFhpq+SxV9h6lVA3msBMNfOjX53+yT?= =?us-ascii?Q?z3116NgUlFwVnXbZ5ijo0ju+m0HFsszGgD4fYQ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UzS88S/g8FFxx+MYV9Uuk3oNOyuUsRTBRr1MzH9UHuxw6TZ9RFYu4+q45aK/qLPXm3p+pMatO/vlZLBy8qtE0P3Mggw== X-OriginatorOrg: cs.rutgers.edu X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Nov 2016 15:22:50.1128 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR14MB1658 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2658 Lines: 73 --=_MailMate_637746C7-C397-4CC8-B358-3C32989FF3D2_= Content-Type: text/plain On 24 Nov 2016, at 18:59, Balbir Singh wrote: > On 23/11/16 03:25, Zi Yan wrote: >> From: Zi Yan >> >> Hi all, >> >> This patchset boosts the hugepage migration throughput and helps THP migration >> which is added by Naoya's patches: https://lwn.net/Articles/705879/. >> >> Motivation >> =============================== >> >> In x86, 4KB page migrations are underutilizing the memory bandwidth compared >> to 2MB THP migrations. I did some page migration benchmarking on a two-socket >> Intel Xeon E5-2640v3 box, which has 23.4GB/s bandwidth, and discover >> there are big throughput gap, ~3x, between 4KB and 2MB page migrations. >> >> Here are the throughput numbers for different page sizes and page numbers: >> | 512 4KB pages | 1 2MB THP | 1 4KB page >> x86_64 | 0.98GB/s | 2.97GB/s | 0.06GB/s >> >> As Linux currently use single-threaded page migration, the throughput is still >> much lower than the hardware bandwidth, 2.97GB/s vs 23.4GB/s. So I parallelize >> the copy_page() part of THP migration with workqueue and achieve 2.8x throughput. >> >> Here are the throughput numbers of 2MB page migration: >> | single-threaded | 8-thread >> x86_64 2MB | 2.97GB/s | 8.58GB/s >> > > Whats the impact on CPU utilization? Is there a huge impact? > > Balbir Singh. It depends on the throughput we can achieve. For single-threaded copy, the current routine, it takes one CPU 2MB/(2.97GB/s) = 657.6 us to copy one 2MB page. For 8-thread copy, it take 8 CPUs 2MB/(8.58GB/s) = 227.6 us to copy one 2MB page. If we have 8 idle CPUs, I think it worths using them. I am going to add code to check idle_cpu() in the system before doing the copy. If no idle CPUs are present, I can fall back to single-threaded copy. -- Best Regards Yan Zi --=_MailMate_637746C7-C397-4CC8-B358-3C32989FF3D2_= 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 iQEcBAEBCgAGBQJYPEvFAAoJEEGLLxGcTqbMEb8H/2rCChgp11A8SwJhTkt0BFPO mgusZsNgrSK7Wi2q+j2ZOkoLidSD+1Mh5N8wFrqVs9LCFiKvfQXIlllrVpze9yIU nTd0c3BQjS7eD2fNSx1oCFSIMaUIgtr0qPq0SaVLVq5ho9k/OxSoTk7F0f6iAhKc wdb8naUMqUcTFhs0YslzbSRGZNLZQ7cz4QVkR67T6g9uKxYC1NXafyQciP1cpPjc cBuqhj7j5Ps3mHpthmmyCixn7r298ROZ00HsKrE1bEFHsRNF0VGMtzvl3rE49T61 BN7FMPnZ7YVsCOq6j5L6vUe6UqH4k+TFHm6udIUa4eQNjYaf7S8YVqWrA96gfYM= =wM2C -----END PGP SIGNATURE----- --=_MailMate_637746C7-C397-4CC8-B358-3C32989FF3D2_=--