Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp2737683imj; Mon, 18 Feb 2019 11:13:29 -0800 (PST) X-Google-Smtp-Source: AHgI3IYE+IoLvv3SQP0e8WD9NfVYCl2Un3jIilygNV0vHGGgOixoToebVAl3RYjl/uqdiYM1DDZi X-Received: by 2002:a63:f148:: with SMTP id o8mr20360486pgk.337.1550517209159; Mon, 18 Feb 2019 11:13:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550517209; cv=none; d=google.com; s=arc-20160816; b=tJpa1dLzMKB7ilWQFc5BoAsqiCfAkxRZhqXoBqxjxDhpi0Fiv4hYDd54oXFoleXICh VwFkWf8pfLYcSi3tROwovT/xjv5XqEROTXNrkqODK6aCPGN5o+ZhBUgKrF+HW4Kgzn04 P0VmuscRkBXo+MzYjBWn3Vkt6bLO1qDcT1S02AvpD4WByoUDhlRyAouc8XcbembuynY3 d/jaLtIOVMT4VJs6DSt3ipylMEBoD/K/37dWrU6vK7AX5eRs34aJe0T04RctgsOEEDRV kBcFpdK9tZHHVSnIH0j9iE352mxq39HpeC4hZqejGqIs7MvDMJ84C128/MiUoe4WJbQE JEPw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:dkim-signature:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from; bh=yljpbhmUSpbK3ZHxUMPa6QcOvurPZMhS7eG0xTM1hHc=; b=x4UEWe2PnNWmnsf5fJbkr6wrpoRB7DF+pILpxmZt1hj2HSLSAZCZYlZ5eLTaU2uZey /eouuvCAXKWXO99seFtlLEJmz86AMslgtNroXY1fxs1fXUcBwKXXDuiMbiVVFS/iz5XN FNlcIaiTANHV0O+EzWOKTk1gNyxkAr9+PbVMJ2Qqzv67z4e2XA0T+M0+qYQwkuiJ85WO ywCOj/C+rGL/Vg6TYRXPo1TxCG1gCdOuCSnut8zAmRdqwYtCscDd5f3Qbvy13D1SdnJx 4kIz1WmAuvDE0wgEmRdB9ydWYq5UwkhBHXADvr65FPGvKSWp0HL15Pg62ZYAfXUyQjzy 8BsA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nvidia.com header.s=n1 header.b=NPjmsRzx; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nvidia.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h3si13497510pgi.391.2019.02.18.11.13.14; Mon, 18 Feb 2019 11:13:29 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@nvidia.com header.s=n1 header.b=NPjmsRzx; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nvidia.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2391703AbfBRR7D (ORCPT + 99 others); Mon, 18 Feb 2019 12:59:03 -0500 Received: from hqemgate16.nvidia.com ([216.228.121.65]:1668 "EHLO hqemgate16.nvidia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390086AbfBRR7C (ORCPT ); Mon, 18 Feb 2019 12:59:02 -0500 Received: from hqpgpgate101.nvidia.com (Not Verified[216.228.121.13]) by hqemgate16.nvidia.com (using TLS: TLSv1.2, DES-CBC3-SHA) id ; Mon, 18 Feb 2019 09:59:06 -0800 Received: from hqmail.nvidia.com ([172.20.161.6]) by hqpgpgate101.nvidia.com (PGP Universal service); Mon, 18 Feb 2019 09:59:01 -0800 X-PGP-Universal: processed; by hqpgpgate101.nvidia.com on Mon, 18 Feb 2019 09:59:01 -0800 Received: from [192.168.45.1] (172.20.13.39) by HQMAIL101.nvidia.com (172.20.187.10) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Mon, 18 Feb 2019 17:59:01 +0000 From: Zi Yan To: Matthew Wilcox CC: Vlastimil Babka , , , Dave Hansen , Michal Hocko , "Kirill A . Shutemov" , Andrew Morton , Mel Gorman , John Hubbard , Mark Hairgrove , Nitin Gupta , David Nellans Subject: Re: [RFC PATCH 01/31] mm: migrate: Add exchange_pages to exchange two lists of pages. Date: Mon, 18 Feb 2019 09:59:00 -0800 X-Mailer: MailMate (1.12.4r5594) Message-ID: In-Reply-To: <20190218175224.GT12668@bombadil.infradead.org> References: <20190215220856.29749-1-zi.yan@sent.com> <20190215220856.29749-2-zi.yan@sent.com> <20190217112943.GP12668@bombadil.infradead.org> <65A1FFA0-531C-4078-9704-3F44819C3C07@nvidia.com> <2630a452-8c53-f109-1748-36b98076c86e@suse.cz> <53690FCD-B0BA-4619-8DF1-B9D721EE1208@nvidia.com> <20190218175224.GT12668@bombadil.infradead.org> MIME-Version: 1.0 X-Originating-IP: [172.20.13.39] X-ClientProxiedBy: HQMAIL107.nvidia.com (172.20.187.13) To HQMAIL101.nvidia.com (172.20.187.10) Content-Type: multipart/signed; boundary="=_MailMate_0BB521CA-1CAD-4EA1-A067-DCAFAE90573C_="; micalg=pgp-sha1; protocol="application/pgp-signature" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nvidia.com; s=n1; t=1550512746; bh=yljpbhmUSpbK3ZHxUMPa6QcOvurPZMhS7eG0xTM1hHc=; h=X-PGP-Universal:From:To:CC:Subject:Date:X-Mailer:Message-ID: In-Reply-To:References:MIME-Version:X-Originating-IP: X-ClientProxiedBy:Content-Type; b=NPjmsRzxI4Znr1hzBLzzxCI+yt/7CUxfGhpVkEJBB0Z32UeGbrQMJIQrQAOEA533M ccK+V7tOtviV3OdFezrVfLYJOZ/19XUR3cgdYg7HgWQ0O/0AVYEK4LDNwJoQG7YCJ3 yV6SAWrj7w2nNFcIC0hFQr1Q9kVcdnmMcr0Urt2sYRVC7betMBJrY0NADKk8DJejxI GjxqXFJPP/z6z4L35qtsCcpjEMLIoCt4kkHv2T7o2cnefuHztsS9IALt5AILUg3NLf p/IWPTmMEMaKmCor2rb2fy08/MKuog9yeoygzQEZneA2i3/j/vrCi8pxz4oYRzxdzc g9/7UcwdZDlnw== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --=_MailMate_0BB521CA-1CAD-4EA1-A067-DCAFAE90573C_= Content-Type: text/plain; markup=markdown On 18 Feb 2019, at 9:52, Matthew Wilcox wrote: > On Mon, Feb 18, 2019 at 09:51:33AM -0800, Zi Yan wrote: >> On 18 Feb 2019, at 9:42, Vlastimil Babka wrote: >>> On 2/18/19 6:31 PM, Zi Yan wrote: >>>> The purpose of proposing exchange_pages() is to avoid allocating any >>>> new >>>> page, >>>> so that we would not trigger any potential page reclaim or memory >>>> compaction. >>>> Allocating a temporary page defeats the purpose. >>> >>> Compaction can only happen for order > 0 temporary pages. Even if you >>> used >>> single order = 0 page to gradually exchange e.g. a THP, it should be >>> better than >>> u64. Allocating order = 0 should be a non-issue. If it's an issue, then >>> the >>> system is in a bad state and physically contiguous layout is a secondary >>> concern. >> >> You are right if we only need to allocate one order-0 page. But this also >> means >> we can only exchange two pages at a time. We need to add a lock to make sure >> the temporary page is used exclusively or we need to keep allocating >> temporary pages >> when multiple exchange_pages() are happening at the same time. > > You allocate one temporary page per thread that's doing an exchange_page(). Yeah, you are right. I think at most I need NR_CPU order-0 pages. I will try it. Thanks. -- Best Regards, Yan Zi --=_MailMate_0BB521CA-1CAD-4EA1-A067-DCAFAE90573C_= Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQJDBAEBAgAtFiEEh7yFAW3gwjwQ4C9anbJR82th+ooFAlxq8mQPHHppeUBudmlk aWEuY29tAAoJEJ2yUfNrYfqKvz8P/2QWoZ7BWe9DN+EX/xH7sX2+WgzwoOXSbqud Q1DOF9mtLfTCPyxff+My2P2j1h2fyptIoVN5SE4J6j8BggLKN5wp1IH+rfl0z1Q1 oN3+L4cOKtOGl9/kVEDcCng46pMgCXBr4JrkcR/tbpe+lqlgcxJQKSMThLDg+NC2 k9LUt1mY5AG+3SgCmRayI4ROjsmsRjk2mlQq6e+cXLKToaByJ5GlTc+IebjXevVo Fbet14T79dJWG+FHpMA1RwqFFJk48y5NYf0kMvWY+SnZHaeNm0gFUKnKtgH3EbK3 I7RQaVEvPnEptOEXsHXD24ukVLAaELib/molyY7OLeVw0W1X1jN0ARF3vwbTDf7x TepaHrzK+Ft7VX08Lc/W3yOH0RSipkoobDUPiZwxnWf13PKKxl5C84tiAMvxj7zL 7vxOO0uEaSCRP5johYsCvglRoPLZ4YUR8yxF8uhOat5UQbymt2w10V67+nyAAsoQ +rHZ84bWhpOuX/ussS0zjz6AVchq8z1w9PanYHLU0Wm7HcJzHbcVWTcn2lfyESiH o50VP92H1w4biHlNIOUiOjl2ColtSOCUXhrBycd2/cSLL6Ub7oEbLCNr3ivF60PL GcywjYloQ/lQtFWUStFSN9UXONpj+urQ3GfXJj4owAK/rgwXX1cVH87a098zRm3z uMDfSnJx =Hhar -----END PGP SIGNATURE----- --=_MailMate_0BB521CA-1CAD-4EA1-A067-DCAFAE90573C_=--