From patchwork Fri Nov 22 01:40:21 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alistair Popple X-Patchwork-Id: 13882563 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 D0A07E65D10 for ; Fri, 22 Nov 2024 01:41:17 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 30BFE6B007B; Thu, 21 Nov 2024 20:41:17 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 2BB6A6B0083; Thu, 21 Nov 2024 20:41:17 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 10E816B0085; Thu, 21 Nov 2024 20:41:17 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id DE4FC6B007B for ; Thu, 21 Nov 2024 20:41:16 -0500 (EST) Received: from smtpin05.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 23EE6C1638 for ; Fri, 22 Nov 2024 01:41:16 +0000 (UTC) X-FDA: 82812026892.05.28D6176 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2073.outbound.protection.outlook.com [40.107.244.73]) by imf02.hostedemail.com (Postfix) with ESMTP id 2478180004 for ; Fri, 22 Nov 2024 01:39:31 +0000 (UTC) Authentication-Results: imf02.hostedemail.com; dkim=pass header.d=Nvidia.com header.s=selector2 header.b=rlhkFlvo; arc=pass ("microsoft.com:s=arcselector10001:i=1"); spf=pass (imf02.hostedemail.com: domain of apopple@nvidia.com designates 40.107.244.73 as permitted sender) smtp.mailfrom=apopple@nvidia.com; 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=1732239611; 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=hGyh0Mw+93+6MNfKJ7ksLUyrIRLTr9DxHq0U0ocX6Z8=; b=Xnf7LoCCCLTEv9wS+zPK+MXeEXZzKZXW17U9ZU/tspGf+d3chWUxflOtPtVLDCBMlSJ3qY IXgx4TobJsrHxgV13eJ5Ht8OPCxqCWmE7tIfAG7uL4nW5R8IA/AzgvKnFVUVfMHJRIIjY2 F8u1iNXnfyCCHUWEu0rgnJsGu47ZELc= ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1732239611; a=rsa-sha256; cv=pass; b=wzabGWLtyzvT0WYE964d8x1Cha5+YZtrS7/WKkg4OAwDJT689+0Sn6NedCwNMZUCHOBHwj 4MZqti6y/7C196N3eekDAOLUqY4Ndi1ZwmI9JUG9AFzlk1GOJ0w3TcHm16Ag3kFp9wvTm7 SfDsx4gf7bQHhoeosPsMWE77AFggFjc= ARC-Authentication-Results: i=2; imf02.hostedemail.com; dkim=pass header.d=Nvidia.com header.s=selector2 header.b=rlhkFlvo; arc=pass ("microsoft.com:s=arcselector10001:i=1"); spf=pass (imf02.hostedemail.com: domain of apopple@nvidia.com designates 40.107.244.73 as permitted sender) smtp.mailfrom=apopple@nvidia.com; dmarc=pass (policy=reject) header.from=nvidia.com ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=L6uQxg7uycdxE1U8holbM2RlRnnvmisxJnBdZPZL4yzBxDosX8xDPARt4yO9WXHZsxLPcW2dh/orVscYrWqKlEkFVxubz3qj4+T/9V1S/IX0rMhgyE8GfKONeaBXOt4EKf7pCsLF+u99cG8VfMqkdQ88BNF2gkGWUNrcOIsMXuZxTqFyBYTjKakE8e0DLjZRB3FE5QZ8pGtmDNcRQjDiPvFz+KXTzgS9adHREuBWrR6oTFpHxiYrl02CEVY21OAsna325+KGjmA9QIGu4tj7AR/9lwS7yg7Ou+uwz84QkL650m6+TSEfmbvHbMQN6fhXGtepof72UBXI03xFsJILpQ== 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=hGyh0Mw+93+6MNfKJ7ksLUyrIRLTr9DxHq0U0ocX6Z8=; b=o7QXDEZkmpi/41icED1wGO3S9ThQZo+qzTtdtmemoVfDw45n2EmENcsQjWq9w6xAUhS9njuXYV8fFj6snjz3oDNX+EzPxXAaCPNPwlDNcfVQNkq1wKqeCArMOO3T4YKhUDBpHEoOCA66miSs3dWbDzLpZltVe1eyTojF0p7JHlabSuYKfM3m3p+Hvd2U+Z6vx690VW5m85Re/sAywRWovg8KF4G/LIIJlJqVCktDoQV/YNUwFzaD9qDOWKAA9FkYFzR6rvPvQQsS8vD6jzm3ZlOcQ4xmPRMmutm6SQ5naBtEcMso7afnXUJeeSv/ZlSx9xWRiWW136bAO8wFBM15/A== 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=hGyh0Mw+93+6MNfKJ7ksLUyrIRLTr9DxHq0U0ocX6Z8=; b=rlhkFlvoa5mDlbq4xiRI1k7uE4OppAiYKwDNasR6yB+sDfJAjsrpv/NlckDci9pKIHEnj9GgCIBhqbY9jQ+gzpqqWmiHHCHHMUbtN8SrUgviqOF/h0nUAYOkRoIvEcQEpc4wXH32Ewp5gbRYQQW0B549jsXyzX/YbzvrbpQUA/62ca+TcYtnzES6TZBNim3v+FMeeUUNGmX7prTpgWmEuRYT6r959zdavjfFSIIOjJXaiV1lYtfbnFyUthWbQpSvAzNdD+p4HoGRsjxyWq1sK6Z/rQiYWUuvCrdvDVDIYbVlJB/VBK6InzxL2S3d0OwyBa83GIynryrBlgD2fSfVbg== Received: from DS0PR12MB7726.namprd12.prod.outlook.com (2603:10b6:8:130::6) by IA1PR12MB6305.namprd12.prod.outlook.com (2603:10b6:208:3e7::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8182.17; Fri, 22 Nov 2024 01:41:08 +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.8182.016; Fri, 22 Nov 2024 01:41:06 +0000 From: Alistair Popple To: 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 v3 00/25] fs/dax: Fix ZONE_DEVICE page reference counts Date: Fri, 22 Nov 2024 12:40:21 +1100 Message-ID: X-Mailer: git-send-email 2.45.2 X-ClientProxiedBy: SY5P300CA0059.AUSP300.PROD.OUTLOOK.COM (2603:10c6:10:1fe::19) To CY8PR12MB7705.namprd12.prod.outlook.com (2603:10b6:930:84::9) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS0PR12MB7726:EE_|IA1PR12MB6305:EE_ X-MS-Office365-Filtering-Correlation-Id: 0e38bec2-b049-4ca3-a5f9-08dd0a96bb86 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|366016|7416014|376014|7053199007; X-Microsoft-Antispam-Message-Info: Ms9xSKHhDcUIi0VHQpC0nt3BpZVvFWC33OLYNo9wFua6r09bV/GAH3Mw51YhZLdioLoDYOJJpB1EKQqOvbX0qp+H1Kvv2YObpA6lmcUyfkOV2WlyJHJI72AR/KfCTZWTBBKXsCoJTHIT4bumK5jIIpzHqfpo11oFT3eAf9BueHBpiRuFbob9IHv3bPojm5rxb+/e/1gVJnZMrgl8lwur3/qtHtlCpGlzcOqzeHpYPCVGa5n48Pu6Bx5YpWpL9xGHZPEv1Cfc7iIrQaCLPNJhgPsYw22lxQMRUVnBW5QZOY+BsCHj+qeBjvObPJc+blRJJ3Ff4BnOW1/b7jMAiWeIj/YeU+YzbDCh1e2L4hUy/dsExfa17/rhCEHGyHC+PWXtLa0x/nNMDD/0A179Wm94Xq4jAk90eWcyzvbhRNbOBEA++lm4XHMVYaegO4XFqrEIyWnVh9vZpfEL2mj5k13GQc9CFi0+gXUDc0eTdYKn+/8AsUiXfMzYXE2ZkUFuLple7PvHqrTTy6oBoCjOl5zLbijLnb8RmTLpY+0+n6ad81YZLma3nUxFj1Ckk6CO3PKcZtuHhQTCGqEEDWnELXmINdiFQh3gLX2H1Rmy2D6AI7cFJHCJlU3FoJlrkVprPiu6p/bw6koZnp3ZHARtl8Ra13sH+XWuvXJBQA0m3dUwAhtPNTmApnduruJ2/yNJ9zs4iwvypfkF2fZQ2jVluqclU4tzfjzc7B/do8rIMTMtWS1CbXEjtgKjJyEB5PIM26dN1MHMxXALqTyt6XHq0PuXupxB5IGcO74guXtaA5hT8Dr8KZPvyIYQWOkSEenPKhEwyX5Vg+D6+IFy0dbRN2tqGKYbNFCglQTVSimqvCzirhL7jORx/x9XN55OFaoiYXD0JN6GnMG+vhue/nQCto9XnHmSC4h4nfn7Rl6xO48+mBT5JZmz/+D1Ab/jFLn19+Fq0oUklZT2I7Y6l+0KJwKa243ePKmgKBBBnmOpB9SfyZUTOi9GH5/TZLVfIIwM1p/yl4HNMYNe8nay7A1UR+OJuMHlmg2eX6xbj+Hq5kAwIqHxpfXmgKqpa74LWcpK2wboqeDQSywB9D3LVuk+jC2/6rTy9WsJ3QIw+E75pV1GiasI3IBIrNiJPWgbMNvywFnoQfEaXPc0bC6WKha5ka5vWx8plO4/1yuKni/jPxR5bS8jyt3BB9RrjkDuN0c28BiB2lO4pnWq4wC5QwjtCU9Sb2yuJCN1Vf3og1+KAe4YViXv3Epy+vbvtkqmqsdoY3yxbBp235+gMgFlmlHW3HQWbbuHTRg7jz71JbJCrEwI4zg44MFGb/G+7d7lOpaF6GkX 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)(1800799024)(366016)(7416014)(376014)(7053199007);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: S2blqFmKDSdwQbaALuPCHjcwe0IAqDAuxcq0gqCCSUJVhmqTuKbJgV/qfIbIBHlA4ng98IbOJ1zmq84bfdS1wGIocbT+fACeNYHTQa6Yd82yioUYEqZbzO0aqsKD8z7KS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4nK4v/VsYammTf5HwAJLVHfsGwiuzrp64a4Z204pQkzVQxGXpgwEoSyx2zIt8hXRSx0VoHgJYvFkCNG+BdIjd1QCgOcTkKVsEyBhynu65C+rhGFDo9AVpWdy1T4RCghoTxeJFUxk3EhDgssV5l/isxmNIPVGxCWUBaK5CCKb6Ot5ZAPMRYVbbKppAlCD68FPlf0z9He2OQwNCaS5qA+H3uutYdtJtRHtRZq5sXvt3OZ9zloe6TeNIbvcUelR8pXDlrj6EFY4DnMeW2fvWpPLHVu7RBJ5g548gC+DC6CtKbk08aYwK10gcD0uhPxhmZ9r3YWmEUK64LJWO6yj20iWhimc+bvgQHfuxx7O8LuFcpYsOBZouJeYOoKpe X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-Network-Message-Id: 0e38bec2-b049-4ca3-a5f9-08dd0a96bb86 X-MS-Exchange-CrossTenant-AuthSource: CY8PR12MB7705.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Nov 2024 01:41:06.7367 (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: saQ4sDPFbjlq6d9ct0mZYgV7KCZsAi5ukzL1eqxH/EH7DwE+ejFckg92c6iZz2QkLvhybTfo2OqCq/eY//wuSA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: IA1PR12MB6305 X-Stat-Signature: caokzhgqcik583am4zafnecob7hqsxdd X-Rspam-User: X-Rspamd-Queue-Id: 2478180004 X-Rspamd-Server: rspam02 X-HE-Tag: 1732239571-486513 X-HE-Meta: U2FsdGVkX19n8raEqjvsAZbbLEb0lHOUljKWuuDsWaBf/4HY8qtMSmzP0CRpcvZEManq8k5IPM9A+zM3aVnCfiuNxBfHtua7zJKs41vZl62YCkF1ZJ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fLVsy8y9cg49VXJT4yOkC9DE70VBcuvfbrvnKmZrcwx9EKxMdt7Y/HXUBbad47ArCRq2rR9Il00qTSEt3/zZSwyoXx6Q1WnYNA5yUC/WNhgD2V+4z4Q5toShIGXqUMedknVFcXv7pkBDYaM76kI/ktSFDlJvyImlwap7p0S1PNC9AMGv8QJgc+U26gaQnMUmllBhwfJF273WlrGWdyDhdKLNcprCmrjqY+07Y6pvYi1DkcUXZ5KJtyYcOe9h2dZ3/h8CioyhGThXPgkPqxYNTq/4aGf9Vqky3Jf3lavN8PiHFp3no5TLXaQLMCekYpw7YCHzSMxSILkO1QzIeJ7xurvW5rWh4Hfvu0tdvUM2O1oMxdIPTNBCX9aJJnrsTXnynvSj4fDVziI+IELa2FQblc/ow3yGPyu+kbpUQR/yKkRFW8qVrG7zih239EWsjYxHHlZ/OR2HBhGbEDgfwFr9oTlVGXzIOT0fJw/pn2iUHi/4TdpclDNodQBB3skDRCark4JxeL6a4WNGxy5vmY+x7KuZrF4xf4vv6SDuDVGHQ/iAKZKl+9asEYskeRIry+2cjW6ENYzXMlk3UecOVXXWjNnXdP8H3/OhEAodocIxD+S62Wp7rMxlzGl1cZ5Cxdryi7T9M0FsE2BHm8Hy7qQpp6JEhxsUHUxHNgNTQc6OX95L/ob1DaXyEDYX7D9+44r4/pDcqu13f0bNGYKc8GgH4VYXNGZQVc+soeFtRkqt8duZyjuTDnnYKDEqeDNNjxjZHBFZPgLI1yVrSUB4TxakbocIOZdkISP+ufiyyJILE3 ZOihtFd1 IP0Ud4QK++g/aNotRo1aSYjYTTKqhE9zcp6NWGPYEyjTrhQPZmqal+tR34ETA3LAsCM+6n0bql3fJGynXxMpaaNa2O8obGvdPcOVthmxSoxMSFAk1BBucA== 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 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 pci/p2pdma: Don't initialise page refcount to one 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() huge_memory: Allow mappings of PUD sized pages huge_memory: Allow mappings of PMD sized pages 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 memcontrol-v1: 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 | 354 ++++++++++++++----- 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 | 23 +- 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 | 8 +- 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/mapping_dirty_helpers.c | 4 +- mm/memcontrol-v1.c | 2 +- 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 | 8 +- mm/pgtable-generic.c | 7 +- mm/rmap.c | 49 +++- mm/swap.c | 2 +- mm/truncate.c | 12 +- mm/userfaultfd.c | 5 +- mm/vmscan.c | 5 +- 70 files changed, 886 insertions(+), 920 deletions(-) base-commit: 81983758430957d9a5cb3333fe324fd70cf63e7e