From patchwork Wed Feb 14 20:20:54 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sidhartha Kumar X-Patchwork-Id: 201112 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:bc8a:b0:106:860b:bbdd with SMTP id dn10csp1477816dyb; Wed, 14 Feb 2024 12:23:11 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUu+UMwpvZ7Pbpn02D45IB1mjtL7a4OCHzXOy5yEevY9DsLVNLo+9nArfztPpigoO509BaekffNI/Ctu8rC/vvpn7RSjw== X-Google-Smtp-Source: AGHT+IHzK55+MztrNYwgzZAsVnRhD6M1uTmkMovUaSEz++oS2SsalkzJhLie9xmHutFyWkP3Ns0e X-Received: by 2002:a05:6a21:3a84:b0:1a0:6496:84c1 with SMTP id zv4-20020a056a213a8400b001a0649684c1mr4922645pzb.37.1707942191031; Wed, 14 Feb 2024 12:23:11 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVgVj8vCKxJJKwVRDFowDVcFSkBQD+kSOULABTHZpNuJAqBeadO9QzVwzvqVLPK7W8+9845e2ldjTTzTkldxAId04mVsw== Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id 199-20020a6301d0000000b005d8b7c3a00csi4320394pgb.145.2024.02.14.12.23.10 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 14 Feb 2024 12:23:11 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-65928-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2023-11-20 header.b="I07/FptB"; dkim=pass header.i=@oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=TBw0i4AI; arc=fail (signature failed); spf=pass (google.com: domain of linux-kernel+bounces-65928-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-65928-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id C08D928F27B for ; Wed, 14 Feb 2024 20:21:40 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 26E6213EFFA; Wed, 14 Feb 2024 20:21:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b="I07/FptB"; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b="TBw0i4AI" Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 20C5A13DBAF for ; Wed, 14 Feb 2024 20:21:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=205.220.177.32 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707942081; cv=fail; b=aiQPJJNoRFE8i+Zovytm0cHzXKdZGf1fGeoKOvYxTovWebA5PSrM4JtIPnbzDp/UA8WkuowawMi7YFAXrj9YaVpVwhb4eOwLipVPt4bHFG3JpPaVqyZjuaqMLEAMskLBvm2aI++pZ25uIZrUZnpdu6to/ohA3EiH8t8szpoJSEc= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707942081; c=relaxed/simple; bh=5RrlV3fg89USfu3I+rInJuIWH+oNe16fU8lMiYrZZb4=; h=From:To:Cc:Subject:Date:Message-ID:Content-Type:MIME-Version; b=U121PVI57Q91p6vj6ehKyaAFS4MpsXjTMopnn4Cl4AS2u5zodFTlKJRfXarDmPt4LSZs9CwIxPlz67/ylEHdXXzvpArA9pQ/ZDF/K7rxoXMEa57Wm/qO6dfkBaJyeLfDya6wLa+/POqSNArZcViNJGoJkSy+sRIaOW8LWT5QvHw= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=oracle.com; spf=pass smtp.mailfrom=oracle.com; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b=I07/FptB; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b=TBw0i4AI; arc=fail smtp.client-ip=205.220.177.32 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=oracle.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oracle.com 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 41EIdevE026498; Wed, 14 Feb 2024 20:21:06 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : content-transfer-encoding : content-type : mime-version; s=corp-2023-11-20; bh=iiZ7gxu9lMa4IRCeTP5FkjlK9j0oa0IquhNO+uwdz1c=; b=I07/FptBmoxL9pINPvNrEtNn9NYhcsZ1kY3cRhBTszkh2d01Xtvs6skK1l767+we2t4j x5njUnJQu/VZwsZ1juyFbYEaPhsuFBLeR0RHsRmJtw7H55vaf5E4XBgUxG2MLlavYoBO SDZtDzruhdcoezife3g36vBV8MYimFj9OiM2M0jdBQP/mnnsZusBYi/ncZUgNEwqU1bn mzM9x5dLr5P9M8fXVgHiy2DYTstS74K7ALeIF/1/2WbK9ynuEhwIuomRBcORlLEO6L/Q sDBcdUjovARre9GtDXKSWoTTmAhVcmVzAx9nAFoaOK+mojVBWxjJQnMSx7g9rx1pwqif aQ== Received: from phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta03.appoci.oracle.com [138.1.37.129]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3w9301g732-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 14 Feb 2024 20:21:05 +0000 Received: from pps.filterd (phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (8.17.1.19/8.17.1.19) with ESMTP id 41EJJ9b5013773; Wed, 14 Feb 2024 20:21:04 GMT Received: from nam12-mw2-obe.outbound.protection.outlook.com (mail-mw2nam12lp2041.outbound.protection.outlook.com [104.47.66.41]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3w6apc9n8x-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 14 Feb 2024 20:21:04 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=iODJhtJDUwHfTxj31/A9AXhD3UZPUk1ph5LlnUhxR6z5r+2XxF+Oq7jVuOe51jAA426ul++h2Hve/l+ujEsRN/wZUO8t3qTrBuyPLXgCisLj3bP+Okqb/442cinXHeWFGO6k3Huu2hrVCtPYaDM78dIE0Jz8Y+8MwDillKuYfyahnZp82vFg3HqZPwjUK1OAGVYF5mmQgWgybpIpbyGhgZ7X6rt4TFyGhFAX9G2PcZZhHuGTK4V3FfVLU1IKVanuKe4NGHHXEC1YkVGH5wLhLBiTaucqLPIPcM+0wBd2bB8Ms0suDsteOd/e+iN/5dDOmXImiZXtCXaBssYIgKUqyA== 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=iiZ7gxu9lMa4IRCeTP5FkjlK9j0oa0IquhNO+uwdz1c=; b=CPI3uXdTkWag+8bJxaO+Jh1tGXWo0bD0UNAbgKCQh6Qs4EZbAW008jMwviHal63H4Qvh15RnhdpkRmZQIMN5FAftJ7gLHL2nQ5tN6kQvtlsJeb3/VKPXix7OuqrMPAIrFvqs7bSot2NDiBedYAgl4xDLy/4oSvPi10YILREYSpRwtWBEkSfjodJs7AiOhE2BMgZaXzy0G1dWKTnidfWGJ+x1SjNxlQjKhTCLLyJVl2PmPq7S582Mh0DDNj7hSpRhNQH84tTcPMn2o4Y2m+NEOMBoEtT6EgtrhGbjXoLeHqT3njPGZHApu3/00uGgyzkFDh6inVfJK65c0/uRhpXq+w== 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=iiZ7gxu9lMa4IRCeTP5FkjlK9j0oa0IquhNO+uwdz1c=; b=TBw0i4AIZacWSlBZS4fg2VZ1cuXxjg57yJm2Pjlq2FC4ZAfARDg/oX5oAKDU/3cbJUIXjcKSbdyuZUw8CEG7JboKwJKrjMYSEY+l4wbcoJVumqHyhOlM2JW/Ck6QZE0oa3vceVnsygZhMGd1amVHnNR3nu7oP7CGey6KoaSzyCg= Received: from CH0PR10MB5113.namprd10.prod.outlook.com (2603:10b6:610:c9::8) by LV3PR10MB7963.namprd10.prod.outlook.com (2603:10b6:408:20e::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7270.37; Wed, 14 Feb 2024 20:21:02 +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.026; Wed, 14 Feb 2024 20:21:02 +0000 From: Sidhartha Kumar To: linux-kernel@vger.kernel.org, linux-mm@kvack.org Cc: akpm@linux-foundation.org, willy@infradead.org, Sidhartha Kumar Subject: [PATCH 1/2] mm/migrate_device: further convert migrate_device_unmap() to folios Date: Wed, 14 Feb 2024 12:20:54 -0800 Message-ID: <20240214202055.77776-1-sidhartha.kumar@oracle.com> X-Mailer: git-send-email 2.42.0 X-ClientProxiedBy: PH8PR15CA0023.namprd15.prod.outlook.com (2603:10b6:510:2d2::22) To CH0PR10MB5113.namprd10.prod.outlook.com (2603:10b6:610:c9::8) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH0PR10MB5113:EE_|LV3PR10MB7963:EE_ X-MS-Office365-Filtering-Correlation-Id: accf2949-7f8c-44b8-842d-08dc2d9a7667 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: bJG7Ug+HAD5LMCpF8fCQt7nRtg6w/aO2vNkxm/B3b0X95Hs6pWFnQH5PM5jssnXjbLo0DffvgpbtnaW0gOXch3j/DaLEDcEhB3hYNLd1O6FrtlayYcjkG3dVhCPw5JeabxEGzypbHHHUmdhalVzw33Q2kM1FxQLJfKbsk6adNND1QO/kLknIXVed0qtsnF1w4ZQJT34w4Wq2UVQsR3zd1HVbbrQjNZ9FcG8u32uNQixd6pmfXNvEbDxNWanZR3YcYAf5sBs3AJoiq2SfyctKXhHHsWGRtjqDKK1V4y7QpEjxftPbyd6IhAIzYxuVda3IHzq7NFMSnVhDNslb+JqNGvdwZlR+zWzhJbceO3vUYYbwi4M4i0StYfLcv9mMNHTJvjREDHFsqB1xrSWt4/j/DZ8cclt+jC/N4UN+dzIORdMb544mocoOWPkN6VPHhe8XNmE04g4PPxKTZlj4uF7K2WlJdLdATVR9lmldO713YUUYLMjHNsZf/3At2FxdNLkRisKrKwn6hEhfO6Di1pInnD1y9mezPBQbUDSJO6UmMAVQIxN0j50qBM/Z9QyJAuOR 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)(376002)(39860400002)(136003)(346002)(396003)(366004)(230922051799003)(64100799003)(186009)(1800799012)(451199024)(2906002)(4326008)(8936002)(8676002)(44832011)(5660300002)(66476007)(1076003)(2616005)(38100700002)(36756003)(86362001)(107886003)(66946007)(6666004)(316002)(66556008)(6506007)(83380400001)(6486002)(6512007)(478600001)(41300700001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: kI5mfImXzBXCJncEw8IAlPDehk0KDaD+BCcBC5T3USUIe3+PE39eXvlGxV4w7Bzf1Qs6xneCBdTCPxzUA0OfzvxYInRQz2b6AmUzlHtW+PAuBddvGTf/N1Za3RkBesBP7au8XOdvJ+OlNkvT9LhPImUzmNPcxZd9N+MOqhT+NefEBkdV0jLLCZpQLC8jWltyAfSpgBUUtHNOXGu7zvhEFBqI6cFjcAE9wn6XjH0cmcZrXHp5G3Y+uTyWjSh8ArAZzSep2EQCDHTj/JXjwY8sStbu7VaCXc4vrKjWMowTRtU+d1KnWrQ7CwXWLxWMYdoXuZB0jLVh6AY/Z9lTBmh/S9HeLE/pfbmwGGvqnStcIfTEnuFru0bSxZpJVQbgJqf0vy2sbq7Om2dXTBNpW+6zi8lEONItQf53iyZvnuk7oDRiu6RxDkkKCFfbQXOvHimgrXewayF/0pzH6D0pAkULDB1+8RUFuMp2QkkLC1PgxE+axilv8NjJ4SY46vzEJBUDCe9fiatDzc033y5FH34pYplnuHAUL6WjZfMzuvv8J35kGE5lGEj5yvjxPCLHbb7Cj+EVRaqSHkCK2u5jKUcW/HJTjp8F5ioTqIPp4K0Xcj8Dme+NCzqtZLoxSnCp7Qybz+mndcw0KbQDVNGzNvy7htWrz8/5oZvipukyxHZ9+N0DPBlHoTa90G+GYlPK7EzJoeukN7kswdqeLcDFq8bowvPnED0pqGazrHnF8W+kOnQiiIBGLAYWWBgIHtRNKKWryya1v9Cv1sFaRfcfgapY46IYQ8SfeeN8xBnNjSrh4eX3e/NL7weOuOayt1fV+2TkZVNf2GLBLoNTusHVkkhDG+RcndIYCAoZhsgSrJ3H0HEFY5APhgHhEnaousBxFeXlta2VdMNBbZhnwdUQsxUObETXN/EXgEuyh7++m0EXxSPeH3vTtAIBBtLDU1obWkb5X3AaNQoyX3VW6FCMOvv844iy+x06mQeD0MBpsAwykCk61nG3SARIahBidJzLwf7fHkXYPz4Pgx+I0TJ3aj4n5mb35i/6DiCtfXfGKQ0QAVGnBCnFsMmdSUPylhc63ebeThvdA+r4cBrRcoUvMWs7u8CxwNCzObXnReqdQmSqjNW90tPkNeODwKPzcTOOiDQi6B1J4PeUZ68MrJvSm22V7ayJ77RW5DEgLyBG0E/Ak4rnruwRAgDCM+0x3PtCzJ1Yps2xnzHdZMdc2Gp4u2OAuO8yJUAZz2F4C9UfZlLoB5z5VV6edZkBruOCX6CzddQDp3fBt8O27VerS2hR7f3YlOXLsSyY72K/QcA4+5R/3nu/R+olVJfeDZhYZmHLjuiQNy6z2hX1H7DHJn+5wkT6h5uyl0Dx/mw3JiMF+f7S1jSbAidvU1YV3/Ylu4IWyJ/AjL5AAW69D5Ohmu6rax+aRD3e0aoDWR5MAkEGc+cVY1sCofoHI9H+v4hYeB97eZ0fC/aKfo7JGkeW+EVbyH/rWXFjW+Oqob8rIVhOKnv5/sen9UWolU/XkdmjSN5PHQ2OQDhqP+Y5cLCzqtGQaKawjyU3JdFEy4FG8wkcSu/s3ci8/AqgtxPBLPdqKFQs3/dGSfYkY7pLWeHY6sSUiRs9TT86uoqShqjEirQxQl/jFYw= X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: Cy7wYQeykq4zj/3uvKUrnDVlx9ENOgeunOJKpGUAUzD3MgWckTh4ID7Tv0t/x/A4MineytW+nJDkmA/ORzNGnJ1y7UegRYAXEt8IKF4UMtE00NivtupRf6TnjGu4FFI1s4K9VdY0lOGrKNqm5pNE7dorNkNDm6RDhXfipWmiZdraM2r5jAG2jQrD6ZKNz9RzRFiQD4KXTbk6dGyhlVuDE4lxA1mLlEQQ2e5M8Gf6r1bqjH8dPBTjN7F+OkB2AT1lrKG72HvqVZ5I1nN/QHFOlQoehMc/xOOa0Hm5o2wIXRspgZRcDskk+kRQUYZ04Dsm407o5QhSV8YcCmKviHUwZQPwmSnnbFiPwQOKMixUseSKj/IdMl4CEJbuKBx1UO7L/7h2qZ+H972Hdzi5FzkenYcyogLV85r+rd/MKp9pZ2XUuqhcC+VKKx2F4a6sGchuxhN/UPoqfyPJpEHIJ/fdab825mBpk3K8g5VJSewlWnNWLL9S+UollOsno+KoM1U4DsfF8qr+Li6NlLDuHK1kNj/v+TzfRLHrNGou8EHOKn+SK/Y0VY23PH/Ipmq3y0zYjOSTVqgJzWdcg+PcaHX1EMHkBaCkHXpLGokPqlBz9xQ= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: accf2949-7f8c-44b8-842d-08dc2d9a7667 X-MS-Exchange-CrossTenant-AuthSource: CH0PR10MB5113.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Feb 2024 20:21:01.6749 (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: gxLBPSDyC4VI09W53OEcJwa39WtPhqMQ9AmaEArjqehkJakJGF8Q0EHZJ59hE/j00EJu1TF/9+VVZXTkQ1zi0lepAwMzCQOFXG+KpyMCNVY= X-MS-Exchange-Transport-CrossTenantHeadersStamped: LV3PR10MB7963 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-14_12,2024-02-14_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 mlxlogscore=999 adultscore=0 suspectscore=0 mlxscore=0 phishscore=0 bulkscore=0 malwarescore=0 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2311290000 definitions=main-2402140159 X-Proofpoint-GUID: InrWXzdQ2Pe51EgldL5xHgewOgZzewMd X-Proofpoint-ORIG-GUID: InrWXzdQ2Pe51EgldL5xHgewOgZzewMd X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790907190843853763 X-GMAIL-MSGID: 1790907190843853763 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 --- mm/migrate_device.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/mm/migrate_device.c b/mm/migrate_device.c index b6c27c76e1a0b..9152a329b0a68 100644 --- a/mm/migrate_device.c +++ b/mm/migrate_device.c @@ -377,33 +377,33 @@ static unsigned long migrate_device_unmap(unsigned long *src_pfns, continue; } + folio = page_folio(page); /* 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) || + if (folio_mapped(folio) || !migrate_vma_check_page(page, fault_page)) { - if (!is_zone_device_page(page)) { - get_page(page); - putback_lru_page(page); + if (!folio_is_zone_device(folio)) { + folio_get(folio); + folio_putback_lru(folio); } src_pfns[i] &= ~MIGRATE_PFN_MIGRATE; From patchwork Wed Feb 14 20:20:55 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sidhartha Kumar X-Patchwork-Id: 201113 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:bc8a:b0:106:860b:bbdd with SMTP id dn10csp1477850dyb; Wed, 14 Feb 2024 12:23:14 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCV4qk8bAC5WYWr3UXW4/RAwQcAP/1qAtAxDgeYxveB9aVPoDwoUYiGNGV6Gujqw8qd+2QzqweIjo3wr2TVXIFw7Mbja7w== X-Google-Smtp-Source: AGHT+IFo+LZGQwI5vtbH/ktOSkAVOobozoXG4PnNUa0C5FY6HHlWV/SkRMw4sEuk9E5Hi5jL8IQ3 X-Received: by 2002:a05:6a21:3483:b0:1a0:5de4:2f53 with SMTP id yo3-20020a056a21348300b001a05de42f53mr4072571pzb.25.1707942194358; Wed, 14 Feb 2024 12:23:14 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVZyYlEHMlI6D8q8b5SJJxVGWtCT4RFDmDtDXYpGQ+Ug0ZDvYDoS4Kl6+y8TIi/m2d1NADJCoL+twY6UcNC3ed/i4wq3w== Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id x64-20020a638643000000b005dc95934e54si1371183pgd.52.2024.02.14.12.23.14 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 14 Feb 2024 12:23:14 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-65929-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2023-11-20 header.b=SnwHes7Q; dkim=pass header.i=@oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=TH9y25vW; arc=fail (signature failed); spf=pass (google.com: domain of linux-kernel+bounces-65929-ouuuleilei=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-65929-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id BDAB328FD93 for ; Wed, 14 Feb 2024 20:21:45 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 04E1613F001; Wed, 14 Feb 2024 20:21:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b="SnwHes7Q"; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b="TH9y25vW" Received: from mx0b-00069f02.pphosted.com (mx0b-00069f02.pphosted.com [205.220.177.32]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5C7DD13A875 for ; Wed, 14 Feb 2024 20:21:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=205.220.177.32 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707942082; cv=fail; b=mxGW8/uVSt+flFqucdcaME4vReNbflClyC4CuwvWdfDYeeRlTzXic2W/tfq37gezCugkQMYNhZ4AyC49Dur8YxxsVGOJC4LuHwUJnnxmqBzwS+F2bWXRjQHuTnirVTOlBbFBe44yswHphHBCq44d7PzZNa+sP3BZhBV1zsbtAAs= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707942082; c=relaxed/simple; bh=IBukNQ3Q0ywNqIpU87MoRjhHAySuxh6PjpOzZXY9NzA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: Content-Type:MIME-Version; b=Wl7CYY6xrlzhXPMaWlhxrtCCHxYmvxUkuegFU7wkzoMFbmQvlr4uk7nvAEz5HsKcz+5d/J2xEEIaXEDzJzA7n2bY9hJECOOsbecjwkZY/ksob+5JBFv2Gq3corku7u/qAp3rxBri6mr5i/HwjAJi+LNMFu52ej57IHQm62EbOzM= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=oracle.com; spf=pass smtp.mailfrom=oracle.com; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b=SnwHes7Q; dkim=pass (1024-bit key) header.d=oracle.onmicrosoft.com header.i=@oracle.onmicrosoft.com header.b=TH9y25vW; arc=fail smtp.client-ip=205.220.177.32 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=oracle.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oracle.com 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 41EIdr6v010794; Wed, 14 Feb 2024 20:21:11 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=OrEwVc3/5igvRGFQMEeEiZLizeV2rUT03o22AZOfzys=; b=SnwHes7QOY+xImG9nvJ68jnkOU5xVLwwtEVvQOWjUU8cEMIfMXUcmbOCxdjbr972n6Qd 54HeY6FtNpOP6r/hqhMPHoOTjoEZ7iEPUiIHVulhQ6wjutGzMeG2D6Tsu+sXevqbq/u1 sHXPcZInV0YquTZa2XaP71uW4YsVukZdH9ovYyoBxZWO5GcNJn5H6Mk7oLqgpUgi8EkD PCYMTkSYvrLq6hLJY+dCYVqcW6QqNq98l7cqxMVXUCmGxm3X58W62u5m23QB0GpoiotT KFAnVOO6G/BbSHP1lxrOeG9Ssl7Rwy5pqIowWsJmFHAo5V+lLhKVG08c35BoAcN7Rldq tg== Received: from phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta02.appoci.oracle.com [147.154.114.232]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3w930106wh-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 14 Feb 2024 20:21:11 +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 41EK3ltw014951; Wed, 14 Feb 2024 20:21:10 GMT Received: from nam12-mw2-obe.outbound.protection.outlook.com (mail-mw2nam12lp2040.outbound.protection.outlook.com [104.47.66.40]) by phxpaimrmta02.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3w5yk96xxj-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 14 Feb 2024 20:21:10 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=YhsR36JUmQklWc945AwpdIuOyQIusVeDsIv+mbJODgQULJgJsmkdqeKHklvtUabs0iTKydaDEirYV+jTWVJwQyxKUJkU7BaOOHNnhNTNs+bcHgpnPMgF7z0eZdVO9sZ5p/8tLBUbRxsKqiHvYK/5XTt+N4chlirQS1UEVGKoBeqfoVPbVzP0L2+4iI+f61g6yvIIvACzehW64j/1CV8FwuwtjnS6yZltOF5DOOblpzdTvphnAK5IsG1lmaNfjp+p5BGgZQx7fAmM3GFSmdi3fJFb66QYG7Vd79rQbsGwX8yboyzx1RvissPsrMMAqkGKkgT9FVyEbhhOyXjPjVHh6A== 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=OrEwVc3/5igvRGFQMEeEiZLizeV2rUT03o22AZOfzys=; b=XnToPMfI1tX4Y2G7hGWotZK/+71Lv9uZMs2HqQSS2ieEM8MOcR8aMndwUkY0IaLHmAqM30RowZEv1+H4Kb8xPGE+DMfT2/RjwDIRv08UGjLvH5Qgx1v0uXdY9VkSWJ/aTav3UPyInm0wL57mbJlYuDGscJBLGnH2YpTw6/KSqGpJkkySTengRaBC2FtOq/xAeiHIxI22nfCW941kz6aMkGdNhJNW/Ucw3UqodndlaeGZ/5mmSrYTrxzyK3vMMqsCa/PlJ8VV+2UeVWssL5rlts9Y/cvPB8RgCNL0CHO/sJnZsyak4P3nGhYHu+Yyrk6rbGthXOjCXvI/CGcefxKWIw== 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=OrEwVc3/5igvRGFQMEeEiZLizeV2rUT03o22AZOfzys=; b=TH9y25vWuAg2qSeJpc1sfza7M7gc5UjO6ubKuqCNPJTdbJ9Xy2k8AZ5EHeurvlB00yIv3U1AnCnRkABFBs5DJdHgV13Q6XsTuPJjZUOHfdBcus3dLAAbEhiRm9ZDIUzC8iaOCnsrSEM+eeSTWQOH4ByGo538kUSPYB0C8zQ9qhk= Received: from CH0PR10MB5113.namprd10.prod.outlook.com (2603:10b6:610:c9::8) by LV3PR10MB7963.namprd10.prod.outlook.com (2603:10b6:408:20e::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7270.37; Wed, 14 Feb 2024 20:21:08 +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.026; Wed, 14 Feb 2024 20:21:08 +0000 From: Sidhartha Kumar To: linux-kernel@vger.kernel.org, linux-mm@kvack.org Cc: akpm@linux-foundation.org, willy@infradead.org, Sidhartha Kumar Subject: [PATCH 2/2] mm/migrate_device: further convert migrate_device_finalize() to folios Date: Wed, 14 Feb 2024 12:20:55 -0800 Message-ID: <20240214202055.77776-2-sidhartha.kumar@oracle.com> X-Mailer: git-send-email 2.42.0 In-Reply-To: <20240214202055.77776-1-sidhartha.kumar@oracle.com> References: <20240214202055.77776-1-sidhartha.kumar@oracle.com> X-ClientProxiedBy: PH8PR02CA0021.namprd02.prod.outlook.com (2603:10b6:510:2d0::28) To CH0PR10MB5113.namprd10.prod.outlook.com (2603:10b6:610:c9::8) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH0PR10MB5113:EE_|LV3PR10MB7963:EE_ X-MS-Office365-Filtering-Correlation-Id: 51ffefb8-fc62-4b58-e20a-08dc2d9a7a98 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: pmOry6r2hCYzR+9lY9c+L7xRU1PS20Y7Usk5J+CNvxR52+BgWuOmGMI4t2z1pk/Zjdhc9XyMbJt9OicAe9tGV6r7D7Ofh/JxP24Fm1+bFQygS/snn0+sE+QLclHzcBvnGi44bguJdKcdg9nG/F29dde6jZMgJl+X4vDUgb6lKoGbL+t/gKIM/jxe4u+15BHrhyrqNQRT88RbLzgsiyIntAaoSY9drDxMtzkaFlWWsybe79GVxt5fm3PC5AOMD3gvmY75eiA7Yv9oexbBQGm66XLfufwK5UVhgDgZnF6Ya6AVOnmOTK1e4x3oO/MhvJqMrpu5VhPeLnWeVTkRBJjUI9trxvqdxvW/2bgWc6TWYe3N9HwdZO7M4yZ9VdH9dD2nlKRaAergSTlGQXKBktzKBNMX4G0R/UzH1ZJVnFxWsgCMcR/UaZyHV93RqJf7kidFN/jrP2ilq2F2MSyap5MrmwbRRsE0PeIdoyYq1xeiv84cAJIkiXQCYcl72hLMaRs7FIZ7It5j4RQMGp/W5nMLRho3tA1aXWINSmyxbz1Uhjj6OmJifPPy7V3tgDUXjduW 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)(376002)(39860400002)(136003)(346002)(396003)(366004)(230922051799003)(64100799003)(186009)(1800799012)(451199024)(2906002)(4326008)(8936002)(8676002)(44832011)(5660300002)(4744005)(66476007)(1076003)(2616005)(38100700002)(36756003)(86362001)(107886003)(66946007)(6666004)(316002)(66556008)(6506007)(83380400001)(6486002)(6512007)(478600001)(41300700001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 8xmtHZmiuegvOYGHs7o4QeDJr290jK99KoA5aVs6Qe/8mFXX8wkz0S1k5DnRIR979Tm5uddvXcHAZ//1ZhCxDrSqA2iOjeNZqj6ZqTgIJZ8Bai4Foo9Q3sOU5KuzlQ4Am+goU8S1KwfP86zXzgoiFfuNCSOS7EissjWfE3AfB9nzPgxnjH2eVODTBSEKGyYxvqJTtl7W+XvdNFOUDiQ94Ihie6j376Ktcln6RAAtmQZY40PoYvcIG7LVSe9++zxcZGpp7F/lmdZGnRCGejfEVI70g6XnTvGn9KDJm3ZlBIU9x76hWVfRqjBo1QWhGDord6efxYz5TsBO5KMz79Vei8T41BceziKlvRjOhEj8EbZ9ndPOUsAug26JzKJKDqkUYwM5g1akFU9Ht2gBGhDzDzbqt4w7rQ95IkjrgOTYJ1MQxnqtE7Xyh0iI5rfgpJfKbpuI6/YxFtCuDpOBZ2bzmmiP2x5Dvy+BGq2p6qlFJlQGzimXVxFI5VzLlUBBZwUKibhci+qjr9lODnCa+mb3FTwS3VewvJueYUQNKJwdzpCRuYo6GQLdkPpzB80yoyQlB/6tSkP69AgudOdNtgFtMmESWcwott5I2mAp1Hziwr/jw02ojZMBMYbQFJ7jJOrZF6iBUlta/upvPQ3CXMorJstBcPhfj6MQcdUniXfZGMcW2O/kWEL13LT/Re/yeT3pWWtVBCvOlZsvv/XkufE+k4A8m2y9sJdELOXtLvOhlv4O1L2x7VrhY05K6vMVhG8zbfp4yQT2GkmM/5+LSuNWBjMK7vIJ2gniGIKaRfsmEH/33763lbqrtK25p3D0emUAvBazLInufh5P1tIU7L/gOvGnKBAjLEw3bGGLX9B09Pv6eprriVcC+4kk2e24+o9UNi9ixsoWRJi4wdPQy8CXm5MngEzftf3ZMo6P/rbnhEN4Uzvq37gyhEE3ElnjrJchkhRgphU8pPsI92arB4TtNFIl09LDgSS4AZEiDhwKakNTIMuK6Zt8cX4tcB5zEfV4G2YoIP58F9mhrJDlBSJwPwtOFRizRoAk7eBNJIdFX8zjP235Bg+NpxASW1ymv5TQ/LFhXRkSig9bN8eOhhoYufCwZhR/7NcDXVYsTxE1UZ3JVPlXy8C7aXtmgHBU0Xotn15mkzyHJRJYlHPLf1//XL1ZF+vxNCW4WNlktWtyaAtjMoz+05WZpIGAgPOr3rjpk+ACOMyGxktmHsrYRbeYUiLcvJft2OG/QhkoyhUTHG1Jvedm4NdVOSKyBOPpW2kwxgPxhLF2vFwSuuaTiL7unkkuKdc/V9aJScnn1AEls4wZ8O7OerNZO0BKVqylc2xAjA7gHfDAtDZuNNY4qGwYRknNyprRYMaNstwCBd8xGwZFEjnnaZLILsYx0Z1zSZ5V8CRX2C5hCNUz4iPnU+dU27rIBMXRVvKHRID5cNrpKKDZoFlgVp2N4BfqHmFpnhI2OubbPZWwDzYeRIcsUp26wuqc4aux3mAvN6XVeo3JRTrWDLkVliWVsJXcVfNB9Qw9lb8TAvpcYYBKTLQeIqsj4ElSh+ZC2Uy+RIlRNuH3yDJ3/8WF79CEbKw6UnNwEKqWb7IxHTGZr/CZCii+gMkMxROwxNmIwjpjVXdVupZl1xw= X-MS-Exchange-AntiSpam-ExternalHop-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-ExternalHop-MessageData-0: ohJfnhkrU62SP/RxJWuaUYptuEGvDEbctnIUNgB3md56BSZKlU7vpo2frShylcUHZdWFy0DCSFO1f+GpcZkdB8Br74IlilEspP/ZULauMzdg86GOnpVbDpnyKs3gNVOc+6FrtcAGQvWV+GOoGZODTstXp46Q9Ebvg6mm05/WBqW3blRNjdnWuch9+gW/dAyeT1vGkkpKcGLmMVf3Uml+THwXUFC0I5yV6ClceJWelM9iFwIJD9BZq9IRQffVghmvGMeobjcTDHfS/Jnt1AKrKbBp6/JQ3gUl/FEkH+L2tz6JyEN8ISGrl5fUpS6U95r+zp3X8tmun1droy+CZ17TeAbJ2xeix1gY4BDn8Hd/TA0lFVuZp8Nb+0Yp8jeQ5fHV+Zpg+FOHSz5duKa129f50/MQfsGkMZns88Mt0Y3szxr7jjVkMYi6bkkCHu0W1mq6e0Pntw3vu3wsy7xiJkcdY4hrQ6Po6wJcHOPMNNG7ge+0CXEYaO5jxKtR69nFZZqxr4YvqK1TrMnmhHzUWKIGAetXLO/ToNvrz0nugESXmkTQ54nEkBmK1xIN46CB93afm/B2VGH+m9HrnENkgWUdue4IfIINgCL8p4MrOGYwUOQ= X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 51ffefb8-fc62-4b58-e20a-08dc2d9a7a98 X-MS-Exchange-CrossTenant-AuthSource: CH0PR10MB5113.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Feb 2024 20:21:08.6300 (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: w36gnoaDwbHJsddA+JrTA/thpkRW06eMqRNq+iKvccVnq47rShAC10OmuulkHXdQuAJvkxwYIzw521nHK1+NIyRaeJ1iZ2Ix+2YSy1eMBlk= X-MS-Exchange-Transport-CrossTenantHeadersStamped: LV3PR10MB7963 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-14_12,2024-02-14_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-2402140159 X-Proofpoint-GUID: WnhuTZoa1qEdd2B6gmfTbp4hOTmsN-OP X-Proofpoint-ORIG-GUID: WnhuTZoa1qEdd2B6gmfTbp4hOTmsN-OP X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790907194259750988 X-GMAIL-MSGID: 1790907194259750988 Use folio api functions from the already defined src and dst folio variables. Signed-off-by: Sidhartha Kumar --- mm/migrate_device.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/mm/migrate_device.c b/mm/migrate_device.c index 9152a329b0a68..a48d5cdb28553 100644 --- a/mm/migrate_device.c +++ b/mm/migrate_device.c @@ -843,17 +843,17 @@ void migrate_device_finalize(unsigned long *src_pfns, 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); + folio_unlock(dst); + if (folio_is_zone_device(dst)) + folio_put(dst); else - putback_lru_page(newpage); + folio_putback_lru(dst); } } }