From patchwork Fri Aug 13 06:31:45 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: 12434777 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,URIBL_BLOCKED, 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 28700C00144 for ; Fri, 13 Aug 2021 06:32:26 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id DB528610CD for ; Fri, 13 Aug 2021 06:32:25 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org DB528610CD 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 721C68D0007; Fri, 13 Aug 2021 02:32:11 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 6AC818D0009; Fri, 13 Aug 2021 02:32:11 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 4D9AF8D0007; Fri, 13 Aug 2021 02:32:11 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0217.hostedemail.com [216.40.44.217]) by kanga.kvack.org (Postfix) with ESMTP id 292AC8D0009 for ; Fri, 13 Aug 2021 02:32:11 -0400 (EDT) Received: from smtpin36.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id C6AFE180ACC3C for ; Fri, 13 Aug 2021 06:32:10 +0000 (UTC) X-FDA: 78469087620.36.8A6EA80 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2087.outbound.protection.outlook.com [40.107.220.87]) by imf17.hostedemail.com (Postfix) with ESMTP id 626AEF0011FB for ; Fri, 13 Aug 2021 06:32:10 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=LJ/A7U6Njpn6UStzDYM/axYfiN020U0KKs5k+8tcuMNWT+kWWoEhrm9aQpnuedeVNozi7Byy0td0wmbJuCIbdkYMvfUZOEUeB90DHGpydhU8jCC6UbQP2eJdJ/b+4GI9/UWY6Z0vc8tsjDWOYf7P1qI90YTHiwN9UnolbqSc4XOJUG9YDcB7K31QbTB9bIBjTQ+NxUz0aeiQowCPQe7tM1lLCVkeYoiFK8EG5fuZ5AFasXovV1+Jc9+0Uh3iMFhilq8RpoWlL/RetfUJTAPHwCpdWAU/I5BVtEwkqgcpaYh/ZEx3dJ6zFtbtZh/z4bGBr98uk3sQrLWM/v65nPFt7g== 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=RE6mJgdreAqBJ7G9HDx0FYbyAtuQCQ+niVvrBBIWEFg=; b=OMWvxM/pD3/akRNGUfHhXIjeSd35En9SK1gQdzEGXajoYp/Q713RjwAR3+a11sSnlCInv7OKuaRuYMuICg4kJT0Frb9PBZfxZo9Rq2y4ttCLhinIDznIvuHtF1dfbGdCt4GnulidLu9Q4tM1J9rOvWfvqu0Ho/Q8s94I/hW5vvn6e5lbb8X6Ch7DwG8geNi/tgHIjeyrVtl/ZFO6PYrGJjuXOawmPBd3VC/kaRLLrI7iAKhwN6WqNmplBNmeTJk9GnrrE2BZGufAM2TGUvXaTICwefKq3jPofi42dTE1griigsaZAZAt3l6zKNmpItQ298DPqJj/Kj/OjWrTbp3pkw== 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=RE6mJgdreAqBJ7G9HDx0FYbyAtuQCQ+niVvrBBIWEFg=; b=Ir4hxU/ZA1P6x2D4o4q3YjCXZD2pG9lAqIRcPhTYob8JpdCyOhoC+pUQuPsXnwfEWdbkQhZcEYYgA0VTeMd+lYoKpK8V6rBAdOTb0w9mWsg/SsVNa95Ccb8/yIfMbnpKvoBa6FxhN8DtKSqp6eIZ9vmaWmCocpM6iduSyDwn2VI= Received: from SA0PR12MB4430.namprd12.prod.outlook.com (2603:10b6:806:70::20) by SN6PR12MB2782.namprd12.prod.outlook.com (2603:10b6:805:73::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4394.19; Fri, 13 Aug 2021 06:32:08 +0000 Received: from SA0PR12MB4430.namprd12.prod.outlook.com ([fe80::e828:5445:a5aa:94cb]) by SA0PR12MB4430.namprd12.prod.outlook.com ([fe80::e828:5445:a5aa:94cb%5]) with mapi id 15.20.4415.019; Fri, 13 Aug 2021 06:32:08 +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 v6 08/13] mm: call pgmap->ops->page_free for DEVICE_GENERIC pages Date: Fri, 13 Aug 2021 01:31:45 -0500 Message-Id: <20210813063150.2938-9-alex.sierra@amd.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210813063150.2938-1-alex.sierra@amd.com> References: <20210813063150.2938-1-alex.sierra@amd.com> X-ClientProxiedBy: SN7PR18CA0026.namprd18.prod.outlook.com (2603:10b6:806:f3::18) 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 SN7PR18CA0026.namprd18.prod.outlook.com (2603:10b6:806:f3::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4415.17 via Frontend Transport; Fri, 13 Aug 2021 06:32:08 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: cd334d1e-b834-4780-a3ff-08d95e24133c X-MS-TrafficTypeDiagnostic: SN6PR12MB2782: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:418; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: PKU0bvNWpJkLhsNkHyJmKznyMGnQ62vTJ0iroZLuLQD465s0MdCoobltvE4NrH6/l3fXBevUM6eEDbPH1DxRbs1APIwmk5YfI8C49NOvRQfP+TJpP+YNMiYJvfgP77rUniAFKdffV1DJpjlMf8OE37dlOfs2tjgiqD68oxkUL9HyW2VzN4E01jIZHRqgU4I4vLfwQVUP9GuP8f20a2kfsaMDRySxTjMImTuqg0SmYTmeVRlTHN/xSYMu56RguB4qLiIghWP8Wp5fzXAkOQnQ9zqkh7haPUluyHpqwDnzdBbVxdqIDx0BnuJuZjiVIFlhpAfx03FR3LM0APiJ5cAHt3wb5MX5rhuc81UepW+INEoQyNHNTjKPMp15ioLFe1yipRJ2gid7psZFTcuZLFr2yqm46h56MLZf853NYizJMDjcZAJfrDxz9AqXWXAR0Paf+NzzeVBV7VJVPBScSGOw3w0Vlhd8JNra6yvNBskIp8v2Ng/NvHNfkRkOMfEvMeozIVMH/NehSD87KTAiiFmAjpbkTJGshYaYiAM4bMSrbXK4fTHyyur2u+GGqYfFmll9ZUyefO7eFvjtFhqPTCCAOpx+BV2mPmc21GJ5T7mX85OsyrtqR4EwQvF8eKU90B9nHfBd6TxJy3vMJgyrmm41XefwtS0Ru9z29l77l2QXfDqqP3hDoKYIFfmrUKTgN/IciPVa1x3FtYMCWebPrGRvYYm0bBGtmlHRxVQdrxF/70Y= 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)(376002)(346002)(396003)(39860400002)(136003)(316002)(2616005)(956004)(7416002)(38350700002)(7696005)(38100700002)(66946007)(66556008)(4326008)(52116002)(36756003)(6666004)(66476007)(1076003)(8936002)(5660300002)(83380400001)(44832011)(4744005)(2906002)(478600001)(26005)(6486002)(186003)(8676002)(86362001)(41533002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: ZP7Mx7e9/+1mig0T1gYlMuLmIj/K85kvZOWGa78QYuz2yFnBOnlZ+80LN78ggjlak7mEWvlcG6jsNNbbciEjYk/1NUduwm/plJUEgK9r+plY2PrYAweoTDeCKXPPwSWXEzrvmO8YPoDlkHXXle9QzkR1+CLQ52V/entSwUxJQywIC/mlVwDYBPknODl7LFpoRa6Vt50U1pY6pcwcOzA/5sHFu9RE2g5Howh5xsvAGmFtjP1E/rU5pcK/5ZfAXL8gbtd0X5OD+X3JM6N6jYCc6f4OzdYsJnzDPJnwpBS58j4QM9z9vESdrgsdtdceP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-b834-4780-a3ff-08d95e24133c X-MS-Exchange-CrossTenant-AuthSource: SA0PR12MB4430.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Aug 2021 06:32:08.5619 (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: 35V4+9lyfgFCXmZcLDw5FEYU82/srf5qdcaPailVw++3HaqT2Q+uHWvF1P9Qf4bEQ9aGRvDzk3bOU/+lE5zvAQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN6PR12MB2782 X-Rspamd-Queue-Id: 626AEF0011FB Authentication-Results: imf17.hostedemail.com; dkim=pass header.d=amd.com header.s=selector1 header.b="Ir4hxU/Z"; dmarc=pass (policy=quarantine) header.from=amd.com; spf=pass (imf17.hostedemail.com: domain of Alex.Sierra@amd.com designates 40.107.220.87 as permitted sender) smtp.mailfrom=Alex.Sierra@amd.com X-Rspamd-Server: rspam04 X-Stat-Signature: c1zoigc5jnscqiyr8tki7xs73tdfz7pa X-HE-Tag: 1628836330-393051 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: Add MEMORY_DEVICE_GENERIC case to free_zone_device_page callback. Device generic type memory case is now able to free its pages properly. Signed-off-by: Alex Sierra --- mm/memremap.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/mm/memremap.c b/mm/memremap.c index 5aa8163fd948..5773e15b6ac9 100644 --- a/mm/memremap.c +++ b/mm/memremap.c @@ -459,7 +459,7 @@ struct dev_pagemap *get_dev_pagemap(unsigned long pfn, EXPORT_SYMBOL_GPL(get_dev_pagemap); #ifdef CONFIG_DEV_PAGEMAP_OPS -static void free_device_private_page(struct page *page) +static void free_device_page(struct page *page) { __ClearPageWaiters(page); @@ -498,7 +498,8 @@ void free_zone_device_page(struct page *page) wake_up_var(&page->_refcount); return; case MEMORY_DEVICE_PRIVATE: - free_device_private_page(page); + case MEMORY_DEVICE_GENERIC: + free_device_page(page); return; default: return;