Received: by 10.223.164.202 with SMTP id h10csp282803wrb; Wed, 22 Nov 2017 07:10:06 -0800 (PST) X-Google-Smtp-Source: AGs4zMZ+ssIAeyGNCy5S4tuVO/mIZeB+YjsaNrDeVLlunMQkf2EGSc6xwvj41w/wTYQIR4i82DVd X-Received: by 10.98.102.219 with SMTP id s88mr19728593pfj.191.1511363406753; Wed, 22 Nov 2017 07:10:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1511363406; cv=none; d=google.com; s=arc-20160816; b=XJ99ls8pgLNcHbKvMNP85BKlF+Mpb2lQMzS0+4BPAlyNP2V6dyox3X2wgZ9lDhXutY Jvywybxkirv2hcu1m8nFoNb5B8qA9f59auM3FtVqWzEvTYAQIKARlXzgU/2P9IgdE9hL fGN8jmFE+yKs0jYoN/f/kbLs1vk9nhruraPYTaTPRCJR9bSPyvJLcdnVyHG5ZfkPs01y xFBmPFa/ItDLZwUm++TNC9sizRtBa977EjUcLDO9RQ8QW2san3xxoJnrzvc+Yd19HUe2 4a62KpJeawTcrHaEXuRS9tkWVkGT0uYrCUUePD8BQlXLPjnCxFC1kA27LmNNdBlpZfzu PQ/Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:spamdiagnosticmetadata :spamdiagnosticoutput:in-reply-to:references:subject:cc:to :mime-version:user-agent:from:date:message-id :arc-authentication-results; bh=wRhG2uWwc6butbiKqhBXR89Tqb1oJwc3H4Jrz3W92X8=; b=v4mZinip/vBflm9ISEGcHq6Ubk/kMEjFAUHQEDa11Y21+q1gmE+CVoAwC+8IgJlV8S mFy25B9M04EF+ts9NRy8s5VFAJ6cAUVeGGdW5XYDTItvRqbWhEz1bmKKnb7RTb5lm1uQ D+yRGTga87fhvWpA3RDsSN5ieXWgnVy5EEvOA2DfREnFi0x0lONNhbKdQSI7rOIT8MsO B26CGYNRZRywNTLP+x96yc4xXo81hYxjX/F6z2fei4V7dZlGMPpPjd7KVw9bEXQaiwYv 5zSYkKEBoXY5RpNHEl1B7TRbOJKOzouOvSD1clxlvUh9+vX0+YmAEJB/8JojbcJ/IPIi O4DA== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a72si13511166pge.529.2017.11.22.07.09.55; Wed, 22 Nov 2017 07:10:06 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751723AbdKVPJL (ORCPT + 77 others); Wed, 22 Nov 2017 10:09:11 -0500 Received: from mail-co1nam03on0132.outbound.protection.outlook.com ([104.47.40.132]:64844 "EHLO NAM03-CO1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751371AbdKVPJJ (ORCPT ); Wed, 22 Nov 2017 10:09:09 -0500 Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=zi.yan@cs.rutgers.edu; Received: from [100.72.60.146] (12.250.207.42) by MWHPR14MB1662.namprd14.prod.outlook.com (10.171.146.144) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.260.4; Wed, 22 Nov 2017 15:09:04 +0000 Message-ID: <5A159319.6070403@cs.rutgers.edu> Date: Wed, 22 Nov 2017 10:09:13 -0500 From: Zi Yan User-Agent: Postbox 5.0.20 (Windows/20171012) MIME-Version: 1.0 To: Michal Hocko CC: Zi Yan , Naoya Horiguchi , Andrew Morton , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Andrea Reale , =?UTF-8?B?SsOpcsO0bWUgR2xpc3Nl?= , stable@vger.kernel.org Subject: Re: [PATCH] mm: migrate: fix an incorrect call of prep_transhuge_page() References: <20171121021855.50525-1-zi.yan@sent.com> <20171122085416.ycrvahu2bznlx37s@dhcp22.suse.cz> <20171122134059.fmyambktkel4e3zq@dhcp22.suse.cz> <5A158D22.3040609@cs.rutgers.edu> <20171122145307.52klaq4ouorngsss@dhcp22.suse.cz> In-Reply-To: <20171122145307.52klaq4ouorngsss@dhcp22.suse.cz> X-Enigmail-Version: 1.2.3 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="------------enig7E25352A517722FE458B5745" X-Originating-IP: [12.250.207.42] X-ClientProxiedBy: CY4PR16CA0023.namprd16.prod.outlook.com (10.172.173.33) To MWHPR14MB1662.namprd14.prod.outlook.com (10.171.146.144) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: c1d84a93-15f4-484a-841d-08d531baf976 X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(4534020)(4602075)(4627115)(201703031133081)(201702281549075)(5600022)(4604075)(2017052603258);SRVR:MWHPR14MB1662; X-Microsoft-Exchange-Diagnostics: 1;MWHPR14MB1662;3:kWldyGkITNbiB1G+BqXhAI7Kc6yc32E3+cXRmfLybCGc56Ze5Ny8CvAj0oCJXJ5I1qG0bz1mROjM3uUtLUaq9hQbVfqESrN+rfCvHGgmieGTEMCfPqb3s1PLBmZjpGg2Dq/jb7zG89QrC5fBi03WEwKBgu0UGD2hjNbms8IM6GlUyRtlGR08nPHVQCJfUFMJWiuaSdOv+Nbq53zv5I8lvBPmMMTPprI5fMkue++yCrPkzmF8sqIV/pOMzvVlMrch;25:K+76/kQA+ZMFx6e1RBqIkMnfSCcCUyTb9PavpE1LX8ht10Y3X5CdQAzPrA4WQNjUGU9mPwmoTcnHJXQk3iK6Xd2seUz99ne9kqMAh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PxVenY1RjlWmUea4wbgnV/652o+MnwxpFn4o+x3s+Nmfr0OwOG3oJLe1woP0Fn0JEVQofuAtiGhemY2yeGBVmMSPuWY+aZi2WB0hN+4rDuCeYtmOdt/khNr+O4Meo1fi790WzMwraRpExkN0BzPIjescCo6oi7w7a2zSbwzspauQu/Khu9goBRsvX3PcGFBTCPhV5gK3WCuYvDEXtNMyGAl5cl58EP7ThFEdDncraMijifMXwMxJjL8ApTPYjO5DcoLGL1IMnLPy/7ruNg== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(11241501159)(6040450)(2401047)(5005006)(8121501046)(10201501046)(100000703101)(100105400095)(93006095)(93001095)(3231022)(3002001)(6041248)(20161123560025)(201703131423075)(201702281529075)(201702281528075)(201703061421075)(201703061406153)(20161123564025)(20161123555025)(20161123562025)(20161123558100)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095);SRVR:MWHPR14MB1662;BCL:0;PCL:0;RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095);SRVR:MWHPR14MB1662; X-Forefront-PRVS: 0499DAF22A X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10019020)(6009001)(6049001)(346002)(39860400002)(376002)(24454002)(377424004)(57704003)(199003)(189002)(58126008)(8676002)(50986999)(478600001)(106356001)(25786009)(81156014)(76176999)(81166006)(786003)(66066001)(83506002)(54356999)(316002)(2950100002)(189998001)(8656006)(65816999)(68736007)(54906003)(84326002)(575784001)(6666003)(101416001)(305945005)(105586002)(86362001)(6246003)(7736002)(93886005)(97736004)(53936002)(59896002)(4326008)(87266999)(21480400003)(5890100001)(568964002)(16526018)(75432002)(229853002)(6116002)(6486002)(8936002)(90366009)(33656002)(16576012)(5660300001)(49976008)(88552002)(42882006)(6916009)(16586007)(2906002)(80316001)(3846002)(78286006);DIR:OUT;SFP:1102;SCL:1;SRVR:MWHPR14MB1662;H:[100.72.60.146];FPR:;SPF:None;PTR:InfoNoRecords;A:1;MX:1;LANG:en; Received-SPF: None (protection.outlook.com: cs.rutgers.edu does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;MWHPR14MB1662;23:TJUZjnwFo3KgZiIPEC/trNCVPCf0oeZHgodtZSqPr?= =?us-ascii?Q?YK2jnv8/5AQarif1OLCWVQVZmTaane73lSJ07rMLxrzKHwz6C0EZNPkCKoF2?= =?us-ascii?Q?345qwNArCWYzJAvbHuD8SQPcSIhe3vCZuQH5Dhiws2UgcnZ/K3Cua1wU3kJI?= =?us-ascii?Q?KBSMWKULlSRHswA8xzXS6kIuducPGkzQDkDuLnxfcSx971LLbvKxbg5LB47X?= =?us-ascii?Q?fmTknRNN8wb+CjXBYwL/Xze6lW+lqJ3q69fMajc6tzIuPenmEkXjGFSojM5K?= =?us-ascii?Q?9T7hRUVhYTkWm5KiGzo1bHm00xoUQuqZFlaMmLaip8+0EUDTqV/oOInZZQZJ?= =?us-ascii?Q?a7PHC7zJisTP5ByhgMuQuuRrNn9wxKJjuOOHfJ0WqbriiS30rb+OdIoUWvbh?= =?us-ascii?Q?brbHoLOGOUGUlKNguAjI9NSKNq87XTF4sbIFiQgbFFtQTBnZswLD7KimxwVw?= =?us-ascii?Q?wEizYh/BAuHN7usfkHkFn435mEzve9q07bi8hCZSm86nF9cWtE8dcEUNmeyv?= =?us-ascii?Q?YWV/Uxi/NtP5p16CvimLYtkWHAhj1vEj42LLMQpI72B/1eXDLVK/bhJQMbYk?= =?us-ascii?Q?Dp0SWIZnSjqhavCtDWLdFjKG8+2sE88qvHjsGScMZfhjjQimoyeeTdq18FrA?= =?us-ascii?Q?B0VH/CcIZLq2XjopdcxrSaWIA6nVgDZEZvxYBUPH0+Tcf9C2mNQR2gLWvl58?= =?us-ascii?Q?sG0uS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 1;MWHPR14MB1662;6:xPoIYbvgMcDqFqHjmQJGu9zJw24GlxyuqgRy7ZgKesLNJRmcOqS/gFVG/ldydk0dqnfgP5f2ms4S4gW327IjXhauGKy+JO+N0ftYDXrT9c6XhU/52a21ZR5o+uyczl5AbxN5nnVI89b+k9QlzrgmJAKFUuZvooj1UO5MOzjnu3VTo5yYm9Xjm7NYvG2iHk6obvaqoZupw6s9+pS1dp43AbxqZOvM5RhkKr5Veo96LE0SI0SW9f2H+aZtfhkLSn1SfUHJlI05geUGLkddegr5W0cyWhxGcsBRf1JutbbWM/bNMCvIB9KUOVYT64TGhsmSNA3D51TgYChF5HwHW4D3UzKHw4dU9oYxDpiyGmbOTKE=;5:GYF46bk53kGbjAo9XYw/ktOheJhQ0zSwlXyKgd3gj590hlbl43zqIMt8AmYjCNNwX/nnOAcZIcAW2tkknlrWLm1TTpVIpt3ShB2NVcODAhTok2qCTQWf10KD7+ap7nCdKfsrOSIHc5TmuipMg5iTw3G0YbUBvcmBYU2+zr/1ot8=;24:dgXqiq9ZqgL4gep7Hy/T2x5End0Ca5VOhW5561OT4UabaCTcsOYlxJV0NrYpeWdQcgnG19ZNbUL17woZgUAiapl8vu1RdheuMSChnslZ/DU=;7:7iMPiePsEtFWCcYkcQIYZ+lalkIMvFiFNixmr1Ox6HWymJNQUGjQ5jaoSsCqC19Trt0MGWIx3pOY5qMnaZuWshRk7zwHnYOEhaNlstHpe+LyBybCkM//KHN80PeUYZOKFypSbG6SvSyRUz+DsKoXLDH1Wq63e3Y8jlvCLBIiWsc0vq7q3jBEETQzwimwBpBM+bzO5EUU5WhiDsPaleFq7hKWHuBsiQ5dScMLoHIr6eJsKfY09q+qiNgu1eritlYm SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: cs.rutgers.edu X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Nov 2017 15:09:04.9108 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: c1d84a93-15f4-484a-841d-08d531baf976 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: b92d2b23-4d35-4470-93ff-69aca6632ffe X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR14MB1662 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig7E25352A517722FE458B5745 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Michal Hocko wrote: > On Wed 22-11-17 09:43:46, Zi Yan wrote: >> >> Michal Hocko wrote: >>> On Wed 22-11-17 09:54:16, Michal Hocko wrote: >>>> On Mon 20-11-17 21:18:55, Zi Yan wrote: >>> [...] >>>>> diff --git a/include/linux/migrate.h b/include/linux/migrate.h >>>>> index 895ec0c4942e..a2246cf670ba 100644 >>>>> --- a/include/linux/migrate.h >>>>> +++ b/include/linux/migrate.h >>>>> @@ -54,7 +54,7 @@ static inline struct page *new_page_nodemask(stru= ct page *page, >>>>> new_page =3D __alloc_pages_nodemask(gfp_mask, order, >>>>> preferred_nid, nodemask); >>>>> =20 >>>>> - if (new_page && PageTransHuge(page)) >>>>> + if (new_page && PageTransHuge(new_page)) >>>>> prep_transhuge_page(new_page); >>>> I would keep the two checks consistent. But that leads to a more >>>> interesting question. new_page_nodemask does >>>> >>>> if (thp_migration_supported() && PageTransHuge(page)) { >>>> order =3D HPAGE_PMD_ORDER; >>>> gfp_mask |=3D GFP_TRANSHUGE; >>>> } >>> And one more question/note. Why do we need thp_migration_supported >>> in the first place? 9c670ea37947 ("mm: thp: introduce >>> CONFIG_ARCH_ENABLE_THP_MIGRATION") says >>> : Introduce CONFIG_ARCH_ENABLE_THP_MIGRATION to limit thp migration >>> : functionality to x86_64, which should be safer at the first step. >>> >>> but why is unsafe to enable the feature on other arches which support= >>> THP? Is there any plan to do the next step and remove this config >>> option? >> Because different architectures have their own way of specifying a swa= p >> entry. This means, to support THP migration, each architecture needs t= o >> add its own __pmd_to_swp_entry() and __swp_entry_to_pmd(), which are >> used for arch-independent pmd_to_swp_entry() and swp_entry_to_pmd(). >=20 > I understand that part. But this smells like a matter of coding, no? > I was suprised to see the note about safety which didn't make much sens= e > to me. And testing as well. I had powerpc book3s support in my initial patch submission, but removed it because I do not have access to the powerpc machine any more. I also tried ARM64, which seems working by adding the code, but I have no hardware to test it now. Any suggestions? --=20 Best Regards, Yan Zi --------------enig7E25352A517722FE458B5745 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iQEcBAEBCAAGBQJaFZMZAAoJEEGLLxGcTqbM1y4IAJDtvB1GGuQgmdJq+GALYpaw nRcifkoS1YHwxUHEpyAGH3KX/X2GVy0ZkC8Ix4XaqQ848zKEXk8ZEtkFn2EH7fzj pOB5cTKXTkpvMc5qHl44c7QI7ABCwVqo56vyg1aAcXU6grMROzIlLeLFvqYTpUPH L/0UYR5fHFJIcJr8HAa3oDg4YIVWYNNfGcDdrx9ZS8tHqJCOiwF8vWAEFCTAlQPD fBeumd2bJrzuJSzVl77wBBxX1v9OU/y0r2r2noe2sArvM2fk/jZEzdSwEMxPBdWR vcXUOB7SQDjpSsQkmzJbRi0DguyUzZbc0XXlhUpUrqqR0uP97SNPClGd1m0kcZ8= =+pVC -----END PGP SIGNATURE----- --------------enig7E25352A517722FE458B5745-- From 1584778383616772099@xxx Wed Nov 22 14:54:01 +0000 2017 X-GM-THRID: 1584640362012575170 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread