From patchwork Tue Dec 17 05:12:43 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alistair Popple X-Patchwork-Id: 13910979 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2F5D8E7716A for ; Tue, 17 Dec 2024 05:13:34 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 70A546B007B; Tue, 17 Dec 2024 00:13:33 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 6BAB86B0082; Tue, 17 Dec 2024 00:13:33 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 50D8E6B0083; Tue, 17 Dec 2024 00:13:33 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id 2DD006B007B for ; Tue, 17 Dec 2024 00:13:33 -0500 (EST) Received: from smtpin14.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id A8A44160482 for ; Tue, 17 Dec 2024 05:13:32 +0000 (UTC) X-FDA: 82903282812.14.B317C52 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2046.outbound.protection.outlook.com [40.107.223.46]) by imf16.hostedemail.com (Postfix) with ESMTP id 17811180004 for ; Tue, 17 Dec 2024 05:12:58 +0000 (UTC) Authentication-Results: imf16.hostedemail.com; dkim=pass header.d=Nvidia.com header.s=selector2 header.b=h0JYA8Vf; spf=pass (imf16.hostedemail.com: domain of apopple@nvidia.com designates 40.107.223.46 as permitted sender) smtp.mailfrom=apopple@nvidia.com; arc=pass ("microsoft.com:s=arcselector10001:i=1"); dmarc=pass (policy=reject) header.from=nvidia.com ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1734412387; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:in-reply-to: references:dkim-signature; bh=/3ctEhFLYPJl0ejLmEqc8V83PAPjatQzcHAuasxJTOs=; b=dY+jTNTefEPBVBXxIqMaFjcmY0N2oIW6xpNio7b5z9hghdl/RwsR225Xqd1PLluTijLX0F 0ZIEVRa+K6VxMrFfdLgtEXHZ2s8n8l6JwEImOP5H7UmcABkq4fuFiNhPahenXKxgdHeqKJ x+lCD2n8j2mL3/FgKtmOdh9mtoKzTg0= ARC-Authentication-Results: i=2; imf16.hostedemail.com; dkim=pass header.d=Nvidia.com header.s=selector2 header.b=h0JYA8Vf; spf=pass (imf16.hostedemail.com: domain of apopple@nvidia.com designates 40.107.223.46 as permitted sender) smtp.mailfrom=apopple@nvidia.com; arc=pass ("microsoft.com:s=arcselector10001:i=1"); dmarc=pass (policy=reject) header.from=nvidia.com ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1734412387; a=rsa-sha256; cv=pass; b=D/o4rTcEFJl+XwfoZwnsYMCdYj6X/eQqB53ap4Qe85NQuY1i2cjQCw4oG9/J5xiX/jy/3Q k6AtY+ftaXdxhbNlfnAZHLLV78sN20vb68KZ1IyLnnrbyS4DGMBX+vLDZ9hAupr+XQyESx plnZoMHczEOlaVvCofwE85Gvhcu++OI= ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=CArsXbOti08qmUdHoY0OUL4Q6v1KVTHTfAbytnrTtwo9xPSoXz28AcLctTDUee5mPM8Z4bXcnkX8BKUoREozzX8jW4c/rPQHry5rpvcOhJR8Aa0shIwghlNoX07L1IIgtBqMuVUQie7+UiClS0kIK/eEo/gEGYkM3bPM0dGCZtKQByLoWT6CUbbSbAnt3ZMHYrNyI6TGfnYYvcR2z0AJiKFg+HZoepuevZKfTY15AghQ7kK5W4ZvZQaIc+Z3mzU5H6idweLUIiv2abYW+lXF9DhcELo+MBR/+ndhts5w+emz6bK79dVPBkovUr3EwLjqEXQluJpMu1tZ5cUcKc3Fhw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=/3ctEhFLYPJl0ejLmEqc8V83PAPjatQzcHAuasxJTOs=; b=GnntueXJykTuCndgQ4hvSceNfg8FnSEcvxJ4EksR/+5H5GSjR3rPglFWt4b3vqGgGOYZjcLD7dU3i97ZMvIkBPbe1wINm21/W1frWj37zrBWd4J/2dOsWdQQ/uS7pOyfL2aWxQ9D0WzLUO1Eki4c1FmLNSM+WnNGrRCr0nCPuptoMpKj1BQ8pkGIbQn6UbmHNJFX/pWr22eGgxrYUwFOC78lbRY1zS8qgZYxECYNW2belm0uCR5z+51MofaJVLJGFXGrWjGjMxwDSI+IFUmsM1r+S06ZFC/icTk9gJ+7Q/7K3CYf0AOBaurvWnUELUS9X05ZK1yYCnAX/D7zYml0lg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nvidia.com; dmarc=pass action=none header.from=nvidia.com; dkim=pass header.d=nvidia.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=/3ctEhFLYPJl0ejLmEqc8V83PAPjatQzcHAuasxJTOs=; b=h0JYA8VfymDmeDxaOPAj+rkxzQxjkw98IN58buwihm8ccL+LY/zj7D/cUkO+MFT2mKh5a7zwbVwoEqLSIcevK4JoiDQ8oaOCDyCyZ8OHWwP7iDW+qfXdoMm9LEHZTv+Nmwy7k5DGScGRoXSpHidSq5NTmBPYZEyFdfZZduEn0IrgBtvUJ94UPOcZDV2YplmBA1LD/82h4zfmQXp6JTQTk+3tKnwifsNLAlMwlcCE+GP0NxZ2kACLUz0hswznrz1gBRsc2LJtjKZVxX4K3qFEnQyHc10wDADZMexZKzvOVLn68FMAGIm+ACGQanAQ9wN1Bn18ZdptFH7ykQLNDm3Bpg== Received: from DS0PR12MB7726.namprd12.prod.outlook.com (2603:10b6:8:130::6) by CH3PR12MB8936.namprd12.prod.outlook.com (2603:10b6:610:179::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8251.22; Tue, 17 Dec 2024 05:13:25 +0000 Received: from DS0PR12MB7726.namprd12.prod.outlook.com ([fe80::953f:2f80:90c5:67fe]) by DS0PR12MB7726.namprd12.prod.outlook.com ([fe80::953f:2f80:90c5:67fe%4]) with mapi id 15.20.8251.015; Tue, 17 Dec 2024 05:13:25 +0000 From: Alistair Popple To: akpm@linux-foundation.org, dan.j.williams@intel.com, linux-mm@kvack.org Cc: Alistair Popple , lina@asahilina.net, zhang.lyra@gmail.com, gerald.schaefer@linux.ibm.com, vishal.l.verma@intel.com, dave.jiang@intel.com, logang@deltatee.com, bhelgaas@google.com, jack@suse.cz, jgg@ziepe.ca, catalin.marinas@arm.com, will@kernel.org, mpe@ellerman.id.au, npiggin@gmail.com, dave.hansen@linux.intel.com, ira.weiny@intel.com, willy@infradead.org, djwong@kernel.org, tytso@mit.edu, linmiaohe@huawei.com, david@redhat.com, peterx@redhat.com, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, nvdimm@lists.linux.dev, linux-cxl@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-ext4@vger.kernel.org, linux-xfs@vger.kernel.org, jhubbard@nvidia.com, hch@lst.de, david@fromorbit.com Subject: [PATCH v4 00/25] fs/dax: Fix ZONE_DEVICE page reference counts Date: Tue, 17 Dec 2024 16:12:43 +1100 Message-ID: X-Mailer: git-send-email 2.45.2 X-ClientProxiedBy: SY6PR01CA0117.ausprd01.prod.outlook.com (2603:10c6:10:1b8::18) To DS0PR12MB7726.namprd12.prod.outlook.com (2603:10b6:8:130::6) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS0PR12MB7726:EE_|CH3PR12MB8936:EE_ X-MS-Office365-Filtering-Correlation-Id: 9a973c43-7f54-4223-3bf1-08dd1e598879 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|1800799024|7416014|366016; X-Microsoft-Antispam-Message-Info: Wpy5ZQ00jGuT5FToRPQvE5o3wjj0PFkPL4iNIwf/NVP432SkpdBgP37HNE9mkbo+Ae7AZIuPV3qIsfd5Z/GNhEYHsrAz5Qmzf9CYE38KT/Nn6aliiZCp/9HJjjBRlA+mjhSMGUf2Vw6CVBrt7b6ggQ63KItbgfNep3A7ChTkmIdGnYQGFR+UDPWRbf5IGnNB+s7LPLZW5QLpN3r+cp7A4uQd2m7PwGLtyki9PsI6vNdgXnNI/edY0wInG5VVsORQpk3emhTXfLCBfhzeCGpRv/r+AZXDAY+ewBc3tvAg1T8EBSeqVw6jDZGz/datoeAkLytOY2IkUHw4LX0NarvFrsEhOXofZgQdK6WNBclZmBtIcomGQoFvwLG9luiNINb1PXfodBkAQ2KylKNeM7UJ30YfXap3ctkjbFP+D3CuB2LdgG39rrT8dP0MyIJsAftUww3KZqzXqTyZ8GMWSzQlYmOJjjCcFZ+M6rNAzz0Hcvsg3G0XCAdV5KE+7nK39hqWQ4YC2uE62XClNxKKgHSyYEsE+pxvsEVja/FECv7LKehprXAbT0uU8TDGGvPm8Tc6Klk4f9MJexljj633sYswVrALFj2ez3LfG6jDamUiN7VxAS5r2VbXtVqatXf+0QcCewYTD9rXh9d1fcVG5eIW9jEmj2+81QbrmpKPfkJnwcE4a09LPSvr3oniFVu4rq+QA0YyKWTf/000RVUD7BoE8DYxtLI4jQyboMHyXDjtibk6I9i8TMreYcAkfF+07bllfT8eRS8AN3HfP77ddLKgNBSNsa2R2cwcHmGWPy8+D8k0xpcx6ypc+YbcjP4XA/hZxEjmdZDWb8sKiPj5vFOYDUIEvpww7lLSDpPjzHs1WJmmwTEfCRRoMYQih3DnLXXyv3S8LYJQ7zu342+04psHr4npteS2So2Cqfc8BgnSUD9lN78fZMQIrrVnmqsOuP++t9x5+j8sZndd8QMaGj2e7AcJRcbVr+6mUrwbkHMuGCYHS1i5Xbjv1h7fHz8fnpg6ITL+ypMT2rbxqseRbNKpeUFpUqPDUZ+5jT2BwsLUFZeDmn06ZzyYiYsL+v25Qp6Xe+YGcX6KJlNxPops0whNeL+lmFe0pL/ShO6LR1P4fh0XbIBXl6KUTqTjVccH2D2W+ln3ZIvABNmA3qHUOM2JnxX2+glBu3oX+IWO4uLiJmnZjBbOv9hbuMmO37LRF1AS7LYq/xh+sW2tJSOFUCjdVC9W8jtIqKFuOmdMOyBNS6JWeldxRJ82bAXdwYd2yUb1jKIw/uSrh7GgKPBbbZ5yGmn+nVdfxMjcOC0CJew+dr2parancdP3ALzy6NqleE4t/sdgbTxuB8Am6jMWnYayqYz2N94MSwg4eNq6f+pw+wW/00Q5NbTNyfhjFCUiA9Ac X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DS0PR12MB7726.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(376014)(1800799024)(7416014)(366016);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: k2l3I5o0dnrWYU7XfDzameO7P1AM/F7qWrlVlJW5uhEJ0ZWf0rztmC9X7QxVG0kiZ09+NeHRIvxJWAnkiD6xb2ZHO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ERCJMa4sH/nx4wNvoiE3K/o+ssIs7GKVoSf/t0PyzuN8/5R29XAVg527HSyswD+dQyMqG5Ph1B5RfGxVzpbVmzTTV8CydJPh4LEPM9qRHFvMXCDm64LRhPXPLRWRt9uncFBXT86Ymwb6hBoh//QnGmpVna85P5Xu7l2rCSBcB1IIiJNuQbRAyEBPBmCu6F/dUQgjZGtJFtOu9QmJgNeptVGXySnPPoEpNWH/t8UIHdJ7q89TI+whmpZxti3ex/+PQqYrcP/bHCTz2eNFJm+bPlcac1vHPLjIt/F9wqR7lDoysryjNRIAeaO8EjswOdaT05CwhzlxrEMpEiTm2jkHp7gMcSe/F0iBhae2EHlAJUXtwSAo8vw1H7W4AjYae5tAf+BDB5ujDOKFJEsxGGkgBVSx6FjetRVFOoBqGA2t X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9a973c43-7f54-4223-3bf1-08dd1e598879 X-MS-Exchange-CrossTenant-AuthSource: DS0PR12MB7726.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Dec 2024 05:13:25.0330 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: tGM3K2EakZl+6YtbryBHOVs8U0HvO+PYNw2bFb86RDEYwV7qotyHbvtGWNR6TP1UEKMM6QwlMgWdC/YQPyVHqg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH3PR12MB8936 X-Rspamd-Queue-Id: 17811180004 X-Rspamd-Server: rspam12 X-Stat-Signature: rcwiwph6dqk9mywq3tspdckucsh65kdf X-Rspam-User: X-HE-Tag: 1734412378-536986 X-HE-Meta: U2FsdGVkX1+S+yyx/sxetFtDIw3giO5LCDJ5q1tEVcqXp9tOc2OxjoO0GTJuoDowKL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1xbIxqoWWlqedFQ4v6X5dt208Yzl7CZ+AQLwRsMAB6IwUlbZrNMtlt3BBKJjJHCOKpJnyu2XnUkIRD0msewjmwZYTiFtKuvSy71mHvsPS0D0mRN6bH4cTQ/l3Yox/ALz5MkKQhM3q+5GVxlZVemRwTQh7mV9M0J/sqej0zYSs5BXoRrZ1jxxVeHxwTtJnq/vpBuj+iFPtS584Zd8kClCsUQzqynqdjWeOVku4PZj1oaNoBABsHrEodC6dEjVO6l8ufJ+YDZ55LUJ4yYHUWM92FN02LHPVQnY1IeO1ccAlhmkHZmde5wJfVA1FZRrPBo6x9iRHt0fxcplaPxO1zSh/7U3bhYmvxpqp1ZFWpUxyaIugpQ+0OBl2EeCGeYESsIoZaUjyhb3MuDN62tS4zBWtmWUtSH7bglXm5Zp83ReNSle3QXqFXKR6XOikIWUN75tHq08HdEpZnCRgwEOaqJI/Uk8krhAXcM+sFj3XgGpYV+CVsYz4Dl1uZbLEh3AsdrTSTh/sxz6NhXxYTU/k7CVIIq4ODADD4i1DowxGINESHNe7IDjusxUvg8FirJ/sDYOBc1AMruosAUkmAVPOlaAhH8F73XWgP0rbOZVey9N0Bh/23GwWuY+XNGgh0CXhelylMeScp2zhro/QomAeuH1hbJyheHjyweHcBEzu2/Kgo1SC/FX8zkLN6kwtUjfY4Lmnse/LzJjJAeiyl9+X2gG+eGXbutEtLSdUNckjG4UI4Arojxkn2M/qomDlirQovJVgF5yQSJTrdKU0yRedeCo8LecRQlqXJbeP/Iejet77w3NLGn 6oLYT4MX GLU4eOHKY+iePLLx7hqiUURwMLmKaWQWmXumEUxniPKTNi6jm67l5ALHUx87Km6ytb480tMnfO+ykAnpt++jrAC7LLs082YH02Q/ZcVYs3ecUVC0T36FPQ== 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: List-Subscribe: List-Unsubscribe: Main updates since v3: - Rebased onto next-20241216 - Fixed a bunch of build breakages reported by John Hubbard and the kernel test robot due to various combinations of CONFIG options. - Split the rmap changes into a separate patch as suggested by David H. - Reworded the description for the P2PDMA change. Main updates since v2: - Rename the DAX specific dax_insert_XXX functions to vmf_insert_XXX and have them pass the vmf struct. - Seperate out the device DAX changes. - Restore the page share mapping counting and associated warnings. - Rework truncate to require file-systems to have previously called dax_break_layout() to remove the address space mapping for a page. This found several bugs which are fixed by the first half of the series. The motivation for this was initially to allow the FS DAX page-cache mappings to hold a reference on the page. However that turned out to be a dead-end (see the comments on patch 21), but it found several bugs and I think overall it is an improvement so I have left it here. Device and FS DAX pages have always maintained their own page reference counts without following the normal rules for page reference counting. In particular pages are considered free when the refcount hits one rather than zero and refcounts are not added when mapping the page. Tracking this requires special PTE bits (PTE_DEVMAP) and a secondary mechanism for allowing GUP to hold references on the page (see get_dev_pagemap). However there doesn't seem to be any reason why FS DAX pages need their own reference counting scheme. By treating the refcounts on these pages the same way as normal pages we can remove a lot of special checks. In particular pXd_trans_huge() becomes the same as pXd_leaf(), although I haven't made that change here. It also frees up a valuable SW define PTE bit on architectures that have devmap PTE bits defined. It also almost certainly allows further clean-up of the devmap managed functions, but I have left that as a future improvment. It also enables support for compound ZONE_DEVICE pages which is one of my primary motivators for doing this work. Signed-off-by: Alistair Popple --- Cc: lina@asahilina.net Cc: zhang.lyra@gmail.com Cc: gerald.schaefer@linux.ibm.com Cc: dan.j.williams@intel.com Cc: vishal.l.verma@intel.com Cc: dave.jiang@intel.com Cc: logang@deltatee.com Cc: bhelgaas@google.com Cc: jack@suse.cz Cc: jgg@ziepe.ca Cc: catalin.marinas@arm.com Cc: will@kernel.org Cc: mpe@ellerman.id.au Cc: npiggin@gmail.com Cc: dave.hansen@linux.intel.com Cc: ira.weiny@intel.com Cc: willy@infradead.org Cc: djwong@kernel.org Cc: tytso@mit.edu Cc: linmiaohe@huawei.com Cc: david@redhat.com Cc: peterx@redhat.com Cc: linux-doc@vger.kernel.org Cc: linux-kernel@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org Cc: linuxppc-dev@lists.ozlabs.org Cc: nvdimm@lists.linux.dev Cc: linux-cxl@vger.kernel.org Cc: linux-fsdevel@vger.kernel.org Cc: linux-mm@kvack.org Cc: linux-ext4@vger.kernel.org Cc: linux-xfs@vger.kernel.org Cc: jhubbard@nvidia.com Cc: hch@lst.de Cc: david@fromorbit.com Alistair Popple (25): fuse: Fix dax truncate/punch_hole fault path fs/dax: Return unmapped busy pages from dax_layout_busy_page_range() fs/dax: Don't skip locked entries when scanning entries fs/dax: Refactor wait for dax idle page fs/dax: Create a common implementation to break DAX layouts fs/dax: Always remove DAX page-cache entries when breaking layouts fs/dax: Ensure all pages are idle prior to filesystem unmount fs/dax: Remove PAGE_MAPPING_DAX_SHARED mapping flag mm/gup.c: Remove redundant check for PCI P2PDMA page mm/mm_init: Move p2pdma page refcount initialisation to p2pdma mm: Allow compound zone device pages mm/memory: Enhance insert_page_into_pte_locked() to create writable mappings mm/memory: Add vmf_insert_page_mkwrite() rmap: Add support for PUD sized mappings to rmap huge_memory: Add vmf_insert_folio_pud() huge_memory: Add vmf_insert_folio_pmd() memremap: Add is_device_dax_page() and is_fsdax_page() helpers gup: Don't allow FOLL_LONGTERM pinning of FS DAX pages proc/task_mmu: Ignore ZONE_DEVICE pages mm/mlock: Skip ZONE_DEVICE PMDs during mlock fs/dax: Properly refcount fs dax pages device/dax: Properly refcount device dax pages when mapping mm: Remove pXX_devmap callers mm: Remove devmap related functions and page table bits Revert "riscv: mm: Add support for ZONE_DEVICE" Documentation/mm/arch_pgtable_helpers.rst | 6 +- arch/arm64/Kconfig | 1 +- arch/arm64/include/asm/pgtable-prot.h | 1 +- arch/arm64/include/asm/pgtable.h | 24 +- arch/powerpc/Kconfig | 1 +- arch/powerpc/include/asm/book3s/64/hash-4k.h | 6 +- arch/powerpc/include/asm/book3s/64/hash-64k.h | 7 +- arch/powerpc/include/asm/book3s/64/pgtable.h | 52 +--- arch/powerpc/include/asm/book3s/64/radix.h | 14 +- arch/powerpc/mm/book3s64/hash_pgtable.c | 3 +- arch/powerpc/mm/book3s64/pgtable.c | 8 +- arch/powerpc/mm/book3s64/radix_pgtable.c | 5 +- arch/powerpc/mm/pgtable.c | 2 +- arch/riscv/Kconfig | 1 +- arch/riscv/include/asm/pgtable-64.h | 20 +- arch/riscv/include/asm/pgtable-bits.h | 1 +- arch/riscv/include/asm/pgtable.h | 17 +- arch/x86/Kconfig | 1 +- arch/x86/include/asm/pgtable.h | 51 +--- arch/x86/include/asm/pgtable_types.h | 5 +- drivers/dax/device.c | 15 +- drivers/gpu/drm/nouveau/nouveau_dmem.c | 3 +- drivers/nvdimm/pmem.c | 4 +- drivers/pci/p2pdma.c | 19 +- fs/dax.c | 357 ++++++++++++++----- fs/ext4/inode.c | 43 +-- fs/fuse/dax.c | 35 +-- fs/fuse/virtio_fs.c | 3 +- fs/proc/task_mmu.c | 18 +- fs/userfaultfd.c | 2 +- fs/xfs/xfs_inode.c | 40 +- fs/xfs/xfs_inode.h | 3 +- fs/xfs/xfs_super.c | 18 +- include/linux/dax.h | 37 ++- include/linux/huge_mm.h | 22 +- include/linux/memremap.h | 28 +- include/linux/migrate.h | 4 +- include/linux/mm.h | 40 +-- include/linux/mm_types.h | 14 +- include/linux/mmzone.h | 12 +- include/linux/page-flags.h | 6 +- include/linux/pfn_t.h | 20 +- include/linux/pgtable.h | 21 +- include/linux/rmap.h | 15 +- lib/test_hmm.c | 3 +- mm/Kconfig | 4 +- mm/debug_vm_pgtable.c | 59 +--- mm/gup.c | 176 +--------- mm/hmm.c | 12 +- mm/huge_memory.c | 233 +++++++----- mm/internal.h | 2 +- mm/khugepaged.c | 2 +- mm/madvise.c | 8 +- mm/mapping_dirty_helpers.c | 4 +- mm/memory-failure.c | 6 +- mm/memory.c | 126 ++++--- mm/memremap.c | 59 +-- mm/migrate_device.c | 9 +- mm/mlock.c | 2 +- mm/mm_init.c | 23 +- mm/mprotect.c | 2 +- mm/mremap.c | 5 +- mm/page_vma_mapped.c | 5 +- mm/pagewalk.c | 14 +- mm/pgtable-generic.c | 7 +- mm/rmap.c | 56 +++- mm/swap.c | 2 +- mm/truncate.c | 16 +- mm/userfaultfd.c | 5 +- mm/vmscan.c | 5 +- 70 files changed, 922 insertions(+), 928 deletions(-) base-commit: e25c8d66f6786300b680866c0e0139981273feba