From patchwork Thu Jun 17 15:17:04 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Sierra Guiza, Alejandro (Alex)" X-Patchwork-Id: 12328185 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,MSGID_FROM_MTA_HEADER,SPF_HELO_NONE, SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7D47CC48BE5 for ; Thu, 17 Jun 2021 15:18:38 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 33285613A9 for ; Thu, 17 Jun 2021 15:18:38 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 33285613A9 Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=amd.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id C53506B0080; Thu, 17 Jun 2021 11:18:37 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id C29A26B0081; Thu, 17 Jun 2021 11:18:37 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A7C796B0082; Thu, 17 Jun 2021 11:18:37 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0178.hostedemail.com [216.40.44.178]) by kanga.kvack.org (Postfix) with ESMTP id 797A56B0080 for ; Thu, 17 Jun 2021 11:18:37 -0400 (EDT) Received: from smtpin28.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 2731C1C97F for ; Thu, 17 Jun 2021 15:18:37 +0000 (UTC) X-FDA: 78263572674.28.E6CD66F Received: from NAM10-DM6-obe.outbound.protection.outlook.com (mail-dm6nam10on2063.outbound.protection.outlook.com [40.107.93.63]) by imf11.hostedemail.com (Postfix) with ESMTP id 5FA37200109C for ; Thu, 17 Jun 2021 15:18:23 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=PW3xktzr3m3ME7MrEJasHHaBlVSyI0j6TdkPvJhkssdDa6KYs547nCd77loAMblD+h/iQhmBb6jOp8jupv0eOXmS0wglrD2cq6QawBkUgKLd5w+s0E07fHZ21RVvmNHN7FuFxINLcXunFDWJJRkKtodv46SvRQPoWMSq26Guy65JEUG3X4Q2npfu/d3uQJ1ZfJGXcl8FP7wrp+WFf56aASGZyqzcCH8DodiJtTk0UqVTQ0JwcO+hC74EDhvaHhwXhFriTfHG+JiB/7k/876EXUJ36+gVWlgYTPPdm91ts4lbky95ntvOilPHweJp9Ehkk2cO3jZGSvNnOOJ2sXDXsw== 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-SenderADCheck; bh=cZgqia54AVI+Kdm1/0jPmLtYO7Hb28fRehM2Aoj8kH4=; b=ALXcm/f9jPIFGmFUwCeEAvy5qsCHqEZjR8MxRwaA6/RgSlWa3keMLmyCeW4TMnvlqnEKmQKGDlA78gS7Ccru+M/WryaysUhQkgtaNrV74RA0Tvrd9d4xkaLuk8O9Ca6qINzAuJ2Bf1aUvZD+5In9YBuYl1bJXS4aKK7DgAYT9cqasOOtwIEq2KKP2WePeyj9wV7/tD6IJJu5EFvlfPo5zJL5UN/2leAr+LnXRSn17zA4KwkP0YL9WFUhzC1uD9234rTKTb+rs8s1KrBQZ34LdDf3o/WBlN9Wi2EVoJ7gTB2BF1HLpgFbUbdB7YRB02H6IDkz/h8Mu5iPQRR1e1iVQQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=cZgqia54AVI+Kdm1/0jPmLtYO7Hb28fRehM2Aoj8kH4=; b=zBFFmU2RXGZGKOX99mPEH0uxQft5nMj1fo0avFdHYuu1iPQ2gT6CxmqfI8U0JSC74F8haq+BfBqys7NyWdO5urdT5hJm8cnjWF5FEF/0bAT1kJrzrryuM573KicpiOXj+UjuY1B927ayHnPqjYzmv3JTST3F9j0IdyKjcKMwD1w= Received: from DM6PR12MB4419.namprd12.prod.outlook.com (2603:10b6:5:2aa::20) by DM6PR12MB4419.namprd12.prod.outlook.com (2603:10b6:5:2aa::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4242.18; Thu, 17 Jun 2021 15:18:35 +0000 Received: from DM6PR12MB4419.namprd12.prod.outlook.com ([fe80::b972:f4d6:9db3:5761]) by DM6PR12MB4419.namprd12.prod.outlook.com ([fe80::b972:f4d6:9db3:5761%2]) with mapi id 15.20.4242.021; Thu, 17 Jun 2021 15:18:34 +0000 From: Alex Sierra To: akpm@linux-foundation.org, Felix.Kuehling@amd.com, linux-mm@kvack.org, rcampbell@nvidia.com, linux-ext4@vger.kernel.org, linux-xfs@vger.kernel.org Cc: amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, hch@lst.de, jgg@nvidia.com, jglisse@redhat.com, Alex Sierra Subject: [PATCH v3 7/8] mm: add generic type support to migrate_vma helpers Date: Thu, 17 Jun 2021 10:17:04 -0500 Message-Id: <20210617151705.15367-8-alex.sierra@amd.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20210617151705.15367-1-alex.sierra@amd.com> References: <20210617151705.15367-1-alex.sierra@amd.com> X-Originating-IP: [165.204.78.1] X-ClientProxiedBy: SN4PR0501CA0088.namprd05.prod.outlook.com (2603:10b6:803:22::26) To DM6PR12MB4419.namprd12.prod.outlook.com (2603:10b6:5:2aa::20) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from alex-MS-7B09.amd.com (165.204.78.1) by SN4PR0501CA0088.namprd05.prod.outlook.com (2603:10b6:803:22::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4264.9 via Frontend Transport; Thu, 17 Jun 2021 15:18:33 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 4d921e58-5cca-4e99-ef86-08d931a32c7a X-MS-TrafficTypeDiagnostic: DM6PR12MB4419: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:4303; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: qls6dt6MzRhLYoFLmuL6fbvAgvDLEDIDvU0d46CtoDGbreN+JWNOWhhc45yXwF3io12KVm37pojKNxKGd1wvrnrS7jfjc7S8WxBZcXvWqmzveurDfvu8xq2nBd3HOC8UZvkgxz7HD2sbvP3bTFix6nu4PsBtXErH0ta8BxreXHMhDTnb8deKNZi5o1tMjq+7IYQszn2LAUJ/8s66aIgSiIA783dlrd1vaybZf31C6UZQa+PMFRjGfjVpYyQKwIhmyHwLE9b7oKkHAkyKx3RYeFjyZ8ykjMFOGV1LKkswMl+pqaNxprcziPqG5dr8G+IhgEM7AYkp+udKyY8mzc3y7o9bcst+bMC7Q1PIg/S96xbU2kBA0MP9oltz4R24DaGBuHi4U3V6MxFHkYOIvH71+O1ZrebrXrcsk8bbKPelufOe5713QlG13bnXquCpqDsnBZUrXqdVr72zFOKJ0A7YE0fXrF2ENEKeglZTCujZbO2zorALn+tlI1wzAvhROdiemGIvHzg+yywpeO3BrG+z5P/D2ZY06C3LmNxt1cwyuM4VYd/6sP7mFOfihxZXa4Yk5+/c3JD/1ylB+WBJaChJRVTHv+6JulwQcz4tMrpm+RRfbV3pgCGg2xD2RkfNfCVdAMGb8yvk4j9FPVhy/IHimS1DSKVMTwe6Cp3bWQmUIImiCNdEBdgUDwwgKN9nKj5x X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DM6PR12MB4419.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(366004)(39860400002)(136003)(376002)(346002)(396003)(8936002)(6486002)(36756003)(478600001)(66476007)(1076003)(7416002)(4326008)(2616005)(956004)(2906002)(6666004)(44832011)(38350700002)(83380400001)(316002)(38100700002)(26005)(8676002)(5660300002)(16526019)(186003)(86362001)(66946007)(66556008)(52116002)(7696005)(41533002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 1OFGwJObpRttQ8uvgBnXwRJSF7WjwNMhdVjeA14yoyBt0EzsUx7Vs2up+GQV4xU5Svv2gIIEPcpxG/5WvYhegFF/l5wM6rGjMmw4494V4QA/EMEQQiOl5Tq1xk9iJc1p7o9e/kt85bAWmpLgdXjQuxXq1BwI+YFod6I+fSdXSU4Iz6k64E/YF24t9TGioDhPSCd9dp6BB24NpU+37WAII1MZAdtQNXb9yVCKuAhdIO0bYo1gahzfrys1Y5R73vmnP+EOXIWhmsPSr/UTXHk7EnbxACCxu/X9uyOkzVLy7euMuMOgqVQL4cLiJQ0EG51CctGQwK3+/nT1mrq8YutS6MgEytGzCF8Uh87Nskorx8yw1yqr1NRfeXVC1+9wC2Qs6aijycMY4KgRnbPN6lI8lMiGZfm/y4R5F/14Cn9/inLICuP/Lo0NdHGBzDVkcZcX4NYYOULhvHXrOVpjJRf2GiHiPYG4QDyUAceh2AzED/JjTrrFKDeoP4X7Le32ABpkVoMHVnvzCxMi2A6erYt2xFdYyORcvg1Ciaxbm9J6f1LcZeEGKPoGPJ0Es9tSLwbHsAjRF7MGZSt1i5np6kftMv29FmWkIjpPR3KDt0JO7sVXGswuxRfL/KPitHz2sKQ5/NhTwT43i05UJrGK7zn7+knKAIlMJbJTNsPKaNc+ZKOrFjk+eGMFyy4TUWaTD5tvHy5Bv1CcMInomQQKg9heey5Y2n32kFMyOyYuyqQnERM0N9kz6Vgq5cZRPa9IUyvs2ECc1MpRx54OiUcH8UJP6AhMxUXG9hU5vGCt9yjU32IH3L2uqhMFXiE8kVEM05aAwxSN5EQDoK6MF4icSo0Fg2hdQrjQ/WryTes7x4+3J9RvlCoc4BSP45J/ayJXZJNYuHmsRAtrS9BhQu2xGQ/yiQEs5nwrbEkOmrc7MGBD7TIM1KUbusADFFP3/TbgxyJsj7Acj6YCoyDboRC2Miz1U3pfILxyvDVuS8pYiDj9V3wEfdaB+9qRwFZRJcHP4imrrDP4Go78aoo1N/XrhBK02+VixrzapByDjC8md3ue2/gk63oMRvx8PVfx5c/V58iujPrn47YxbzLJPNqG5saYe3zcboER3SM5vLZmHoLz2fYFHMds79SNxyG9iXUHiag5l7kDhWnya/CvICvz0k6DaNqN6JW5/npnFN1l+uVD+1zbsODTyyMFm9DiIaX4UDYCyW/FeO+hsHYVrYFtST1ijOoQM7cOg/I1I/rVwtEg0o9Q5+ZsNed7FBthuUBFlewDCboo1SGizsQFXaktQq+gCOlBiuGyh79baVY2ZLVic5quuaW+i0IhzZ2lfFG+M6UD X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4d921e58-5cca-4e99-ef86-08d931a32c7a X-MS-Exchange-CrossTenant-AuthSource: DM6PR12MB4419.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Jun 2021 15:18:34.7948 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: g9mCuAFTJBTl9eO8i+COz5SL0nuwpk4G2mybXmDDvams8kQL46c+rhSjya4NyU7O3UMWZ/fJGiwfa8zk7cDKlw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB4419 X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: 5FA37200109C X-Stat-Signature: rbndutttmtij4w3sb8qji4pnpi6rhhpm Authentication-Results: imf11.hostedemail.com; dkim=pass header.d=amd.com header.s=selector1 header.b=zBFFmU2R; dmarc=pass (policy=quarantine) header.from=amd.com; spf=pass (imf11.hostedemail.com: domain of Alex.Sierra@amd.com designates 40.107.93.63 as permitted sender) smtp.mailfrom=Alex.Sierra@amd.com X-HE-Tag: 1623943103-417438 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: Device generic type case added for migrate_vma_pages and migrate_vma_check_page helpers. Both, generic and private device types have the same conditions to decide to migrate pages from/to device memory. Signed-off-by: Alex Sierra --- mm/migrate.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/mm/migrate.c b/mm/migrate.c index 8c2430d3e77b..3b6aaba96fe6 100644 --- a/mm/migrate.c +++ b/mm/migrate.c @@ -2602,7 +2602,7 @@ static bool migrate_vma_check_page(struct page *page) * FIXME proper solution is to rework migration_entry_wait() so * it does not need to take a reference on page. */ - return is_device_private_page(page); + return is_device_page(page); } /* For file back page */ @@ -3064,10 +3064,10 @@ void migrate_vma_pages(struct migrate_vma *migrate) mapping = page_mapping(page); if (is_zone_device_page(newpage)) { - if (is_device_private_page(newpage)) { + if (is_device_page(newpage)) { /* - * For now only support private anonymous when - * migrating to un-addressable device memory. + * For now only support private and generic + * anonymous when migrating to device memory. */ if (mapping) { migrate->src[i] &= ~MIGRATE_PFN_MIGRATE;