From patchwork Thu Jun 17 15:17:05 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: 12328187 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=unavailable 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 A92F7C49EA6 for ; Thu, 17 Jun 2021 15:18:41 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 45477610A2 for ; Thu, 17 Jun 2021 15:18:41 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 45477610A2 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 DD9886B0081; Thu, 17 Jun 2021 11:18:40 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id DB1286B0082; Thu, 17 Jun 2021 11:18:40 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C050D6B0083; Thu, 17 Jun 2021 11:18:40 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0183.hostedemail.com [216.40.44.183]) by kanga.kvack.org (Postfix) with ESMTP id 8CF106B0081 for ; Thu, 17 Jun 2021 11:18:40 -0400 (EDT) Received: from smtpin16.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 35AD0824C723 for ; Thu, 17 Jun 2021 15:18:40 +0000 (UTC) X-FDA: 78263572800.16.90CD2A4 Received: from NAM10-DM6-obe.outbound.protection.outlook.com (mail-dm6nam10on2086.outbound.protection.outlook.com [40.107.93.86]) by imf11.hostedemail.com (Postfix) with ESMTP id 5404820010AC for ; Thu, 17 Jun 2021 15:18:26 +0000 (UTC) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Su5TomvLxZ1fLt3A8OEwwaWMJJSMx3V3isNQJOtCk7a0CYu9yzZFDTGjjnjgff8yhbOmMPhCr4hCc+1wbbJRr9B5loZxhXUTcU0IUiQiJDMMlu7Gn9ukDMOjMbFwOr4KTB9cIXqtwK5ZBmGViLApZEC8gD7vgYCogRwrRUcvbBgcx7VlL6xs+PfHTJyH6mBhcrjxsjcZVcZStHshLB0pxamIJOInP/sRt5jrXW5KF/Se4uXB+TOhZ2KW1EmFd3IzJPhVc/THfkaSWgferFyerQMtt3Vaj5HZfEyorWapruGmk2bUKjs6UAxoE6clRkyM5M2oDjooOLE/jLpKBLXe+w== 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=fto7oGTXuEchER0GieOzKEfkpiqMw64yv0w2SD6NgAs=; b=lGp6Xo2+rlxjzhL2DQOxUhcYiSnr7iFnekeiPDJ0jjz8a+fam4zSOhtEP0mLfmJmaLNPJMv7YTypQBigejbm3SjU/9ph7q1ODFETa98Ch+oGuE4ALPd+hP69TREtFCM8fzy7kdydtzELc3TYzGM15z00W6REzSDPXa8UKOnYePeml6U10UQxG6/ak+SHlmOkyCJL5peU3SZwNRAhHb9H0Z7g/fh0CyTdkhoT9/Lk6t1+VshW0OQ8JuM5mUSpyZwIDNN8zznkj4IFSJuuOrnvfUnQZyjaCW26BptmmwuT7xhXjOnr4DB1bWT1wjn3I/0D90YEQC3BalCbE3iTm2PmbQ== 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=fto7oGTXuEchER0GieOzKEfkpiqMw64yv0w2SD6NgAs=; b=44IyS0h62j/MsTf/k2bizWLW6/XW6Z+BO5f/xxU5m4yH6BGWlHXgA3hVLMSH5Iwn/22BSHRp5K7z+upKLMFELpgZOd2VuQlwFNSuDiJY+qRn6JjDcrqSuMElzZcJvTBC7d7t0mo7du0MwfQOUmAvGEOGjbZo2yybQzG9Gj0GoU0= 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:38 +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:38 +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 8/8] mm: call pgmap->ops->page_free for DEVICE_GENERIC pages Date: Thu, 17 Jun 2021 10:17:05 -0500 Message-Id: <20210617151705.15367-9-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:36 +0000 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 9c3e5518-b32c-4da1-8587-08d931a32e68 X-MS-TrafficTypeDiagnostic: DM6PR12MB4419: X-MS-Exchange-Transport-Forked: True X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:418; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: prbdEARtjiVwmpoU2ubspx8qA1E4h+bBUheQ66S0xDTjsQeXg5IGKoC3W97gZyYtlQ+LDvuVRaavXsVHxx5gEUKtl6d5IDlWHXsuqrcUXPNVZQPmzpinQdLdqTUY3u3WTK//aVrJ1pFyrFvLu3QNt6kmJ1tJNvDl0iImuN+E603YAgfgYEhS12Hm5eDNlCmSWBrl1gayDlUbYmXanLYdiobg/QwWSPKgyrlKXr/d7zxJ18RDhJz2kejcRr3K4IGhVnvifS4NpyecyNFbXGFskruWnproGBCeh9qGvdXVWn6AOkNR+ZnvGW3SN3oQ9WmyelRyy8CDJ0rR5IHabCr3/QdE7Lpk0KvogMjxyfPdHm+Pr3EP2G081ST9SIRjqH9mCX9ANH6JJVu+5MYbJpqW9fLU6bcI93PYYnkUJKNgrozDRalfB7VsebD+4cgstrNRxa3g195+enCN8yuGWPdO6O/UZwHOSfnwGmvNU8ex8tWpUo8XY2zLe4vofJwAlBDW8RqinlHzP5oCl2851itSRUZslFbWvZzEP2d5dun3FeQPUKP+tvMpvtJS5ArV+Y2mCfWCJ8E1PqDyl+7LVztoHksgqonTlRE2rg18Wvm5O/f5WjEdgVvvDHKPgsCrH0nv1JlggOamd9MCOZ1R6BlmsJ2a6dzLmCZHXYcpt20QhgFPl5yeogjUpL7YhZBT97F5 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)(4744005)(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: AEnLH+l5spL7tf/v6XRUU1tH8GsTIZl5pgLfUQvW/NYQ0vVBAr4BvBUUtiPTpTxR9HU/savzt+OKVsbMpfGEExyGeq9RI+Tvg6vqypAfcwYku3/mWuNbpX5nTcBSoNepMzJc3p//fNXWF4jAdtnVrlkJcGGOwwrMtWIp6ey+l+7IaGJJR9muOOeElLQtoLVP3AStoFs3nzKvM0EG4TLgMQBp2Uagwef0pO4BgS0owulkRnljlrlwPFpHmILxXC9uzAiHuYFk57q/7eZoQsZrtObflamWrTDQIbYJfbb5HxEJIrtgQxXUSvOZm5IljhI7HQ2rjkmAeIGlAHQBy/akQCdi8gsNof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CrossTenant-AuthSource: DM6PR12MB4419.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Jun 2021 15:18:38.1361 (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: 9XEHR6JOUXkYDVCoTv94a7lxLWnsQfXyFrojKHWuYblJ+gCMpVURrYWdox/aiC+OgeGyhWWDGqqLATCMR1hhSg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB4419 Authentication-Results: imf11.hostedemail.com; dkim=pass header.d=amd.com header.s=selector1 header.b=44IyS0h6; dmarc=pass (policy=quarantine) header.from=amd.com; spf=pass (imf11.hostedemail.com: domain of Alex.Sierra@amd.com designates 40.107.93.86 as permitted sender) smtp.mailfrom=Alex.Sierra@amd.com X-Rspamd-Server: rspam02 X-Stat-Signature: dnzje97uuube3uc8yy5ejuzzafwz91ko X-Rspamd-Queue-Id: 5404820010AC X-HE-Tag: 1623943106-784876 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 614b3d600e95..6c884e2542a9 100644 --- a/mm/memremap.c +++ b/mm/memremap.c @@ -438,7 +438,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); @@ -477,7 +477,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;