From patchwork Fri Feb 16 21:13:17 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sidhartha Kumar X-Patchwork-Id: 13560698 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id BAA9CC48BF3 for ; Fri, 16 Feb 2024 21:13:46 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 28E806B00A0; Fri, 16 Feb 2024 16:13:46 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 23F256B00A1; Fri, 16 Feb 2024 16:13:46 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 06C266B00A2; Fri, 16 Feb 2024 16:13:46 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id E715E6B00A0 for ; Fri, 16 Feb 2024 16:13:45 -0500 (EST) Received: from smtpin16.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 8740514014E for ; Fri, 16 Feb 2024 21:13:45 +0000 (UTC) X-FDA: 81798918810.16.9B5DE75 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by imf19.hostedemail.com (Postfix) with ESMTP id 45C941A0012 for ; Fri, 16 Feb 2024 21:13:42 +0000 (UTC) Authentication-Results: imf19.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-11-20 header.b=aHDUZdnZ; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=ZSt1CDOS; arc=pass ("microsoft.com:s=arcselector9901:i=1"); dmarc=pass (policy=none) header.from=oracle.com; spf=pass (imf19.hostedemail.com: domain of sidhartha.kumar@oracle.com designates 205.220.177.32 as permitted sender) smtp.mailfrom=sidhartha.kumar@oracle.com ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1708118022; a=rsa-sha256; cv=pass; b=AzIA5d6ilHAaTMoJjsC2kaYKYnlRHEm2pXPvEx5apHK5EYjUFvNZsmdPkuhpJgcvvfnKF2 J8INMEC543y0NknRnNpzEI0XbNP3wB0eK2z2sOjML7NPxEM7/MXs5v6Tks/LaPjWVWxXcR 0RTdN596ipVpC/inG4ZU8a2VPnSzj8g= ARC-Authentication-Results: i=2; imf19.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-11-20 header.b=aHDUZdnZ; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=ZSt1CDOS; arc=pass ("microsoft.com:s=arcselector9901:i=1"); dmarc=pass (policy=none) header.from=oracle.com; spf=pass (imf19.hostedemail.com: domain of sidhartha.kumar@oracle.com designates 205.220.177.32 as permitted sender) smtp.mailfrom=sidhartha.kumar@oracle.com ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1708118022; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=7PLIpgoX0WzBhOeTtr7m+MCiuzEgYeEYqWfbsIroNjY=; b=4ygO/rnVoXV5brEoCmxVSnUCjv4Jfzj6zaNxcLIlATzeuG/+AzjdxeVFRRQsKw1sjyGCh/ 8Rjr2a5LtfKVF0l6+HEOwfIoP9M8iOci26PfIk+semjPVvD0exFKRTh7FtF00Su+Psgn8G 3kgqfRP1uEZ44E+VaQwdiLWOc8VywtQ= Received: from pps.filterd (m0333520.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 41GKDkHZ012166; Fri, 16 Feb 2024 21:13:38 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : content-transfer-encoding : content-type : mime-version; s=corp-2023-11-20; bh=7PLIpgoX0WzBhOeTtr7m+MCiuzEgYeEYqWfbsIroNjY=; b=aHDUZdnZJobBzPh1V7T7n+AFkBLm8+vcZLqn2LaeSGekY+I730fw6PzkpzcqlGuOqd3A ITq1+0nSRqgxttuaSwrhK1EXnRlQuE9OjOCdS4HTCt73qtD2qpTx2wWnKG7YK9JA4f8R av8Zxdhp7nrYNOyA6oVopm4HEEIil4vqZZcAM7zA5pIpHKvAynOllBPyg2eWHBx7pvj6 qKvsYMwnxIu/awBMVKzug+KJeHmrKEju68H92L61wMcLGs1xTi3Xl+PhfhMjUGWInSIH 1BqG38aRQPNxrZ5jSQdOcfWtMWIOrPr10LecCrhzsBkACMbdrE869mmV5YxwdYErO9At LA== Received: from iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta01.appoci.oracle.com [130.35.100.223]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3w9301p5vk-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 16 Feb 2024 21:13:38 +0000 Received: from pps.filterd (iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com [127.0.0.1]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 41GL4CMN024548; Fri, 16 Feb 2024 21:13:37 GMT Received: from nam11-dm6-obe.outbound.protection.outlook.com (mail-dm6nam11lp2168.outbound.protection.outlook.com [104.47.57.168]) by iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (PPS) with ESMTPS id 3w5ykk0v8y-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 16 Feb 2024 21:13:37 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=W10E5q2m3YYR595P0iegIR45JHabk1MMGhb+rX9MXLRIEm0CkwRAe38dwm2dkua9ZWhcM2tyBoKRblSwDDbArZiYfivo0l20moSI16FIOm/JZcTW+vgpKXRq89sx7PG420E0YjLGlcM0M1T1F2au9xFP9Jgwn81ftGoYe2WoMhmuM36chDSCtPLkIDaya84OiIzNEHywQRqXRHtBQjcflwbelRSEaTfB5d8zD5u2AFXSWBSnEjVe0RnTFkdp2IXNgknQHyHXWuO1F4tZ9TrpLYheYOSKQxGwIXFV06jYJmulB7HDqX5BLW/zCEw/x05hzuBB+sjAPjmHUV1CcZILTQ== 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=7PLIpgoX0WzBhOeTtr7m+MCiuzEgYeEYqWfbsIroNjY=; b=EQuurVbkCsfz/ZBMdvuH773gMWSWT2sIeMp6fmPIZXuGC1Q3hwBddNhgX8cO3WLjJNB8hHaJvHOLtIU3BzCfQ22LF2HhB7lNv1rUkIZD3hgbeKjMOQYvKsjWIVMI9znaf9G93LuxFrBrysslHD5qlxp4GcIklp/JD7K7jZynE4AVZxXJIQadvJBiBKmIOAWAKuoh7IBPBNpEJv4XnZg8SFy0Z4kFILU75Yz612qWN1vGeIJC9+fG40X2lwUYjC08qxxNoS5YrNKB4qrGaIpuKxOtUT+Oe3/Jvq87ow87RbZfJhupfe7wKJE69tMiY5FM1trIE+cyLQYKb6xQr1Oygw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=7PLIpgoX0WzBhOeTtr7m+MCiuzEgYeEYqWfbsIroNjY=; b=ZSt1CDOS5DVIRY9LLUz/G2eBEE/31HceQ8D68azkS3PXMmcBJ7vqM/INIuBX8givUAFGz56IezRII56X6XF56+UdhYHQsRgL9t2XK0GZ9U29X70A8DxDHjJfZ2yKyWRUm2SNKqh7vJcTkXwAHl5kWpLNHLWJhV+SpacxzH6h3m4= Received: from CH0PR10MB5113.namprd10.prod.outlook.com (2603:10b6:610:c9::8) by DS7PR10MB4909.namprd10.prod.outlook.com (2603:10b6:5:3b0::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7292.31; Fri, 16 Feb 2024 21:13:31 +0000 Received: from CH0PR10MB5113.namprd10.prod.outlook.com ([fe80::7eeb:3b3e:601:2e14]) by CH0PR10MB5113.namprd10.prod.outlook.com ([fe80::7eeb:3b3e:601:2e14%3]) with mapi id 15.20.7292.029; Fri, 16 Feb 2024 21:13:31 +0000 From: Sidhartha Kumar To: linux-kernel@vger.kernel.org, linux-mm@kvack.org Cc: akpm@linux-foundation.org, willy@infradead.org, apopple@nvidia.com, Sidhartha Kumar Subject: [PATCH v2 3/6] mm/migrate_device: further convert migrate_device_finalize() to folios Date: Fri, 16 Feb 2024 13:13:17 -0800 Message-ID: <20240216211320.222431-3-sidhartha.kumar@oracle.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20240216211320.222431-1-sidhartha.kumar@oracle.com> References: <20240216211320.222431-1-sidhartha.kumar@oracle.com> X-ClientProxiedBy: BLAPR03CA0002.namprd03.prod.outlook.com (2603:10b6:208:32b::7) To CH0PR10MB5113.namprd10.prod.outlook.com (2603:10b6:610:c9::8) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH0PR10MB5113:EE_|DS7PR10MB4909:EE_ X-MS-Office365-Filtering-Correlation-Id: dbcebfd6-7eaa-4fbd-b4e2-08dc2f342077 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: lfqLIFDNVPj+uzcbTmB2YAVc9oK9qNIGME0HSGInSSogPKauTFxpUDSAghbPzOXkR04FAtzDGCLI2zi0xU9PPIWYTHdfZL5FgqC2CJKNNyZtRuSBtY/O8RT5HIUknp6Vq55rkAvNh4MVebpGbcojYwoyXfcpMrjNOBD4hibNc43AzTKNJXlc2t+hPWhKZBv60R3mkdr1CKuWS6sTfKW6vOMXJhAKDEOED9Rs1eGK9a/DAq25ZrmHbz0u6F7VjVGeRe+4ndX0jweRmIL/U04uMJ+b+el7R/fZD9po1M0YzkN1RJTOQkvrp9pljrfAr3Ul+LnRVME9OZRuPjusccUnSnHDF2/pXEutF+vAOIiNOuf4PVilP13CzfUmw8TVxOOpA8zYerFgBBy/S1Gqym54QRqwIVJ+cWY90U/f5bRdMSZcein9x3rY9emhF4QChzigvuz4TWzP1ii8VedmtmJvKwVP2ihobWlcLlbpMclfg4V28Dxs4En2NV/XxKZq+dvfeZZcIaQp1q6hn77Bw+8Hc1VMvHQvioM11gC5ytjcb3qVkmFtuBvFlXLTrC5IHayc X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:CH0PR10MB5113.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(346002)(39860400002)(136003)(396003)(376002)(366004)(230922051799003)(64100799003)(451199024)(186009)(1800799012)(86362001)(36756003)(38100700002)(6486002)(41300700001)(6506007)(316002)(6666004)(478600001)(6512007)(83380400001)(2616005)(107886003)(1076003)(4326008)(5660300002)(8676002)(8936002)(2906002)(66476007)(66946007)(44832011)(66556008);DIR:OUT;SFP:1101; X-MS-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NBjm/6kvJLCs3PbtcxO2Egi+KxGGh5eQ8NO+FuVckwPOzXZdRfi6cqOMk3zJEFy3UKCjGLHOV4ApmcErjX6bAMjScFDTJIVCmumpgJqjIa2SDvOYX9zWmFTkHQiNqOgC3fPxY0a2ipafrkVjNwgDafCsW1fq/emSFpgVgMTZYUs3Hk79owFdQR5P7dHf3hruJqzyMKMvHmepktmh0Nq5D4= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: dbcebfd6-7eaa-4fbd-b4e2-08dc2f342077 X-MS-Exchange-CrossTenant-AuthSource: CH0PR10MB5113.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 16 Feb 2024 21:13:31.0724 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 2EF5CK+6GeeD06MXZ4JTW4g3vl6p1x8akwnJYrFxoGr+C7PA8N9+VTKLrZODlGWWhpaJNxvTyHDBlJEm1CQtJbgUgSulQihInhsD06k7N9Q= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DS7PR10MB4909 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.1011,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2024-02-16_20,2024-02-16_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 adultscore=0 bulkscore=0 mlxlogscore=999 malwarescore=0 mlxscore=0 spamscore=0 suspectscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2311290000 definitions=main-2402160167 X-Proofpoint-GUID: 0UPkmgna_Gs66oS7LDBjgOmhB_m-hQWb X-Proofpoint-ORIG-GUID: 0UPkmgna_Gs66oS7LDBjgOmhB_m-hQWb X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WEUGshSEpV/Qkfe68DyGNW6eJZiOm OOqEivTk c1Jp8p+kKdACUt9W9iRC4VOoR5pXvdeUuZhn24m6pdm0dUv62eTRWq3DqZiV1oR5Vf5+nQHP1jhJJpjb8XWrRDVBa+2Qk8CCy6kb+4Y4u1taH863OG1xQ/5+NXIGeqsSl5o5JDYj6Sk0ari87z28prLTkq0cHB2vZug8oMkDYoB8xScNiQBkvgF2w/y/Un8TcgPDLAOVlH/JkJOWl/uhqEPHGoTsLYXV+OP4Wf59CkebyjdFvUVDPWiAozI8fqYVsp3mespEX8tIewtyxP9sDFCIm7wu3gCFYlSYyYf+K5Sct2gY9ht8YfFXeitErhqztHdCO4th98H/mgze19ZzImW5n0b4aKh4FPvStuefAkOwnkQXSH68TfiforWqcGyHtz1emvcxGUAgIemhQ9OtKCtccjTpq55fxxmnDyS6AenyXOxeYEjIheaEoB2L/NQpKHNGJprmbFmK0/MwrJUXWjOIvfIF0dacDNnwy9FOZzF+7jMdUbvJeniKvaB8Z/BgHm8otsuAqUi5cOm8ZqjxXoygXbAW+4dMYB+lBC5eop/a2Xx0= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: Use folio api functions from the already defined src and dst folio variables. Signed-off-by: Sidhartha Kumar --- v1 -> v2: use migrate_pfn_to_folio() to directly work with a folio per Alistair Popple. mm/migrate_device.c | 41 +++++++++++++++++++---------------------- 1 file changed, 19 insertions(+), 22 deletions(-) diff --git a/mm/migrate_device.c b/mm/migrate_device.c index 3d3c2593b5b64..81623f2d72c2b 100644 --- a/mm/migrate_device.c +++ b/mm/migrate_device.c @@ -814,42 +814,39 @@ void migrate_device_finalize(unsigned long *src_pfns, unsigned long i; for (i = 0; i < npages; i++) { - struct folio *dst, *src; - struct page *newpage = migrate_pfn_to_page(dst_pfns[i]); - struct page *page = migrate_pfn_to_page(src_pfns[i]); + struct folio *dst = migrate_pfn_to_folio(dst_pfns[i]); + struct folio *src = migrate_pfn_to_folio(src_pfns[i]); - if (!page) { - if (newpage) { - unlock_page(newpage); - put_page(newpage); + if (!src) { + if (dst) { + folio_unlock(dst); + folio_put(dst); } continue; } - if (!(src_pfns[i] & MIGRATE_PFN_MIGRATE) || !newpage) { - if (newpage) { - unlock_page(newpage); - put_page(newpage); + if (!(src_pfns[i] & MIGRATE_PFN_MIGRATE) || !dst) { + if (dst) { + folio_unlock(dst); + folio_put(dst); } - newpage = page; + dst = src; } - src = page_folio(page); - dst = page_folio(newpage); remove_migration_ptes(src, dst, false); folio_unlock(src); - if (is_zone_device_page(page)) - put_page(page); + if (folio_is_zone_device(src)) + folio_put(src); else - putback_lru_page(page); + folio_putback_lru(src); - if (newpage != page) { - unlock_page(newpage); - if (is_zone_device_page(newpage)) - put_page(newpage); + if (dst != src) { + folio_unlock(dst); + if (folio_is_zone_device(dst)) + folio_put(dst); else - putback_lru_page(newpage); + folio_putback_lru(dst); } } }