From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.2 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 324B8C43381 for ; Mon, 18 Feb 2019 17:59:05 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id EB3FA21736 for ; Mon, 18 Feb 2019 17:59:04 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=nvidia.com header.i=@nvidia.com header.b="NPjmsRzx" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2391728AbfBRR7D (ORCPT ); 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_=--