Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp3530975pxb; Mon, 24 Jan 2022 11:32:05 -0800 (PST) X-Google-Smtp-Source: ABdhPJxOAm3cHYOpY036sSGHvptD3Q18B6rioiTFxozAiqKvRSIgeT+/5z9b1E2PotMQOGz45J/M X-Received: by 2002:a63:7544:: with SMTP id f4mr12722552pgn.556.1643052725122; Mon, 24 Jan 2022 11:32:05 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1643052725; cv=pass; d=google.com; s=arc-20160816; b=O4wGxB0R6tNfWxjtX8De21n6WJXziakx67L7JL/UZBT3Dhj3L6casdjz0P0B2SWjRS 69lHjxf4FnqjDATKKlh7KN5Ty9voSATXFkOZ74k8faB+sto2HVNYdCdheD7i9tMcbJmB NRlQye1Lx2Ao0oWWOdaBjenB5sHr1P7d3D5Om6JcWavBS5Y243aVvk16dSIV8bdUbFSz hZFCE3M245gz9bauzh6Nvl93dd68Zvqj6iHHK3AsY9kTFeTBftNJAylGCcIxY9uHgA3T BY5fXhNnr08kwE4q/Oe1r8zLjyRjRjcjSidWx+RDuMHZk4oIBU+yC02h2yzq6+a5PsWX 92DA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=InWxZcQ7w3/rd06SeMSddmGSTexiNW3XW7qGk9LKhxM=; b=AvnmQG5cj6yaffQa/Qc+XYZiOay/EF7TYFs9W49q3uOJosHN9ufWkmG0SFgNPQi8zT roW26rT+FbL6XlmoVLmD1r/jjM9Ewo9feuolwQS6USU0QEcwo6Rnls0TrUhJ9wzvcE3G 9ZhUpL31ujtfjzWH8bQ4LPz/JL4ClTObGezwn3p1/h1dzB0Zc+EBogzN1NYHmcRGaDr3 aavuiPhHRTS/K6euXotNbu6tfOACtTpQhE4UvGHnvHPYNKTMZ4LMsFq8Eep/EXPDpRwF NN5DBKf8Otqa4MNQMmD2Cq4jB1e3Xz6q4PFQPUScbz2Cdj5gfiEd8c9l4Wgz2nR9yjv3 RXKA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@Nvidia.com header.s=selector2 header.b=iSni84A7; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=nvidia.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u193si11704751pfc.334.2022.01.24.11.31.53; Mon, 24 Jan 2022 11:32:05 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@Nvidia.com header.s=selector2 header.b=iSni84A7; arc=pass (i=1); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=nvidia.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243275AbiAXQHk (ORCPT + 99 others); Mon, 24 Jan 2022 11:07:40 -0500 Received: from mail-bn8nam08on2082.outbound.protection.outlook.com ([40.107.100.82]:58848 "EHLO NAM04-BN8-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S236170AbiAXQHi (ORCPT ); Mon, 24 Jan 2022 11:07:38 -0500 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=VjQOgSOfPEDYSKreq4HRZ50E9sgIkeh6QV0M+xx4E1wg3aX+etzaBLTDPaIvHyb7/Hu7mQ6Y/syWxjTkvasuQM1SmkHubT4A5yzXXG0vF2BJRR++B/pFXAVAm6Rw9hzjReecGqAaBPn9CgGFqiboaNRJw1mk2gh2NMUTjcOP3U0HBvs3jzN3V7UKyzfBzsshXGqGaX1ngS31R5tpleANWyw3J553ke5CDUVTOOQySKLX+ZmlXi0AG7ywcSACan0M8CLtn2BC5YCNfSad/kCRIyHIoEJ9kvj90iTJICkd6Bnt78R4HNrmWhmudozetI1GUq99HYuHSDjL0HZlDKlVoA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=InWxZcQ7w3/rd06SeMSddmGSTexiNW3XW7qGk9LKhxM=; b=jOOh0EvT85v1XMpgzLePdXydDZRJLnrD4GmAIid0aiZq9+p1pIOcbUMfaZXRrhW3Y/O0GPhbvSk/aVz9zp+VCm2aqmJwLZx8e1ohZAxE1uk6tjWQsS6SQZLlisPh8PJ9sV0OlBU2e4gkwqPaBSRW51d+5sVxIDGQyjaGmCLwrIt6w5YkKtWR75ygbfS5YX3upVn73/r1ynLRIGqDf8JW9LXkhOZElJEbU6Ye0ZnEuAvCfbAsfjPZER7DtDEWZ7hVXFxbcBlmRmsm2YV2ECnAC2Uf9fz4Oull/DP4RGyPgI7GobzOlXWauRFvXVooOiQsbk73Rj9l79EiJjreEVEJcQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=none; dmarc=none; dkim=none; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=InWxZcQ7w3/rd06SeMSddmGSTexiNW3XW7qGk9LKhxM=; b=iSni84A7+xST6vJrf7LbAxWVJgVwUXk3syTYA/xGVHY1Kn20/GfRiJDXxsybgN2WvjzZIUw6yzUai+wmqd8GdxJfYIS12N8j44hmlGVWG6Ge4PHytaE48wqq0K92l6QQ2uQ+QV0A6P6hJOSpv836tFhJn0VV2a+cW3kXWVIvZ1zaO1uVNnVetw7FN71tL+5rZ7+qjF7ltOSBvHbDKrGV1GWy91CFiN/8x41dzpozLc70dKzp4iQgOKIWiLYh4xbPZnkBNQJ4A6ghKkv22tNh8q2tCNCCExLiuVxKLdnZ07rXzpQirpw/4FhexHRlTZHv/r0naahPuQCCA9PMUSaOeQ== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nvidia.com; Received: from MN2PR12MB3823.namprd12.prod.outlook.com (2603:10b6:208:168::26) by BN6PR12MB1905.namprd12.prod.outlook.com (2603:10b6:404:fe::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4909.10; Mon, 24 Jan 2022 16:07:36 +0000 Received: from MN2PR12MB3823.namprd12.prod.outlook.com ([fe80::a9db:9c46:183e:c213]) by MN2PR12MB3823.namprd12.prod.outlook.com ([fe80::a9db:9c46:183e:c213%3]) with mapi id 15.20.4909.017; Mon, 24 Jan 2022 16:07:36 +0000 From: Zi Yan To: Muchun Song Cc: akpm@linux-foundation.org, kirill.shutemov@linux.intel.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org, duanxiongchun@bytedance.com Subject: Re: [PATCH v2 2/2] mm: fix missing cache flush for all tail pages of THP Date: Mon, 24 Jan 2022 11:07:33 -0500 X-Mailer: MailMate (1.14r5853) Message-ID: <1F326ECC-9F85-40CA-B731-0945BF071FBF@nvidia.com> In-Reply-To: <20220124051752.83281-2-songmuchun@bytedance.com> References: <20220124051752.83281-1-songmuchun@bytedance.com> <20220124051752.83281-2-songmuchun@bytedance.com> Content-Type: multipart/signed; boundary="=_MailMate_25E49A25-621D-4FC0-B37A-8E9EB4A44DDC_="; micalg=pgp-sha512; protocol="application/pgp-signature" X-ClientProxiedBy: BL1PR13CA0321.namprd13.prod.outlook.com (2603:10b6:208:2c1::26) To MN2PR12MB3823.namprd12.prod.outlook.com (2603:10b6:208:168::26) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 758cb33a-5c3b-422f-2a55-08d9df53a2c6 X-MS-TrafficTypeDiagnostic: BN6PR12MB1905:EE_ X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:7219; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: vgvFZVW5YPHG7in6fp6iDu9Eby47FBqzLAGlDh0JYZcOQB/dherhea9s6m75cpDMQs2YWnJfQVVfgjZYeNXZp8MZZeN5VRCTPDhwHug2lzR7BkCPPZmlBU1ZHrJzQfulx3gb007NKJHluVB2af+iquR1jKLzMv7WIJOEoNtnGzeiq6wmEY3C8nxd3q0I2T5Hefws7PxAFsvVii/ECrmHk8KAZEf4KdRhkTFEuaySz8bZtLDJBjxi6L3vsbb7CDvvi/CG5Gz8ytRJbKfkk5SkbrGwOmkTyRz+SMQHaHgMhf8DX8jirBQ+LGoJlSjatyikHWqJZseSiDGVrW+U0YP+inIBgkLUbZ70AfiE2YZ8k8xkOloRFmgXw9BuHhM5pTD8LrJroRnBx8rmJFh91ZAuvLfbGryrC3tBZjq/Jt5VvD2FetqSDnrTSGkZF1PdCRbhWp7R0Dr6HRSR0tdMDGvq7GOv3nV3x+oh3ZTz+iaS3b9TQCkfArQmmR+yZOj/p+YVD3Fj7cGzCqrhYvQdtvkUYW5+EXQHBgwOQqc45qlYNdY4SisWXUHF0qWBCfjfBSk4eS+KIQmp1t3o3HVtxK/7XdsWcVeua1AlO5MGalkaIkJ/pcpGkRazy2MO6xfjL7CRLvn0svmhxhmTVUIw0KxDtwduCCO0wcG+NDEwsPUWuYvMozeplJA05yRPWyln/4EMBCjycv9TafEEaxoR/l/08GlZK0zxLfWHTr+Mx+zcUoU= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:MN2PR12MB3823.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(366004)(21480400003)(33656002)(36756003)(53546011)(83380400001)(6486002)(4326008)(8936002)(186003)(6666004)(5660300002)(66946007)(6512007)(8676002)(66476007)(66556008)(86362001)(2616005)(6916009)(38100700002)(316002)(2906002)(508600001)(26005)(6506007)(235185007)(72826004)(45980500001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?hVQEzROl+8o/hBQQCZY2TKzR+bB4+WMJZybuLmLn7TaEgwrMs4kw4HSR5r34?= =?us-ascii?Q?Ka765j0N9jRIWdaOkdG2l5ZbKmo6KmslAIvMD5rUD9SPLtjEe/XaYRCvaZzj?= =?us-ascii?Q?CjOw4KzVO2tWw3PCNRqpOCoMC9kKK3zzc1RKmEuxvyViLCDvdaaleK8Ca4lg?= =?us-ascii?Q?ziaACpAyucG9EQ3nJOwnMrE+iluszvWNuQWZlEU0xdU0ZtMiLx3IXNycmesF?= =?us-ascii?Q?VX+KWbTAJI8vayyye+8orgPcshVHkfTyaOTdLKL5V4FbrorVeLQaHATlLakK?= =?us-ascii?Q?KDOb7pdIDTHG8c4FfCgImKhOEnJInPxs1SFxz9kl3qYMV3oOPI9qOWin7QGJ?= =?us-ascii?Q?q1BbyWU3exEpmxuFEvXcPg9d/f62RmtBK0Q+Epu8IwHEK/pTVuSxW+pGeQ2E?= =?us-ascii?Q?OmZiSlUZuLD6pt8H6o+F8aLjN5VEK0m/j4S+UvrtvXfCyWY0uA1hopkxAL3F?= =?us-ascii?Q?QTCVUmPiyP0GrDlDp1kS+h9EnqsJ3e1ApIeW/c0DHI4aM9bIgvzFo50g0ij7?= =?us-ascii?Q?ppzmuhgYmDRp/+j3LCwDrA9biApcCiS8neTW3s0F6J/fkwqb7Fr2OdU7EKko?= =?us-ascii?Q?pMANKgPyyGl7IIlZ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027NpBB+?= =?us-ascii?Q?w8i8JZIE7/a3rXKCwn3DRGHv3hW1Edr68IyGj/dNCqGEH/Lm0HK/SmYrsKka?= =?us-ascii?Q?FphwgNxXxfoQH8P1imM=3D?= X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: 758cb33a-5c3b-422f-2a55-08d9df53a2c6 X-MS-Exchange-CrossTenant-AuthSource: MN2PR12MB3823.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Jan 2022 16:07:35.8779 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: fJifXROLIuITBGGHhUCTLWvmYOzPTKw4R33Li+X8aHFnxhVxTekEV9+o8qxNaotu X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR12MB1905 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --=_MailMate_25E49A25-621D-4FC0-B37A-8E9EB4A44DDC_= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable On 24 Jan 2022, at 0:17, Muchun Song wrote: > The D-cache maintenance inside move_to_new_page() only consider one pag= e, > there is still D-cache maintenance issue for tail pages of THP. Fix thi= s > by not using flush_dcache_folio() since it is not backportable. > > Fixes: 616b8371539a ("mm: thp: enable thp migration in generic path") > Signed-off-by: Muchun Song > --- > Changes in v2: > - Using a for loop instead of the folio variant for backportable. > > mm/migrate.c | 7 +++++-- > 1 file changed, 5 insertions(+), 2 deletions(-) > > diff --git a/mm/migrate.c b/mm/migrate.c > index c9296d63878d..c418e8d92b9c 100644 > --- a/mm/migrate.c > +++ b/mm/migrate.c > @@ -933,9 +933,12 @@ static int move_to_new_page(struct page *newpage, = struct page *page, > if (!PageMappingFlags(page)) > page->mapping =3D NULL; > > - if (likely(!is_zone_device_page(newpage))) > - flush_dcache_page(newpage); > + if (likely(!is_zone_device_page(newpage))) { > + int i, nr =3D compound_nr(newpage); > > + for (i =3D 0; i < nr; i++) > + flush_dcache_page(newpage + i); > + } > } > out: > return rc; > -- = > 2.11.0 LGTM. Thanks. Reviewed-by: Zi Yan -- Best Regards, Yan, Zi --=_MailMate_25E49A25-621D-4FC0-B37A-8E9EB4A44DDC_= Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQJDBAEBCgAtFiEEh7yFAW3gwjwQ4C9anbJR82th+ooFAmHuzsUPHHppeUBudmlk aWEuY29tAAoJEJ2yUfNrYfqKdbYQALGOgrnDoIpBetzqBP/KGKbtF2o/DwQfjwto VE7wgckZvcW1m0ZiWkEOI6ja3kChUYjoQw0rsZghPJjY1pQdv7MJLmNfofbFi5H2 E4mE3efv/AHZQaBODnvrylBOGoL1x8cSI4BADZNWpY7QC8dnjswCjD196NrgJ8kz ZGVPcF36N5oGtXto3Bs0bnbLRBA36xwq4d4RHjSjr3sk2Y9nWa3g6iZ3sTJpdwY1 wfEJyXGKZ+F+68Jc4XWZyRarM5Fw2UzDVW7Fkf9WM5nvVVcAeQU/Fc2RIKE5wPid RoJ1vQTOFha74a00aZOY0iQdKBTFAUCLvHGHRUqKLQR1yAtfRPvborxynR+AsBSE ugDEBfiuaZazpAFrdOEY/RHPA/xHt06ZHPrvJDaK6XR6xOwusU8TPOKpkIXxeVTS KzV34o+XdrH5Cr+rVYtAZdNOtzK7PId8bMoeq0Sih2TYLxTgDzaJKwgcx/fMtjRg naLpGDIlxkcFt1dj27e3BO4V2WNDRFHMUh0OGuoWICQp1mkmWNeA7zi16DwCHW4Q x/vtidqYlf1x2ZMTgAiEHCkjGT5Is7GGU9UutDM3Be7SFvwCRxdqDyHQef13uv+k iswHDPdR0KAgpSNdQAuM8edhmBkf9PgZZDNr4WD+M3ACvcQbTO7x/dQys9nJWFVW eSLgyKaa =znuF -----END PGP SIGNATURE----- --=_MailMate_25E49A25-621D-4FC0-B37A-8E9EB4A44DDC_=--