From patchwork Wed Aug 25 03:48:19 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: 12456321 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=-16.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,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 B991BC432BE for ; Wed, 25 Aug 2021 03:48:56 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 6A9B261371 for ; Wed, 25 Aug 2021 03:48:56 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 6A9B261371 Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=amd.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id A34A46B0075; Tue, 24 Aug 2021 23:48:46 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 997226B0078; Tue, 24 Aug 2021 23:48:46 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 85CFF6B007B; Tue, 24 Aug 2021 23:48:46 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0164.hostedemail.com [216.40.44.164]) by kanga.kvack.org (Postfix) with ESMTP id 6D15E6B0075 for ; Tue, 24 Aug 2021 23:48:46 -0400 (EDT) Received: from smtpin32.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id ED14425708 for ; Wed, 25 Aug 2021 03:48:45 +0000 (UTC) X-FDA: 78512221410.32.DAD4BFF Received: from NAM10-MW2-obe.outbound.protection.outlook.com (mail-mw2nam10on2083.outbound.protection.outlook.com [40.107.94.83]) by imf06.hostedemail.com (Postfix) with ESMTP id 89EB0801A89B for ; Wed, 25 Aug 2021 03:48:45 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=b+2Umku7vhgBIObqDRq+7aadzvzB+LV6ZTGs70KAREp/763GObHA/YNTvo/TZPENsJEzZeR1Z5xBRN0PnunhL0jfd/QFx1bwafR5cbupId3TRjWup9qkcAOweNzF111e2juxo5IMP5kNzEMAK3XzTzYc6R1Fgy1OSnbt0+nXVIq9D6nkM7fpPLphXQQ+5mTt991dct/67Ke5jiNsG5oENrMd1CwiyR16gI/KRfYapBXtBst1fEjM7MqpUWPW4FF+BusV/GPnrDmdL/RktFQ8FGhEpO/+zTL9IBEq1d4zFbSyWjTK8qw5dXjlhBLAm/usFw806zQvsb9TjxnimfHMzw== 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=gewBIQO8Z68IgfgsrXbEzqIa34U16SiSGjwinCd25vg=; b=OBBaymnlJiUhqaZ78L0xGrP9N38KAIMcZLHQxXOcsosoUy6bwNONmbyO6THYZlaqcj2+3Uv3KdZc5mTLt6C2is0J77DwKE0GyY22ByEJGeTDKoR6bt7bWDGte18HsDYkOIo+G+P8EKjmFIL5lKotemilc+9GyaGMGM72K5R6LeEfe7RVwJob9C4OZokm+4l54WxEDXQXN+ldGZkmPhACMlI68NmiCLPtc+9y8UBr6gszcPuNWCGW3ogabTDSEMDQa+JY+JVgPhYGPXpPN+8m6xFaDngy23zH9+Oyx3yY2dvjaipybgv4zzW7hJq0o4+YBbnsBS7yqFkBEYUKZBKQ8Q== 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=gewBIQO8Z68IgfgsrXbEzqIa34U16SiSGjwinCd25vg=; b=Z4RKmst5+aX+2o5eJDzdyCd4APBvgkP50trb9pKTNn6sK1JP9eBZ4sMhuz3404p1zdErFH0/ovvbZ+oYx0mzQQMqFNnD0yYS2aPEeHIMFonlmr6dQJZSwa+KMd0WuQlN90VKAg6Vb+0E5BmsUdrgBfn3FqITWSt8PSvVNpDEyDo= Received: from SA0PR12MB4430.namprd12.prod.outlook.com (2603:10b6:806:70::20) by SA0PR12MB4511.namprd12.prod.outlook.com (2603:10b6:806:95::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4436.19; Wed, 25 Aug 2021 03:48:44 +0000 Received: from SA0PR12MB4430.namprd12.prod.outlook.com ([fe80::855b:1f8c:c5d1:331f]) by SA0PR12MB4430.namprd12.prod.outlook.com ([fe80::855b:1f8c:c5d1:331f%7]) with mapi id 15.20.4457.017; Wed, 25 Aug 2021 03:48:44 +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 Subject: [PATCH v1 05/14] drm/amdkfd: ref count init for device pages Date: Tue, 24 Aug 2021 22:48:19 -0500 Message-Id: <20210825034828.12927-6-alex.sierra@amd.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210825034828.12927-1-alex.sierra@amd.com> References: <20210825034828.12927-1-alex.sierra@amd.com> X-ClientProxiedBy: SN7PR04CA0190.namprd04.prod.outlook.com (2603:10b6:806:126::15) To SA0PR12MB4430.namprd12.prod.outlook.com (2603:10b6:806:70::20) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 Received: from alex-MS-7B09.amd.com (165.204.78.1) by SN7PR04CA0190.namprd04.prod.outlook.com (2603:10b6:806:126::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4436.19 via Frontend Transport; Wed, 25 Aug 2021 03:48:43 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 62f48c69-9d95-42c1-3aab-08d9677b3c46 X-MS-TrafficTypeDiagnostic: SA0PR12MB4511: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:1265; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: j7YAuGS2Jo7J2K99NJqNyxfA7rI+uK44ke6WIUPhpjo2SUJPozTI7f4IipjxxB8DuZimJAAmoC5VmdKq36t0OL/PmTtnmmmhg3DjK0TUDcdITVzzxSYyjx7fP3gqDgTW3VRzqtfBUprDrHY25PxasLwoS/jHn1iMi0dGHHXJkUt8gSrcga64qxcHYFeH0fqHJN6Sq+PnNZY5gPnC7Ru32x5vkImeUugLp66u4eQMsURaLKqiYZitxX1+ywnhyPL5yyijROOwW+YSgmUUNgH9JOQ4UQM8PTBIA2Zi6K8ZTENyTbmU8Mk59DML+iZ+EndyLVbTJF/NYNXmcIpzkzylLuyThO+p4/rR9Um7Lh6F/E7868FqdzH4DhMNNvLZffQdC/eSh9ZjnDJloo5LfsKa3SIoS9OoKobF8YR3v9vCmRpNn9oHNL4qngGUe0fQ1t82WMSCAeeXz6hZD6oEGbmq8MSkaTLidJ8+umu9sPHkB9S44LFq+7FsJoTXNaMLQgg0Hw8JOlDwfQZNe4qnTfvKJJuUJGBeNha7pqxzLTdcGoV9XOyk7CUHgLbgyIEeyhz9ZeKKQyrOhwxCotudGoJbuBpqtYaYFo/FYcppl8rHeESbmZzRGmGpj+rSahPnsT8Z1+bvqFSG4o+Py1zlydBEFHRxzzKmL+3SIeTz05jnxNLXIlKqAxFrnhOekS/dlAic1Gp3GfSU0ht55/03YgvsVw== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:SA0PR12MB4430.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(4636009)(366004)(136003)(346002)(376002)(396003)(39860400002)(316002)(478600001)(4744005)(186003)(1076003)(83380400001)(8936002)(38100700002)(7696005)(66556008)(8676002)(66476007)(66946007)(6666004)(956004)(36756003)(52116002)(2616005)(4326008)(44832011)(7416002)(2906002)(6486002)(5660300002)(38350700002)(86362001)(26005);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: RHc/YK9DrpGz+WRV67ZHjvhvUja2p2CgruIQlttjSzkK2+XKmoW6P2325PPhF6M6Eqp1R6XdeNMg6nh4RrvatRu2cEYjrZOGGqTj7JjbVuUW7pG51u4bbIpY48x1CTk+gIlRMIBwSZkgAvgTJn1QLIXmLHkLwIoDKd+tebW/LJbto2OMfjV2fCZYnUeDgPEseyP+ilydKbPqy/2i+L8R4RXedvCqHn4pIejV/q08DmGz6RbYR2FgCLXKGeO664J0yCRlaqoi23kItgRJn2VZ/JuTM9jhsGfhaRVw218tRfo+6w9/mFWppCyCd8MOBzDw9/6YU34ldH1rgJ7JyyExvt9xqCexTQW/iU1dET2FC70Dhqz/lDbh4ZhEDA4FhjyYWwcz9cZeazpb9Umqz1E4I9xS6N9k04yamATh6b7UJrmaPryKCZt89jLjyv27pAS+xw8PH8Le2LtQHGl7yPV0EwA3eHfySHnfBW2qiEx+OBVm7lT+Dv8WyGtDQByr90C3B6XfMAtvvrP0ZJeKzGhGMuxL0Z+RaIfbcG50x+2zShG5mm2MgvCPLUD7G25Yzx0cEqFNod7+Mg7h4R+bXbpvZ1KJJgTalqCmwKhXm80ORLscM227eDiw7EjboFc6u/LICpcCerdcnudAZgApO2Vjx7zIAIbA6+65xGuWxdDDRva6wFr0xfqBtIkbzOdmvoBVPErxlgJdsbKoZh1ZgfHm3roNl/S06bL4LZURhGyK7NLAumaEu1/dE7nbXVv+iSsqaTJjIRIdoaxuiFsAoZwqgpZl6mJwdPpRn5H8Hm9gxDt21PS9KhnmB8HYVsl11pUvP7KcswH4+6/36TvErE5jfyvkGbr74V4twDZRS6TIdCrX3Wvf+6lqqH3rL945wHjBpcYRRvmbNyotLaNK5C3wmGYXkpI/i0VpKtRTk/AHAT6nzkyw7x4mwVn1h/AxwUkGpTzwiN0u+0pt5DC9mZ8+8SVkeyBdq8kb9pG22+Jya09bus0utx+QFBaC3Pr0Hl6YDIer7fRdVE+CxqpVCbEaNe1AHF+wdGtQ9gtQ6A3YX/ACERxbghoomjP0Zz0KeZW9lV6uEgAFFu/suy0tfLtkPEA9xLta7hRQeF4QHJmsYVYcrv7AJAoLmoNNmOeWDBhHpc8CAWqpJJlx/3LbVSHPbWOX1EESImMVtGZmbNujJoffRTwFC+RnCJIB7VGVqu6j+ghHrMsypqHCfMh1Lzai50xhCdY5W6GRbWHAVPVZ8CJbcXUrqh4OPQgLEiigGQCNHnWdhYntuMtLWmXbFuP9/lkm8OE5nkr6jX+A0/FkJtGg+lA7dr+rUjqU438flJQR X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: 62f48c69-9d95-42c1-3aab-08d9677b3c46 X-MS-Exchange-CrossTenant-AuthSource: SA0PR12MB4430.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Aug 2021 03:48:44.1252 (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: RoUYQAP8YKiUuvE1jHemGQLdo2PTtLA7yalbciS/rjmIjOIX1dbLYPSCQbroUlhLn+lfo8rdlW35EroSaY4P6w== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA0PR12MB4511 Authentication-Results: imf06.hostedemail.com; dkim=pass header.d=amd.com header.s=selector1 header.b=Z4RKmst5; dmarc=pass (policy=quarantine) header.from=amd.com; spf=pass (imf06.hostedemail.com: domain of Alex.Sierra@amd.com designates 40.107.94.83 as permitted sender) smtp.mailfrom=Alex.Sierra@amd.com X-Rspamd-Server: rspam03 X-Rspamd-Queue-Id: 89EB0801A89B X-Stat-Signature: c63ofh8nmcjpjwwnjck83kwmfcyfxb1g X-HE-Tag: 1629863325-703748 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: Ref counter from device pages is init to zero during memmap init zone. The first time a new device page is allocated to migrate data into it, its ref counter needs to be initialized to one. Signed-off-by: Alex Sierra --- drivers/gpu/drm/amd/amdkfd/kfd_migrate.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/amd/amdkfd/kfd_migrate.c b/drivers/gpu/drm/amd/amdkfd/kfd_migrate.c index dab290a4d19d..47ee9a895cd2 100644 --- a/drivers/gpu/drm/amd/amdkfd/kfd_migrate.c +++ b/drivers/gpu/drm/amd/amdkfd/kfd_migrate.c @@ -220,7 +220,7 @@ svm_migrate_get_vram_page(struct svm_range *prange, unsigned long pfn) page = pfn_to_page(pfn); svm_range_bo_ref(prange->svm_bo); page->zone_device_data = prange->svm_bo; - get_page(page); + init_page_count(page); lock_page(page); }