From patchwork Fri Feb 16 21:13:18 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sidhartha Kumar X-Patchwork-Id: 13560701 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 DCC6FC48260 for ; Fri, 16 Feb 2024 21:13:56 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 353646B00AC; Fri, 16 Feb 2024 16:13:56 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 301626B00AD; Fri, 16 Feb 2024 16:13:56 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 12E026B00AE; Fri, 16 Feb 2024 16:13:56 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id F37416B00AC for ; Fri, 16 Feb 2024 16:13:55 -0500 (EST) Received: from smtpin20.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id AE2D580249 for ; Fri, 16 Feb 2024 21:13:55 +0000 (UTC) X-FDA: 81798919230.20.4BCFB60 Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) by imf16.hostedemail.com (Postfix) with ESMTP id 6AD08180015 for ; Fri, 16 Feb 2024 21:13:52 +0000 (UTC) Authentication-Results: imf16.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-11-20 header.b=SvJaCzwu; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=CbBw1b2n; dmarc=pass (policy=none) header.from=oracle.com; spf=pass (imf16.hostedemail.com: domain of sidhartha.kumar@oracle.com designates 205.220.177.32 as permitted sender) smtp.mailfrom=sidhartha.kumar@oracle.com; arc=pass ("microsoft.com:s=arcselector9901:i=1") ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1708118032; 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=Zyj5W/hf5fQSEZwMGqMHlWaHWhn7dkZCnmqh3nzq8a0=; b=IxtoXRxt6Ir1/7Zq/kWFiPosdJF8enoEeQVlEBpArrz36Vqs0Xjizd8WBzVPiGe3TlLz4Y Xj1cnhLb+2WKNYJwfVMNPXROTi2fQVbLpsCcXFX5sqxb3r2NphyJYtbtdN+Ifdc7ZVI38i r77TNAv515J2UJ3kF6MJF/cySpgT1YE= ARC-Authentication-Results: i=2; imf16.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2023-11-20 header.b=SvJaCzwu; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=CbBw1b2n; dmarc=pass (policy=none) header.from=oracle.com; spf=pass (imf16.hostedemail.com: domain of sidhartha.kumar@oracle.com designates 205.220.177.32 as permitted sender) smtp.mailfrom=sidhartha.kumar@oracle.com; arc=pass ("microsoft.com:s=arcselector9901:i=1") ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1708118032; a=rsa-sha256; cv=pass; b=PrGVHDo9mEr2Zfl0dzoukbVYFtw3PYEskGEsY3JWsQGV64vVZD8iCiXKO9M4KrdrXLEKeB 0qDm+1cmKtGzFSfUYlihEcAU3W2GveCMZcZq6z0USoHIYxopxqetf2//tTSbqHjct/vM9Z taw6V+dUCof6mlBaEw3mfr5qy2COid8= Received: from pps.filterd (m0246631.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 41GKDor6012510; Fri, 16 Feb 2024 21:13:49 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=Zyj5W/hf5fQSEZwMGqMHlWaHWhn7dkZCnmqh3nzq8a0=; b=SvJaCzwuFlkngzUkH6QOCm6LPDEMMxPgwses7Sz9fnOUPtCxxDb9CBoYiuYGJvp+cTrK j4WITKH9YivFJrAHkzXdF6L2rP1gK7vUp66NngMvdqwUc+NWeAfZoO877p2oCRAqukqb 7AxDqsZ8HNmjvjjwO0Vnlv28otLHVaqL3iWlxxQWJ80WSubcSpaf9ZocaWTPw8Fbe3QH foqiEJOCzb852x/eD7v8lz0ipQ9tLXN7H3QZKVBOnBE/ht18Z1GjUMW0O39QVvPvPkmC ryocQsVxDfB89hBugi/pNaxFzlXMYS04QXytQHXoBuqfYV1N3kJzb9IjG+VZG6V5clQ1 Xg== Received: from iadpaimrmta01.imrmtpd1.prodappiadaev1.oraclevcn.com (iadpaimrmta01.appoci.oracle.com [130.35.100.223]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3w9301659j-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 16 Feb 2024 21:13:49 +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 41GL4CMO024548; Fri, 16 Feb 2024 21:13:38 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-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 16 Feb 2024 21:13:38 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=IM8Z4Rg7sSGh5h+SXJcRjXElgZGT7mC35vy3bHb76TwEBdgxz7BG6VY/yPADdfJq+xPSuInbEFdaiK6jglKT6A59HwVn+bgmF413d36Fy9HWnKmdN9fTVZdvcLuHXHXAmGCEo6l1SbPfbJANL/pyaK5uVONJKI6vDGcH9NrrzLBpQHhg9pcdGC2vRHIL1x3sAye+XbQO2jpHlWKOy+C4pRU3AFtGe2VUX/bfVvtnf4ftCoMOUYsDdCtNHS8moBEZRZsbdrxEuGnuK9avnCVXVtS3rupEsY3wqOipsrty8qoirPBYOquVPeK16M7g4Wcp6kQk21D3triAy1yzCXjkNg== 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=Zyj5W/hf5fQSEZwMGqMHlWaHWhn7dkZCnmqh3nzq8a0=; b=WFRlmtUJZ1Jb4y7TaOrhHEK8VPC0mrEZ2b6DHaireyHCYHJjuTEZGaR3fUWKLAjkMrW8Csg5vnHpDyhXdgfeeLJ3J7iN0sCTY0kFyBumQgfqTRrG8ksF/PUCXBqsrn0ZQaRo4Nrd8nVYiqQSlzls17LWwAEoiJc7cG2yhKqIJDCVVG6TU/NvYs64bKDPbx95rnjxynDZZ6NLblql8idLpvEayBkzsTrudwt2JwJhNVjkpnh1H9lAXg32Hc9RNmCDW0Jub+WK8wmyR7Mo+GrGWj9l/CWbXL8J9eurQRKSkftRSE/Gf1zONrfOLsC8pQh2NKzncoxHFQ/hDHbICTJJuA== 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=Zyj5W/hf5fQSEZwMGqMHlWaHWhn7dkZCnmqh3nzq8a0=; b=CbBw1b2n4wxdDJ7LAHgpFUR0ZiVi14p/nwqAd6SCobReksXGw8OiYeFIVmM7FGM1ty7B+6AiutqI2KntqMiIsFKU6ozuWxduOLLtBEx2PbAFc1r9Gw5zTif3w7StngmXBKgqLnDQACrmU+8zZoeaBwR/sTxGfNIrECLXjofi9L8= 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:33 +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:33 +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 4/6] mm/migrate_device: convert __migrate_device_pages() to folios Date: Fri, 16 Feb 2024 13:13:18 -0800 Message-ID: <20240216211320.222431-4-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: BL0PR01CA0028.prod.exchangelabs.com (2603:10b6:208:71::41) 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: 5e271ba0-0976-4c89-cbb6-08dc2f342218 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: FUyb7f1munmSpR/UF2LJPu05v+cEdkvEzvd25TvAFFacogGUKkP7vRcx1BY2CR83p1fn6+awsmgrEubIH3Z1YXVDt0KwmW07GhbXdJkriLCrdpBBZ2k5QMHpO195tsgsBvCW3Fwosn6WaJll1sFol29EkCMRrM+Yr4++/2WswoBjMi6Cfa9vA2XjZOIT0+8EsrehzcqsvnCDSjPPHaGM+j/4bJmiCROuLGz24MZ2QpSRP1h5tO6vm877Cbo5YJV+xeUI4Mm3yEhiu1D+uZF7uGCZQ/eZ3pwZvYbBbZ3t3KAl50Cs23K6L7QcXuBsaHOWKTx15yl91PKTt0aJSdvdnoeNJRmIug0Ha+B3c182D1mZx9IU31KYQ1kTtstY+cfE7hHTwlvJo8DDzMqgVcgBeBl1nbfBemD4/FWcZXXKzyYDQzdGWw3yd14Qjwvyy8ffxJWaDrtQGPYi+5ndHcyv1F2XSfOaRh3jwQYAVFRs/xLSdXdND/CyI3SarDgP5BwIRKU+57URkT1UUvzYhmeNG769/iMrrUiL0donm66oUlZofpAk2bIVxIDiJ0vYXv+o 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;SF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1B5WG0QB7tTwBYje9nK6VR2PFCv0W8Vgl90xjsUMr3vDLVDWBTiEtuJA4jWCVkuJxGvQk4Jqa/UQev5q0Py6rKEyNL1fxdDLVT1WnwzW9u7Crlkd0jc4PVqghS00ovRrbNKk3Wu8hHyJwXAGNsDjoBY5H05hBQNd0W9A/wxG25BLR7kw0sf9O5mZShUhu+7rgbnQtpXeqddiWSNuKSedFfxUrHc8yYYOM9IZYj006VSww6GFRWhwqSUA= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 5e271ba0-0976-4c89-cbb6-08dc2f342218 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:33.7990 (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: qj993p6B44s+1iA9mSiSeuKOsq3KxFGt+9cE4yKuCbwMKPsitfUJR8/Ws8NGDCxUqqqjowpJJH7erzomenDftCZ/Vwt2gPdjrGGU9jaF0JU= 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: 02ZLLdcM3jvpYzz0UW4H6UAdR0vVPaK2 X-Proofpoint-ORIG-GUID: 02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SQl+Rtuqr9B9isD05DCn9Yz/BGIniRs95rW5MXRKVPj0vZhlZ6o2hSW1GoAa 5XLzbg+B LC3QjpKBHX45NXRMFiCLlowMQ1fMftjneS4IwivjduPi6MXCwDQMbiM5LNLvNhix3YkzXbOWkuy+JWfQF4JGS+9CCJ+CtYWOiiSs2jmbSqk3+Y1Y4sg/oD3QG4g+kKPLNLH2ZmhDa257Kt0L0PDTyaafkklrzmOxBBBmwUAFPZkMC3nVh2QVdNF7zC2bPHmC7+FCpjgR89wlbmWH9kq0ooTxsVhSDPHKzAuhx3Q5JNx9m8AEyXGVZjmLx6GasE0nyi11iXip/+lSheYNJ/eHzfbkr70HJIGusVKm7+oujNpcoabgqeRa+qib+QT1XwRpoQuNYrmyz9JEjKuBBEHyobOK+TWk6q4oRvoCbYkv7IMmTMWl2wAyZ6cCxKeJUixe/u0O5fa5gEgKewwu4uLUa6A8JDqDq5OR8aKvXi+JCfJcley/kMkQ9x4Gz3poK3zJblGqJy9c3LrojIFSrusrVK6eEviMwThEJQkJlGBdXDkDyvxySC+Tx1NvFe+Nni6vTwFQSQif2XtZs2IOovfDxwvB9uaxfSYto3cl4bDYYCeD9ssA= 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 migrate_pfn_to_folio() so we can work with folios directly in __migrate_device_pages(). Signed-off-by: Sidhartha Kumar --- mm/migrate_device.c | 36 +++++++++++++++--------------------- 1 file changed, 15 insertions(+), 21 deletions(-) diff --git a/mm/migrate_device.c b/mm/migrate_device.c index 81623f2d72c2b..d9633c7b1d21b 100644 --- a/mm/migrate_device.c +++ b/mm/migrate_device.c @@ -687,17 +687,17 @@ static void __migrate_device_pages(unsigned long *src_pfns, bool notified = false; for (i = 0; i < npages; i++) { - 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]); struct address_space *mapping; int r; - if (!newpage) { + if (!dst) { src_pfns[i] &= ~MIGRATE_PFN_MIGRATE; continue; } - if (!page) { + if (!src) { unsigned long addr; if (!(src_pfns[i] & MIGRATE_PFN_MIGRATE)) @@ -719,33 +719,29 @@ static void __migrate_device_pages(unsigned long *src_pfns, migrate->pgmap_owner); mmu_notifier_invalidate_range_start(&range); } - migrate_vma_insert_page(migrate, addr, newpage, + migrate_vma_insert_page(migrate, addr, &dst->page, &src_pfns[i]); continue; } - mapping = page_mapping(page); + mapping = folio_mapping(src); - if (is_device_private_page(newpage) || - is_device_coherent_page(newpage)) { + if (folio_is_device_private(dst) || + folio_is_device_coherent(dst)) { if (mapping) { - struct folio *folio; - - folio = page_folio(page); - /* * For now only support anonymous memory migrating to * device private or coherent memory. * * Try to get rid of swap cache if possible. */ - if (!folio_test_anon(folio) || - !folio_free_swap(folio)) { + if (!folio_test_anon(src) || + !folio_free_swap(src)) { src_pfns[i] &= ~MIGRATE_PFN_MIGRATE; continue; } } - } else if (is_zone_device_page(newpage)) { + } else if (folio_is_zone_device(dst)) { /* * Other types of ZONE_DEVICE page are not supported. */ @@ -753,13 +749,11 @@ static void __migrate_device_pages(unsigned long *src_pfns, continue; } - if (migrate && migrate->fault_page == page) - r = migrate_folio_extra(mapping, page_folio(newpage), - page_folio(page), - MIGRATE_SYNC_NO_COPY, 1); + if (migrate && migrate->fault_page == &src->page) + r = migrate_folio_extra(mapping, dst, src, + MIGRATE_SYNC_NO_COPY, 1); else - r = migrate_folio(mapping, page_folio(newpage), - page_folio(page), MIGRATE_SYNC_NO_COPY); + r = migrate_folio(mapping, dst, src, MIGRATE_SYNC_NO_COPY); if (r != MIGRATEPAGE_SUCCESS) src_pfns[i] &= ~MIGRATE_PFN_MIGRATE; }