Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751075AbdLaNKI (ORCPT ); Sun, 31 Dec 2017 08:10:08 -0500 Received: from mail-bn3nam01on0121.outbound.protection.outlook.com ([104.47.33.121]:57079 "EHLO NAM01-BN3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751022AbdLaNKG (ORCPT ); Sun, 31 Dec 2017 08:10:06 -0500 Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=zi.yan@cs.rutgers.edu; From: "Zi Yan" To: "Michal Hocko" Cc: linux-mm@kvack.org, "Naoya Horiguchi" , "Kirill A. Shutemov" , "Vlastimil Babka" , "Andrew Morton" , "Andrea Reale" , LKML Subject: Re: [RFC PATCH 3/3] mm: unclutter THP migration Date: Sun, 31 Dec 2017 08:09:57 -0500 X-Mailer: MailMate (1.10r5444) Message-ID: <4F0E0390-D9C0-4A67-90F7-42CA944FE4F6@cs.rutgers.edu> In-Reply-To: <20171231090710.GA18691@dhcp22.suse.cz> References: <20171207143401.GK20234@dhcp22.suse.cz> <20171208161559.27313-1-mhocko@kernel.org> <20171208161559.27313-4-mhocko@kernel.org> <20171229113627.GB27077@dhcp22.suse.cz> <044496C5-5ACD-4845-A7A3-BD920BF9233B@cs.rutgers.edu> <20171231090710.GA18691@dhcp22.suse.cz> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=_MailMate_DF0F4D66-2B57-493A-81AD-6BAC75A54D4B_="; micalg=pgp-sha512; protocol="application/pgp-signature" X-Originating-IP: [108.53.61.194] X-ClientProxiedBy: CO2PR04CA0119.namprd04.prod.outlook.com (10.165.95.21) To MWHPR14MB1664.namprd14.prod.outlook.com (10.171.146.146) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 34db7fd1-4698-46a9-a906-08d5504fcde9 X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(4534020)(4602075)(4627115)(201703031133081)(201702281549075)(5600026)(4604075)(2017052603307)(7153060);SRVR:MWHPR14MB1664; X-Microsoft-Exchange-Diagnostics: 1;MWHPR14MB1664;3:KKHAIaSjz3oN42ASe0msMD35dxknlJY5p1mPRkj9TW353uvOvKFP3UC1vwrg09GLrHYAabgo+Y/ut3vedy8U2kgMWAkyGwAYusaZyYIQkB+jPrGwGS5xLApsZPOVzkA/k76G9Ca1vBvIaMcvtyx3L7aVHZk9eH/8EWggOOhpqO7OHuncEgpiD2fRB5JFEUduaThJhA648cbNyRQaLk9HmlGh1rIrJ4pCsL0MpYvAr3g2kHvT042U9OIk+5IsvxVf;25:WWAuN/jVWu82gRXMzlNaeWDu8CrWFNLb5uw2lCq5Kcl/qu8ivwoEfox85GfF3IVsm5R0XS1028ESyXAcwxUTmkjXysN6stwNSJMFMnAK78zBxuPIFgTxAmVpH65S6ctGzE1dhtQK2EtZLyJaE6dtIJ3Gqy/VJV/gg0ZTlkDGJVnvSTwtdYl8mK3wHyUr6XhZ61Ohw6WK0bHrj1DpDsQI/ZQswxFxaAqKvjaOZUgSBy0Cr4jFxwIkYeu+egxKBbHyA3vjQLxzc/AmxdYHXr7j2sd8hzO4BcCEMIz3ekUsg0EVy6ELagbXDL4RwHQjpA0MfTyowk8f6qwo8FaSCYXDBg==;31:1QxTzrHOrMBgFNu+AJNGX342XJXc2EG+aNdVn0YY0vFdxI7RUC9foO1UcmgAYg1B1RLjXy2UEK7d4Ds0o464mBDsVm2RQEwCgGqbxT8rlRaSUBBfa3tlr9Uj6jeJRoRZUlApFC2JMp3EejTT+jLRvEHt28PRSZKVV/CBqTqFQuNiRlf/j4yS9RiObfbIscBhC8d65bNbkwQ2UMTWcUxQce3gGOfiXyMnSf1dvkbJq6c= X-MS-TrafficTypeDiagnostic: MWHPR14MB1664: X-Microsoft-Exchange-Diagnostics: 1;MWHPR14MB1664;20:uAwFtjCu0x3U9L/PNcLOLBNX7SkwPjOa2Xl5uMIL2O3NOln9O7BuX0H2M2IucKgCMcOsxyd7CjKqjq/9zeifx9ofr0An0i+/F70l86cIPtjiKnNuS1C0kf8bP8rmEUe22l1iQtIMyF6f0zMIZ96TN5luSUCtuv9DO6A8zs4x1gv6KteTP6s4xIN1GwDXHi6gsyXWYU7hydbkssAsHVt1hAbuPm2JaUyygPTBeu09wPTcmf/rFJspFUbv6OEPdbaohAaLYpt24x8Hz0BDkaXQSXU8gJY2gyYCgrMKDJuWR9FO7+qxDVZ2PLvUfYETN9DciD+NkUMwnuixT1eNwhCcN7w9+efCimAAqfEyaG3vhMT5VuuH5MEJtxM0BUGIofyU/UdcMvrcuX1ZaRF6wSifULC+tJUAfqWed8EJSrTpGKAeFK6gPvwK02bevrVCyg3cLSoHTGW5qyR4Bs3Hb9xJZ0DEAl0wTrQUoRRg8TIXEzMI7tjPJ5FI/I/lBujAv5O0;4:2Twm6N6oHf7qhsZ4E9fVFEk/pIdp8o6GTVOucqS2qmviIB3YmgsrQKFJzCVYvAyFXGKKugKLkaoyRe5qEiIBBOEQrvKxOd42B+j2+ENSXAYiydO2Tb9kiHwq3By3XMfej4HLcRbPnEHWi84Ntw6LwSX34DMqgXS6tGIkaDAxI7j7mbfuzzDy5Mv4rmBHVLOy4EM9wPgDsiMbxHuHnqBIdJmp0bhEEJr4Qh83yOXlJlB8+X1MTXUwxF65Fd6A/g4GXzYbEhh8wKFLJomxKxOjiQ== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(6040470)(2401047)(5005006)(8121501046)(3002001)(10201501046)(93006095)(93001095)(3231023)(11241501184)(944501075)(6041268)(20161123558120)(201703131423095)(201702281529075)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(20161123560045)(20161123564045)(6072148)(201708071742011);SRVR:MWHPR14MB1664;BCL:0;PCL:0;RULEID:(100000803101)(100110400095);SRVR:MWHPR14MB1664; X-Forefront-PRVS: 0538A71254 X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10019020)(6049001)(376002)(346002)(39380400002)(366004)(39860400002)(396003)(199004)(189003)(24454002)(377424004)(33656002)(3846002)(84326002)(77096006)(316002)(16576012)(478600001)(5890100001)(52116002)(33964004)(6116002)(76176011)(229853002)(568964002)(305945005)(88552002)(53936002)(6486002)(16526018)(105586002)(7736002)(83716003)(2950100002)(386003)(68736007)(86362001)(42882006)(6916009)(90366009)(82746002)(5660300001)(75432002)(50226002)(25786009)(59450400001)(93886005)(786003)(16586007)(66066001)(8676002)(4326008)(117156002)(81166006)(97736004)(81156014)(6666003)(54906003)(2906002)(8936002)(6246003)(106356001)(53546011)(217873001)(72826003);DIR:OUT;SFP:1102;SCL:1;SRVR:MWHPR14MB1664;H:[192.168.1.153];FPR:;SPF:None;PTR:InfoNoRecords;A:1;MX:1;LANG:en; X-Microsoft-Exchange-Diagnostics: =?utf-8?B?MTtNV0hQUjE0TUIxNjY0OzIzOkRMNmJ4M1dlWEpVSTF6VHkrTzY5UDJYUTlV?= =?utf-8?B?TVNlb0Y4RWxvYS9BdFppUFVSd3RoMlptdG1ITlJkbHZBNDNCWENVbUI1eCt3?= =?utf-8?B?Mmg1dlZrekVtRTI1S3FCajhHeTJydTlLYkE0WXVpeWxXTE52Z2tyN1NtR0lM?= =?utf-8?B?Q3JDbnNpUG54ZW94Z3JMRmx0NUpRL3hlTnFqaFlIU1lmMTJPZWFuTHVpTUVU?= =?utf-8?B?L2R1Q0kycWNzcGx5UmcvUzZydDE0ZkpValh2QlI1STlHSStZSkJucDhiMUNt?= =?utf-8?B?S2lOVGNaNC9wdTZSVGQ1Yk91QVpGR0tXSGxTT2lXcVlwVWppSGxrdzArZ2xq?= =?utf-8?B?UDhBSnRadnpUTjRGQndhKzI5YjA5a1grNzhwQ1dvSG1oUU9rZmRyemdDSVlj?= =?utf-8?B?ZjM1R2p6Vkp4dDlNWEhZN2RTWkJYNXRSWVJMZ2VuZFRLZEZDQkh1eE8renZ2?= =?utf-8?B?ams1LzZxU3l3N29BSWJ2ekR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jhT0RL15AoEpsDCOp9GflWgCpejUe0slFerwjL0l0f3vjZuN1MonCR7uyIjwg0qeSp+6PVK8QYO4NHYkKP02dgVCBVzrXlM=;5:C7/HYzwAurHVrH5mhlhfV/jx556nWZZizOtphhlpSmkRGHcgGKi6rg3MJZ7AigYtvqVHaZR1fbgSIEIA+lHddVEH6tXGRDwC+sGLXOpOS1YtRu0oroH1pj6pm1YTymdcj+VOm2uNNMfnZFujo12KgTxgs9+JWrgJ6CowT7t+79M=;24:Z+KwBXUUddVXaTQDLwxjjLMMuKF/qP9mEjRRiqFXotX2YXKLiQYYVcf7Vbo+gTB8QLsxNhITp2313GCbyzKU+Dg4Jncb2qSzonLWapG8Kv8=;7:Bj+pmQj6uWuQNGKfGQ9NdBN1h9IM7fhYwGS/N9ab1dpZJx9VsF6AewyO0VqGbFubnDGzhyunq8eo1JmIcKz+/SE6vW+Q297X2/jUEcLpSx3s/wie165PhrpjgWPuc+rv56Sl1umtOrpk3GSlm3MgA9k0AI0vYWPTUoXk4Dr5JS1c04h2vATBXameRIpT9eu3nvZFk4ZVHNaoiHaG82bO+MCiwecpRMyJrG4zQPNCYhvrx7AMfp7wL5RPFBdOt77f SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: cs.rutgers.edu X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Dec 2017 13:10:02.1011 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 34db7fd1-4698-46a9-a906-08d5504fcde9 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: b92d2b23-4d35-4470-93ff-69aca6632ffe X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR14MB1664 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2919 Lines: 88 This is an OpenPGP/MIME signed message (RFC 3156 and 4880). --=_MailMate_DF0F4D66-2B57-493A-81AD-6BAC75A54D4B_= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable On 31 Dec 2017, at 4:07, Michal Hocko wrote: > On Fri 29-12-17 10:45:46, Zi Yan wrote: >> On 29 Dec 2017, at 6:36, Michal Hocko wrote: >> >>> On Tue 26-12-17 21:19:35, Zi Yan wrote: > [...] >>>> And it seems a little bit strange to only re-migrate the head page, = then come back to all tail >>>> pages after migrating the rest of pages in the list =E2=80=9Cfrom=E2= =80=9D. Is it better to split the THP into >>>> a list other than =E2=80=9Cfrom=E2=80=9D and insert the list after =E2= =80=9Cpage=E2=80=9D, then retry from the split =E2=80=9Cpage=E2=80=9D? >>>> Thus, we attempt to migrate all sub pages of the THP after it is spl= it. >>> >>> Why does this matter? >> >> Functionally, it does not matter. >> >> This behavior is just less intuitive and a little different from curre= nt one, >> which implicitly preserves its original order of the not-migrated page= s >> in the =E2=80=9Cfrom=E2=80=9D list, although no one relies on this imp= licit behavior now. >> >> >> Adding one line comment about this difference would be good for code m= aintenance. :) > > OK, I will not argue. I still do not see _why_ we need it but I've adde= d > the following. > > diff --git a/mm/migrate.c b/mm/migrate.c > index 21b3381a2871..0ac5185d3949 100644 > --- a/mm/migrate.c > +++ b/mm/migrate.c > @@ -1395,6 +1395,11 @@ int migrate_pages(struct list_head *from, new_pa= ge_t get_new_page, > * allocation could've failed so we should > * retry on the same page with the THP split > * to base pages. > + * > + * Head page is retried immediatelly and tail > + * pages are added to the tail of the list so > + * we encounter them after the rest of the list > + * is processed. > */ > if (PageTransHuge(page)) { > lock_page(page); > > Does that this reflect what you mean? s/immediatelly/immediately Yes. Thanks. :) =E2=80=94 Best Regards, Yan Zi --=_MailMate_DF0F4D66-2B57-493A-81AD-6BAC75A54D4B_= 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 iQFKBAEBCgA0FiEEOXBxLIohamfZUwd5QYsvEZxOpswFAlpI4aUWHHppLnlhbkBj cy5ydXRnZXJzLmVkdQAKCRBBiy8RnE6mzFYBCACbrsKeuxRDFzChCBOpGQp8VXdq gORiB9334hYvpqjueiQywiGpnufJ7kT2cqLC56jtr20eTivDujL1dtuVnxHqapx3 UuiIpkhp9K5q3VdHo8Rswo8RE8kEM12DWedL3dh5ABKCnDyrARpeVSTDgZCgQGuA 0g+Jq4Tx+HyHaLo8iY8WNsUH7DWVSAMuWlN01rt9G8Emm/2Irkx3fozmv+26gZxK cOAHpgaDMDHzwheJuhrcVMrw+9F5+utuCyHDUQnypZqppfSBPPrSt+Vn/DMlqeKZ EQt1r5FTkb8sfre8lk66d4DrkvGhvZ11lWaY8437O12YF4mumiknRj8gABq+ =QmL8 -----END PGP SIGNATURE----- --=_MailMate_DF0F4D66-2B57-493A-81AD-6BAC75A54D4B_=--