From patchwork Fri Feb 16 21:13:16 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sidhartha Kumar X-Patchwork-Id: 13560697 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 609FAC48BF5 for ; Fri, 16 Feb 2024 21:13:41 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id D3ED86B009D; Fri, 16 Feb 2024 16:13:40 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id CED796B009E; Fri, 16 Feb 2024 16:13:40 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id AA3416B009F; Fri, 16 Feb 2024 16:13:40 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id 99E7E6B009D for ; Fri, 16 Feb 2024 16:13:40 -0500 (EST) Received: from smtpin12.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 492B4801D0 for ; Fri, 16 Feb 2024 21:13:40 +0000 (UTC) X-FDA: 81798918600.12.D84B99F Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by imf25.hostedemail.com (Postfix) with ESMTP id DBB52A0003 for ; Fri, 16 Feb 2024 21:13:36 +0000 (UTC) Authentication-Results: imf25.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-11-20 header.b=YEX+IVx0; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=zRE5wfUm; spf=pass (imf25.hostedemail.com: domain of sidhartha.kumar@oracle.com designates 205.220.165.32 as permitted sender) smtp.mailfrom=sidhartha.kumar@oracle.com; arc=pass ("microsoft.com:s=arcselector9901:i=1"); dmarc=pass (policy=none) header.from=oracle.com ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1708118017; a=rsa-sha256; cv=pass; b=ijraI2ylhWS9PQ8PSeMuVZOaELxe25sK3oIHkbp6kZtGSeldrqO7bgNajKn+xdjEd0KmQ6 /5mN1/p9tIHTNn9wRG+SATP1QlCJuwsbjsyodWi8wUvo5PJJ9HwXZzEUW9gYnIsGUgahGk 1ivxzCIQmwITTxSzfGBKmdrLNV7R2Jo= ARC-Authentication-Results: i=2; imf25.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-11-20 header.b=YEX+IVx0; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=zRE5wfUm; spf=pass (imf25.hostedemail.com: domain of sidhartha.kumar@oracle.com designates 205.220.165.32 as permitted sender) smtp.mailfrom=sidhartha.kumar@oracle.com; arc=pass ("microsoft.com:s=arcselector9901:i=1"); dmarc=pass (policy=none) header.from=oracle.com ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1708118017; 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=6cEEqxrWSmhx+Ys7t65MJe6QuqR9ifBsjb7IcYbYUQY=; b=svldjh1YMmJRSTbqsz92FTy+0THw+dUS8h56QEKqYt2yxS0vv+adJcxXRTR8irXc3+Pf7x N59/BsNj7edG3CmKeSsG+5t1HNfHiR0JSBstZr2HeLeHjY/gFskmPxLle6s7/XXdq4WVVi P4l8c3Z2R6DdZ3EhDO+KtTxk/hA86OE= Received: from pps.filterd (m0333521.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 41GKEgsQ014845; Fri, 16 Feb 2024 21:13:31 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=6cEEqxrWSmhx+Ys7t65MJe6QuqR9ifBsjb7IcYbYUQY=; b=YEX+IVx0JKa3JLrU/q26C4pR/4CipUNT1IYt3MdAUY0n7CEry55RwydS5zHjE3BNta45 Wi9/NLNnaaMNgLFTlbXWn42ktO/w9yS7sQUmtdkMjxig8BIwd50ZubFz2367BzC2us7S jxVp3bTeWT8C5tGG3ZnCaBsn2aUAcrNPLvb9Cd4xHT+K8M9RkQdvOYit8mfx3hmlYZCK gfZw1edJZzyOKYqgiqGubwRweZLiqpy9lu2TglbKHz1zxrsk3uJ9OAa4jjO9k/+JY0eT zLLi0Mk0LWkGffBwimGcRAIOSi+bIkZfuoIuYkvbfQWdbDpoIGafr6O6HBZB19KopCKP 7w== Received: from phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta02.appoci.oracle.com [147.154.114.232]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3w91w6xake-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 16 Feb 2024 21:13:30 +0000 Received: from pps.filterd (phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 41GJjfZw014975; Fri, 16 Feb 2024 21:13:30 GMT Received: from nam11-dm6-obe.outbound.protection.outlook.com (mail-dm6nam11lp2168.outbound.protection.outlook.com [104.47.57.168]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3w5ykce4hx-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 16 Feb 2024 21:13:30 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=gBjP1zo0tBBCizdL1tzZ8Kf74YIrxBHHNUsGzW3y0ZqTyNFKAF6CKAAKVPWWzwan0WAZdQrT3wz2joam1PfjTLc/WYoNwZ6lbAl1KqpbSJ09LJWoaU3oqEpiuT58w3a8JYreq4p7SSI4VKp9IylHPFybSrGEA5iRq6M5Dx79jOGhT+CSizCmukQYH23KqiCXMuh+JR0QX7A7WxNvVUtuKIxOuD4FXBPLJ2GYJz6xD16GTNu+JjdQyUlf6NJAsOSaHbFBz65B/S/uGqHNUpDCCpnquhdbjCW8p3BI8ISX0r3efUvPzN/ZagwXH0G7GJgWN71CAmc5raDT/5D7ExvizA== 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=6cEEqxrWSmhx+Ys7t65MJe6QuqR9ifBsjb7IcYbYUQY=; b=U8muZ8gCzs9FjFm4gkOKweuw8Ig+In7Ts7YNrBIAzGwdRIy9fNr65K2Nj6tuSYYxXI1vovys3CR8vh6rBlATiPEHXpa0dS2S6emiLA3BV3yVGvIUtVu63vw0yIyE6j3a5vu13DCP8b6t6XxsdgShDzHGHNwvE6z7nL/bMgiczFvXIeg5rbrYvk+iVwlbEx0wg4IdxVGZ6NfqD8FMfGkGirImcqsUt0pUGf22jHwZVrPWPNtHLMFeLizVUesDeF0L1L634FQrtkq/SQ24wWa4FOrhkPbwuVOZFEPIAiQ0+jEfvHwDmNg2IwcAT5xQpolc7NVswXgeCO71JqzhdCKsow== 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=6cEEqxrWSmhx+Ys7t65MJe6QuqR9ifBsjb7IcYbYUQY=; b=zRE5wfUmzgvXJ7Ud9Qnztxgz6+4TPRJ5Uluku5g7A3IXUWsuIpH6yKDOW3dBLGuDUrcp69Yce88NMLBAgGrSTDJNAbNxq9YFDxySzlN53HwkoDaD+NRcJxibq2jdAiIFQrhHv4a7yHlOwmTUAPumgL0+wQv7t+bhtzIjwXOH9vw= 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:28 +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:28 +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 2/6] mm/migrate_device: further convert migrate_device_unmap() to folios Date: Fri, 16 Feb 2024 13:13:16 -0800 Message-ID: <20240216211320.222431-2-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: BLAPR03CA0142.namprd03.prod.outlook.com (2603:10b6:208:32e::27) 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: 22e8a00f-bf88-41e7-8484-08dc2f341ee0 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: YW0I6y+sJio5y+Uf+9yZDUd/GMmIvrn6gwSErceaCgvKN0HPLINp8I5vBsr75+VF1Kb1xXTpjerdd4vl40qDvXGoB3YFgQ/zi3RmhVTLxK8sX6nI2+HTM2K6Q6ceG5hhtQbaW1ppdy//k734Xy6iHY1ZJYvoJWR3P8pB8fmm6S9ioZ4U3UxRgv5tU4EXFUskuKaB1XNl0jLye0WIjhzzDckoZHtuqYl5ShMtkDmOZwzplHuSuVx7GqwnQjNIMTYuHCr0gIBuGGV0AuysNwOaQ4mvILaPZkgt1x7PWyqj7gOLoo9Q8Oho1rQ8cepDug7FnXNmgp/PupMYCjmfH5Y9Wo06+kXyX7BeEittvE3IBorkNUS0P/p0GF5MXnZDgKhwXjlqXao9XyPQrDY4vLmtOPc8LAMSOkm4EynDq1wuQ9+TotUHReh2yskxDo289XP+pq8l024iw7IEEVV+fANQjk+HJRGd1I6e5YbWdg6oXHAaSYFZODnsIvHRet3hO4xVqcT8MWyB9otp7kHT9nbN9J7CrAFR6eRx36PQIzYjKl0tFqksR02IHh8b51ckU9K+ 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);D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dvCJ//nDYSwzWJct72oOt1ybsWT5BINxzAi3P4mdW/VVO8PCl8cWFmpVkfIGesEG/0kmDByP8nmOj/W/CmVYDLHcCVALKdQrhTG+ZZedw2/Zx4AlHIoDxcrRz25L3K7lPPr+/7n8oUvTveJeMfV54JyG0Mj851xhJCf0G+eq4K8FEuUy7E29486h7yTbBh0oOuD3zbFxM4RKxQscfHhwniQkmbgsArS25TuHsZhej0BfqPB1eu4rtKD9U= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 22e8a00f-bf88-41e7-8484-08dc2f341ee0 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:28.3658 (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: W4JTuKgdo+O5tC4KKQtCNUZB3THPEtrnxr6jjqR4UmI46Xk3j290PD/BycXlOCFwN+063NA9NF596qnyXzprHEyo7G0ELg2K2+erEUP+m2M= 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 spamscore=0 mlxlogscore=999 bulkscore=0 phishscore=0 mlxscore=0 suspectscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2311290000 definitions=main-2402160167 X-Proofpoint-ORIG-GUID: sdGNAVO7ACbEAUPePqT7F2PxhQhAOW7t X-Proofpoint-GUID: sdGNAVO7ACbEAUPePqT7F2PxhQhAOW7t X-Rspamd-Server: rspam08 X-Rspamd-Queue-Id: DBB52A0003 X-Stat-Signature: i9ymd86pz9n6ksqnmyn6frc6w5qhf8ih X-Rspam-User: X-HE-Tag: 1708118016-594354 X-HE-Meta: U2FsdGVkX1/ZtNdoYth0wc1KKe85WiY5QWcblS6IVHYMk2olD6N/nH5n6EJ5zvHwcNfhzG5MTonXhIBArhtv+vM+RTP4VPE4elIMaDQlO6xrJY2Xc5VqW8tIKC6wFHSBD+OZnYIohuM9A8vBiIx6Kam3MF37zdr321x4CQwhH7ZlVbM6f/rhlTulL5UgDrWV7DbhKXru6yXXi9Ov9fgixoPL95wyUb9pMW7p78i44wPMDKLtRV8SM+3Zvb4PVRmNSDS8FKzTPCtg20rzP654ZwAXeaeytQQSTmico+z+ZtWxraROspgcxyD7Ao0BXJi35suvYhI6NB2avN0cJpobfSNc9GrcaQSf+q3jQD5SWZWe85FQLM3BYq/oh9OIMYFNrK7XCTB9xYKxPGTfuhi+4eAYLcWdZg+b129lX70CoiINo75asxYkDL9bFPTuPAiGhGnhf+R8jefyqT3hDiNWRPcVYM7S8c+bNFGb0soJ0Z7T1PDpuMqXXmJ+1plofiwfSnh6QObMG4JWwwRa2oj48kgMQTTs6GwdEONM1zZpK4EpwJChrV17mhKF5shTxvX53++zApf0L0GKXwwhPW09KabAB4+84AG7KJWexmzLcOnHYxiePvNPNVkNNhRd/R19rIE2DuN+ae7i6cYcsgKt/9EHhwl+lgB0KWUj2KXm12xz7unXaxL5A2aFa8hQWUoDljw5lmJONF+X3wFloVRA/eat4WPzVtEE9ey+s5jB1TZTSrixtchLiaMT06hwaSXvho6a10gZ7LDV20lg6jsqOgXFYfxpgcdX3+K6xLB3MjKFp+wQ+sVqUI0lnDjJ6WcTkh7JGkpjQCjxQVZKOUbJsK7qo+VkSBL46YZhCYd60l88YE0VW8S0Lgq9Vaah6es16oYGJ2bQTs4TC0VHld2U6yLu8X4X71CbY3owyF76ctWAQlkvY9jq00gDjWpyzgcenuSsM161sWAvtS8tzYi AeJGSGXH aL7aCuzgo2jDo4ASrj/C2EEYTZpAaTwSVuJefnMZb16GP0Nxru/ECUDZt8eV+cTPT/lOTWlSaTrvahi3CdCkizCAroQhOLuTQAhO7A6FPq2J0wAjnMQQ1W7lTBys4nA+ujhMbTRgKsLuSoH3crD9Fy4FjZI7/DRHqU/XbLG7dw1NG25ar/551o6BqLffFXQhr+hLGoMf6iiEqtI5THtZvXim4ADAKQO5h1G9xESArvb6vGMi/gRFDgeSgjBz/ic8cviwK+DwDEegk5N0Qb90QzGKtPS5tFudbgTVv6q6xX2mRz15ktxcegi5foU0PLyBoHelQmupAXjExoJqOCMU3RIGNrsQN1mrfe0i5vD9u2WEW7ikMnqiUDb1pNCGi4hQfjpP0vqFRLTp/MjWQKu7WWteDHJVNuuhCcKA7pS/10n/PLz2NxEZu18wuLmuPi7r4wVMNR8ba5mYlqoYS7s+OlAZ9aq5ZsP5DsXjgTF/5QV6l4Turq2JNf2vTi+09ZFjcy0u0ecUj8PuN00DM1GCHQgvPFAZtvePsvwPxh0GscDeXJNY= 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: migrate_device_unmap() already has a folio, we can use the folio versions of is_zone_device_page() and putback_lru_page. 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 | 30 +++++++++++++----------------- 1 file changed, 13 insertions(+), 17 deletions(-) diff --git a/mm/migrate_device.c b/mm/migrate_device.c index b6c27c76e1a0b..3d3c2593b5b64 100644 --- a/mm/migrate_device.c +++ b/mm/migrate_device.c @@ -368,42 +368,40 @@ static unsigned long migrate_device_unmap(unsigned long *src_pfns, lru_add_drain(); for (i = 0; i < npages; i++) { - struct page *page = migrate_pfn_to_page(src_pfns[i]); - struct folio *folio; + struct folio *folio = migrate_pfn_to_folio(src_pfns[i]); - if (!page) { + if (!folio) { if (src_pfns[i] & MIGRATE_PFN_MIGRATE) unmapped++; continue; } /* ZONE_DEVICE pages are not on LRU */ - if (!is_zone_device_page(page)) { - if (!PageLRU(page) && allow_drain) { + if (!folio_is_zone_device(folio)) { + if (!folio_test_lru(folio) && allow_drain) { /* Drain CPU's lru cache */ lru_add_drain_all(); allow_drain = false; } - if (!isolate_lru_page(page)) { + if (!folio_isolate_lru(folio)) { src_pfns[i] &= ~MIGRATE_PFN_MIGRATE; restore++; continue; } /* Drop the reference we took in collect */ - put_page(page); + folio_put(folio); } - folio = page_folio(page); if (folio_mapped(folio)) try_to_migrate(folio, 0); - if (page_mapped(page) || - !migrate_vma_check_page(page, fault_page)) { - if (!is_zone_device_page(page)) { - get_page(page); - putback_lru_page(page); + if (folio_mapped(folio) || + !migrate_vma_check_page(&folio->page, fault_page)) { + if (!folio_is_zone_device(folio)) { + folio_get(folio); + folio_putback_lru(folio); } src_pfns[i] &= ~MIGRATE_PFN_MIGRATE; @@ -415,13 +413,11 @@ static unsigned long migrate_device_unmap(unsigned long *src_pfns, } for (i = 0; i < npages && restore; i++) { - struct page *page = migrate_pfn_to_page(src_pfns[i]); - struct folio *folio; + struct folio *folio = migrate_pfn_to_folio(src_pfns[i]); - if (!page || (src_pfns[i] & MIGRATE_PFN_MIGRATE)) + if (!folio || (src_pfns[i] & MIGRATE_PFN_MIGRATE)) continue; - folio = page_folio(page); remove_migration_ptes(folio, folio, false); src_pfns[i] = 0;