Thomas Gleixner | c942fdd | 2019-05-27 08:55:06 +0200 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0-or-later */ |
Jérôme Glisse | 133ff0e | 2017-09-08 16:11:23 -0700 | [diff] [blame] | 2 | /* |
| 3 | * Copyright 2013 Red Hat Inc. |
| 4 | * |
Jérôme Glisse | f813f21 | 2018-10-30 15:04:06 -0700 | [diff] [blame] | 5 | * Authors: Jérôme Glisse <jglisse@redhat.com> |
Jérôme Glisse | 133ff0e | 2017-09-08 16:11:23 -0700 | [diff] [blame] | 6 | */ |
| 7 | /* |
| 8 | * Heterogeneous Memory Management (HMM) |
| 9 | * |
Mike Rapoport | ad56b73 | 2018-03-21 21:22:47 +0200 | [diff] [blame] | 10 | * See Documentation/vm/hmm.rst for reasons and overview of what HMM is and it |
Jérôme Glisse | 133ff0e | 2017-09-08 16:11:23 -0700 | [diff] [blame] | 11 | * is for. Here we focus on the HMM API description, with some explanation of |
| 12 | * the underlying implementation. |
| 13 | * |
| 14 | * Short description: HMM provides a set of helpers to share a virtual address |
| 15 | * space between CPU and a device, so that the device can access any valid |
| 16 | * address of the process (while still obeying memory protection). HMM also |
| 17 | * provides helpers to migrate process memory to device memory, and back. Each |
| 18 | * set of functionality (address space mirroring, and migration to and from |
| 19 | * device memory) can be used independently of the other. |
| 20 | * |
| 21 | * |
| 22 | * HMM address space mirroring API: |
| 23 | * |
Ralph Campbell | 085ea25 | 2019-05-06 16:29:39 -0700 | [diff] [blame] | 24 | * Use HMM address space mirroring if you want to mirror a range of the CPU |
| 25 | * page tables of a process into a device page table. Here, "mirror" means "keep |
Jérôme Glisse | 133ff0e | 2017-09-08 16:11:23 -0700 | [diff] [blame] | 26 | * synchronized". Prerequisites: the device must provide the ability to write- |
| 27 | * protect its page tables (at PAGE_SIZE granularity), and must be able to |
| 28 | * recover from the resulting potential page faults. |
| 29 | * |
| 30 | * HMM guarantees that at any point in time, a given virtual address points to |
| 31 | * either the same memory in both CPU and device page tables (that is: CPU and |
| 32 | * device page tables each point to the same pages), or that one page table (CPU |
| 33 | * or device) points to no entry, while the other still points to the old page |
| 34 | * for the address. The latter case happens when the CPU page table update |
| 35 | * happens first, and then the update is mirrored over to the device page table. |
| 36 | * This does not cause any issue, because the CPU page table cannot start |
| 37 | * pointing to a new page until the device page table is invalidated. |
| 38 | * |
| 39 | * HMM uses mmu_notifiers to monitor the CPU page tables, and forwards any |
| 40 | * updates to each device driver that has registered a mirror. It also provides |
| 41 | * some API calls to help with taking a snapshot of the CPU page table, and to |
| 42 | * synchronize with any updates that might happen concurrently. |
| 43 | * |
| 44 | * |
| 45 | * HMM migration to and from device memory: |
| 46 | * |
| 47 | * HMM provides a set of helpers to hotplug device memory as ZONE_DEVICE, with |
| 48 | * a new MEMORY_DEVICE_PRIVATE type. This provides a struct page for each page |
| 49 | * of the device memory, and allows the device driver to manage its memory |
| 50 | * using those struct pages. Having struct pages for device memory makes |
| 51 | * migration easier. Because that memory is not addressable by the CPU it must |
| 52 | * never be pinned to the device; in other words, any CPU page fault can always |
| 53 | * cause the device memory to be migrated (copied/moved) back to regular memory. |
| 54 | * |
| 55 | * A new migrate helper (migrate_vma()) has been added (see mm/migrate.c) that |
| 56 | * allows use of a device DMA engine to perform the copy operation between |
| 57 | * regular system memory and device memory. |
| 58 | */ |
| 59 | #ifndef LINUX_HMM_H |
| 60 | #define LINUX_HMM_H |
| 61 | |
| 62 | #include <linux/kconfig.h> |
Dan Williams | 063a7d1 | 2018-12-28 00:39:46 -0800 | [diff] [blame] | 63 | #include <asm/pgtable.h> |
Jérôme Glisse | 133ff0e | 2017-09-08 16:11:23 -0700 | [diff] [blame] | 64 | |
Jérôme Glisse | 858b54d | 2017-09-08 16:12:02 -0700 | [diff] [blame] | 65 | #include <linux/device.h> |
Jérôme Glisse | 4ef589d | 2017-09-08 16:11:58 -0700 | [diff] [blame] | 66 | #include <linux/migrate.h> |
| 67 | #include <linux/memremap.h> |
| 68 | #include <linux/completion.h> |
Jérôme Glisse | a3e0d41 | 2019-05-13 17:20:01 -0700 | [diff] [blame] | 69 | #include <linux/mmu_notifier.h> |
Jérôme Glisse | 4ef589d | 2017-09-08 16:11:58 -0700 | [diff] [blame] | 70 | |
Jérôme Glisse | 133ff0e | 2017-09-08 16:11:23 -0700 | [diff] [blame] | 71 | /* |
Jérôme Glisse | f88a1e9 | 2018-04-10 16:29:06 -0700 | [diff] [blame] | 72 | * hmm_pfn_flag_e - HMM flag enums |
| 73 | * |
Jérôme Glisse | 133ff0e | 2017-09-08 16:11:23 -0700 | [diff] [blame] | 74 | * Flags: |
Jérôme Glisse | 86586a4 | 2018-04-10 16:28:34 -0700 | [diff] [blame] | 75 | * HMM_PFN_VALID: pfn is valid. It has, at least, read permission. |
Jérôme Glisse | 133ff0e | 2017-09-08 16:11:23 -0700 | [diff] [blame] | 76 | * HMM_PFN_WRITE: CPU page table has write permission set |
Jérôme Glisse | f88a1e9 | 2018-04-10 16:29:06 -0700 | [diff] [blame] | 77 | * HMM_PFN_DEVICE_PRIVATE: private device memory (ZONE_DEVICE) |
| 78 | * |
Ralph Campbell | 085ea25 | 2019-05-06 16:29:39 -0700 | [diff] [blame] | 79 | * The driver provides a flags array for mapping page protections to device |
| 80 | * PTE bits. If the driver valid bit for an entry is bit 3, |
| 81 | * i.e., (entry & (1 << 3)), then the driver must provide |
Jérôme Glisse | f88a1e9 | 2018-04-10 16:29:06 -0700 | [diff] [blame] | 82 | * an array in hmm_range.flags with hmm_range.flags[HMM_PFN_VALID] == 1 << 3. |
Ralph Campbell | 085ea25 | 2019-05-06 16:29:39 -0700 | [diff] [blame] | 83 | * Same logic apply to all flags. This is the same idea as vm_page_prot in vma |
Jérôme Glisse | f88a1e9 | 2018-04-10 16:29:06 -0700 | [diff] [blame] | 84 | * except that this is per device driver rather than per architecture. |
| 85 | */ |
| 86 | enum hmm_pfn_flag_e { |
| 87 | HMM_PFN_VALID = 0, |
| 88 | HMM_PFN_WRITE, |
| 89 | HMM_PFN_DEVICE_PRIVATE, |
| 90 | HMM_PFN_FLAG_MAX |
| 91 | }; |
| 92 | |
| 93 | /* |
| 94 | * hmm_pfn_value_e - HMM pfn special value |
| 95 | * |
| 96 | * Flags: |
Jérôme Glisse | da4c3c7 | 2017-09-08 16:11:31 -0700 | [diff] [blame] | 97 | * HMM_PFN_ERROR: corresponding CPU page table entry points to poisoned memory |
Jérôme Glisse | f88a1e9 | 2018-04-10 16:29:06 -0700 | [diff] [blame] | 98 | * HMM_PFN_NONE: corresponding CPU page table entry is pte_none() |
Jérôme Glisse | da4c3c7 | 2017-09-08 16:11:31 -0700 | [diff] [blame] | 99 | * HMM_PFN_SPECIAL: corresponding CPU page table entry is special; i.e., the |
Matthew Wilcox | 67fa166 | 2018-10-26 15:04:26 -0700 | [diff] [blame] | 100 | * result of vmf_insert_pfn() or vm_insert_page(). Therefore, it should not |
Jérôme Glisse | da4c3c7 | 2017-09-08 16:11:31 -0700 | [diff] [blame] | 101 | * be mirrored by a device, because the entry will never have HMM_PFN_VALID |
| 102 | * set and the pfn value is undefined. |
Jérôme Glisse | f88a1e9 | 2018-04-10 16:29:06 -0700 | [diff] [blame] | 103 | * |
Ralph Campbell | 085ea25 | 2019-05-06 16:29:39 -0700 | [diff] [blame] | 104 | * Driver provides values for none entry, error entry, and special entry. |
| 105 | * Driver can alias (i.e., use same value) error and special, but |
| 106 | * it should not alias none with error or special. |
Jérôme Glisse | f88a1e9 | 2018-04-10 16:29:06 -0700 | [diff] [blame] | 107 | * |
| 108 | * HMM pfn value returned by hmm_vma_get_pfns() or hmm_vma_fault() will be: |
| 109 | * hmm_range.values[HMM_PFN_ERROR] if CPU page table entry is poisonous, |
Ralph Campbell | 085ea25 | 2019-05-06 16:29:39 -0700 | [diff] [blame] | 110 | * hmm_range.values[HMM_PFN_NONE] if there is no CPU page table entry, |
Jérôme Glisse | f88a1e9 | 2018-04-10 16:29:06 -0700 | [diff] [blame] | 111 | * hmm_range.values[HMM_PFN_SPECIAL] if CPU page table entry is a special one |
Jérôme Glisse | 133ff0e | 2017-09-08 16:11:23 -0700 | [diff] [blame] | 112 | */ |
Jérôme Glisse | f88a1e9 | 2018-04-10 16:29:06 -0700 | [diff] [blame] | 113 | enum hmm_pfn_value_e { |
| 114 | HMM_PFN_ERROR, |
| 115 | HMM_PFN_NONE, |
| 116 | HMM_PFN_SPECIAL, |
| 117 | HMM_PFN_VALUE_MAX |
| 118 | }; |
| 119 | |
| 120 | /* |
| 121 | * struct hmm_range - track invalidation lock on virtual address range |
| 122 | * |
Jason Gunthorpe | a22dd50 | 2019-11-12 16:22:30 -0400 | [diff] [blame^] | 123 | * @notifier: a mmu_interval_notifier that includes the start/end |
| 124 | * @notifier_seq: result of mmu_interval_read_begin() |
Jérôme Glisse | 704f3f2 | 2019-05-13 17:19:48 -0700 | [diff] [blame] | 125 | * @hmm: the core HMM structure this range is active against |
Jérôme Glisse | f88a1e9 | 2018-04-10 16:29:06 -0700 | [diff] [blame] | 126 | * @vma: the vm area struct for the range |
| 127 | * @list: all range lock are on a list |
| 128 | * @start: range virtual start address (inclusive) |
| 129 | * @end: range virtual end address (exclusive) |
| 130 | * @pfns: array of pfns (big enough for the range) |
| 131 | * @flags: pfn flags to match device driver page table |
| 132 | * @values: pfn value for some special case (none, special, error, ...) |
Jérôme Glisse | 023a019 | 2019-05-13 17:20:05 -0700 | [diff] [blame] | 133 | * @default_flags: default flags for the range (write, read, ... see hmm doc) |
| 134 | * @pfn_flags_mask: allows to mask pfn flags so that only default_flags matter |
Jérôme Glisse | f88a1e9 | 2018-04-10 16:29:06 -0700 | [diff] [blame] | 135 | * @pfn_shifts: pfn shift value (should be <= PAGE_SHIFT) |
| 136 | * @valid: pfns array did not change since it has been fill by an HMM function |
| 137 | */ |
| 138 | struct hmm_range { |
Jason Gunthorpe | 04ec32f | 2019-11-12 16:22:20 -0400 | [diff] [blame] | 139 | struct mmu_interval_notifier *notifier; |
| 140 | unsigned long notifier_seq; |
Jérôme Glisse | f88a1e9 | 2018-04-10 16:29:06 -0700 | [diff] [blame] | 141 | unsigned long start; |
| 142 | unsigned long end; |
| 143 | uint64_t *pfns; |
| 144 | const uint64_t *flags; |
| 145 | const uint64_t *values; |
Jérôme Glisse | 023a019 | 2019-05-13 17:20:05 -0700 | [diff] [blame] | 146 | uint64_t default_flags; |
| 147 | uint64_t pfn_flags_mask; |
Jérôme Glisse | f88a1e9 | 2018-04-10 16:29:06 -0700 | [diff] [blame] | 148 | uint8_t pfn_shift; |
Jérôme Glisse | f88a1e9 | 2018-04-10 16:29:06 -0700 | [diff] [blame] | 149 | }; |
Jérôme Glisse | 133ff0e | 2017-09-08 16:11:23 -0700 | [diff] [blame] | 150 | |
| 151 | /* |
Jérôme Glisse | 391aab1 | 2019-05-13 17:20:31 -0700 | [diff] [blame] | 152 | * hmm_device_entry_to_page() - return struct page pointed to by a device entry |
| 153 | * @range: range use to decode device entry value |
| 154 | * @entry: device entry value to get corresponding struct page from |
Ralph Campbell | 085ea25 | 2019-05-06 16:29:39 -0700 | [diff] [blame] | 155 | * Return: struct page pointer if entry is a valid, NULL otherwise |
Jérôme Glisse | 133ff0e | 2017-09-08 16:11:23 -0700 | [diff] [blame] | 156 | * |
Jérôme Glisse | 391aab1 | 2019-05-13 17:20:31 -0700 | [diff] [blame] | 157 | * If the device entry is valid (ie valid flag set) then return the struct page |
| 158 | * matching the entry value. Otherwise return NULL. |
Jérôme Glisse | 133ff0e | 2017-09-08 16:11:23 -0700 | [diff] [blame] | 159 | */ |
Jérôme Glisse | 391aab1 | 2019-05-13 17:20:31 -0700 | [diff] [blame] | 160 | static inline struct page *hmm_device_entry_to_page(const struct hmm_range *range, |
| 161 | uint64_t entry) |
Jérôme Glisse | 133ff0e | 2017-09-08 16:11:23 -0700 | [diff] [blame] | 162 | { |
Jérôme Glisse | 391aab1 | 2019-05-13 17:20:31 -0700 | [diff] [blame] | 163 | if (entry == range->values[HMM_PFN_NONE]) |
Jérôme Glisse | 133ff0e | 2017-09-08 16:11:23 -0700 | [diff] [blame] | 164 | return NULL; |
Jérôme Glisse | 391aab1 | 2019-05-13 17:20:31 -0700 | [diff] [blame] | 165 | if (entry == range->values[HMM_PFN_ERROR]) |
Jérôme Glisse | f88a1e9 | 2018-04-10 16:29:06 -0700 | [diff] [blame] | 166 | return NULL; |
Jérôme Glisse | 391aab1 | 2019-05-13 17:20:31 -0700 | [diff] [blame] | 167 | if (entry == range->values[HMM_PFN_SPECIAL]) |
Jérôme Glisse | f88a1e9 | 2018-04-10 16:29:06 -0700 | [diff] [blame] | 168 | return NULL; |
Jérôme Glisse | 391aab1 | 2019-05-13 17:20:31 -0700 | [diff] [blame] | 169 | if (!(entry & range->flags[HMM_PFN_VALID])) |
Jérôme Glisse | f88a1e9 | 2018-04-10 16:29:06 -0700 | [diff] [blame] | 170 | return NULL; |
Jérôme Glisse | 391aab1 | 2019-05-13 17:20:31 -0700 | [diff] [blame] | 171 | return pfn_to_page(entry >> range->pfn_shift); |
Jérôme Glisse | 133ff0e | 2017-09-08 16:11:23 -0700 | [diff] [blame] | 172 | } |
| 173 | |
| 174 | /* |
Jérôme Glisse | 391aab1 | 2019-05-13 17:20:31 -0700 | [diff] [blame] | 175 | * hmm_device_entry_to_pfn() - return pfn value store in a device entry |
| 176 | * @range: range use to decode device entry value |
| 177 | * @entry: device entry to extract pfn from |
Ralph Campbell | 085ea25 | 2019-05-06 16:29:39 -0700 | [diff] [blame] | 178 | * Return: pfn value if device entry is valid, -1UL otherwise |
Jérôme Glisse | 133ff0e | 2017-09-08 16:11:23 -0700 | [diff] [blame] | 179 | */ |
Jérôme Glisse | 391aab1 | 2019-05-13 17:20:31 -0700 | [diff] [blame] | 180 | static inline unsigned long |
| 181 | hmm_device_entry_to_pfn(const struct hmm_range *range, uint64_t pfn) |
Jérôme Glisse | 133ff0e | 2017-09-08 16:11:23 -0700 | [diff] [blame] | 182 | { |
Jérôme Glisse | f88a1e9 | 2018-04-10 16:29:06 -0700 | [diff] [blame] | 183 | if (pfn == range->values[HMM_PFN_NONE]) |
Jérôme Glisse | 133ff0e | 2017-09-08 16:11:23 -0700 | [diff] [blame] | 184 | return -1UL; |
Jérôme Glisse | f88a1e9 | 2018-04-10 16:29:06 -0700 | [diff] [blame] | 185 | if (pfn == range->values[HMM_PFN_ERROR]) |
| 186 | return -1UL; |
| 187 | if (pfn == range->values[HMM_PFN_SPECIAL]) |
| 188 | return -1UL; |
| 189 | if (!(pfn & range->flags[HMM_PFN_VALID])) |
| 190 | return -1UL; |
| 191 | return (pfn >> range->pfn_shift); |
Jérôme Glisse | 133ff0e | 2017-09-08 16:11:23 -0700 | [diff] [blame] | 192 | } |
| 193 | |
| 194 | /* |
Jérôme Glisse | 391aab1 | 2019-05-13 17:20:31 -0700 | [diff] [blame] | 195 | * hmm_device_entry_from_page() - create a valid device entry for a page |
Jérôme Glisse | f88a1e9 | 2018-04-10 16:29:06 -0700 | [diff] [blame] | 196 | * @range: range use to encode HMM pfn value |
Jérôme Glisse | 391aab1 | 2019-05-13 17:20:31 -0700 | [diff] [blame] | 197 | * @page: page for which to create the device entry |
Ralph Campbell | 085ea25 | 2019-05-06 16:29:39 -0700 | [diff] [blame] | 198 | * Return: valid device entry for the page |
Jérôme Glisse | 133ff0e | 2017-09-08 16:11:23 -0700 | [diff] [blame] | 199 | */ |
Jérôme Glisse | 391aab1 | 2019-05-13 17:20:31 -0700 | [diff] [blame] | 200 | static inline uint64_t hmm_device_entry_from_page(const struct hmm_range *range, |
| 201 | struct page *page) |
Jérôme Glisse | 133ff0e | 2017-09-08 16:11:23 -0700 | [diff] [blame] | 202 | { |
Jérôme Glisse | f88a1e9 | 2018-04-10 16:29:06 -0700 | [diff] [blame] | 203 | return (page_to_pfn(page) << range->pfn_shift) | |
| 204 | range->flags[HMM_PFN_VALID]; |
Jérôme Glisse | 133ff0e | 2017-09-08 16:11:23 -0700 | [diff] [blame] | 205 | } |
| 206 | |
| 207 | /* |
Jérôme Glisse | 391aab1 | 2019-05-13 17:20:31 -0700 | [diff] [blame] | 208 | * hmm_device_entry_from_pfn() - create a valid device entry value from pfn |
Jérôme Glisse | f88a1e9 | 2018-04-10 16:29:06 -0700 | [diff] [blame] | 209 | * @range: range use to encode HMM pfn value |
Jérôme Glisse | 391aab1 | 2019-05-13 17:20:31 -0700 | [diff] [blame] | 210 | * @pfn: pfn value for which to create the device entry |
Ralph Campbell | 085ea25 | 2019-05-06 16:29:39 -0700 | [diff] [blame] | 211 | * Return: valid device entry for the pfn |
Jérôme Glisse | 133ff0e | 2017-09-08 16:11:23 -0700 | [diff] [blame] | 212 | */ |
Jérôme Glisse | 391aab1 | 2019-05-13 17:20:31 -0700 | [diff] [blame] | 213 | static inline uint64_t hmm_device_entry_from_pfn(const struct hmm_range *range, |
| 214 | unsigned long pfn) |
Jérôme Glisse | 133ff0e | 2017-09-08 16:11:23 -0700 | [diff] [blame] | 215 | { |
Jérôme Glisse | f88a1e9 | 2018-04-10 16:29:06 -0700 | [diff] [blame] | 216 | return (pfn << range->pfn_shift) | |
| 217 | range->flags[HMM_PFN_VALID]; |
Jérôme Glisse | 133ff0e | 2017-09-08 16:11:23 -0700 | [diff] [blame] | 218 | } |
| 219 | |
Jérôme Glisse | 391aab1 | 2019-05-13 17:20:31 -0700 | [diff] [blame] | 220 | /* |
Jason Gunthorpe | 107e899 | 2019-11-12 16:22:21 -0400 | [diff] [blame] | 221 | * Retry fault if non-blocking, drop mmap_sem and return -EAGAIN in that case. |
| 222 | */ |
| 223 | #define HMM_FAULT_ALLOW_RETRY (1 << 0) |
| 224 | |
| 225 | /* Don't fault in missing PTEs, just snapshot the current state. */ |
| 226 | #define HMM_FAULT_SNAPSHOT (1 << 1) |
| 227 | |
| 228 | #ifdef CONFIG_HMM_MIRROR |
Jérôme Glisse | 2023941 | 2019-05-13 17:20:24 -0700 | [diff] [blame] | 229 | /* |
Jérôme Glisse | a3e0d41 | 2019-05-13 17:20:01 -0700 | [diff] [blame] | 230 | * Please see Documentation/vm/hmm.rst for how to use the range API. |
Jérôme Glisse | da4c3c7 | 2017-09-08 16:11:31 -0700 | [diff] [blame] | 231 | */ |
Christoph Hellwig | 9a4903e | 2019-07-25 17:56:46 -0700 | [diff] [blame] | 232 | long hmm_range_fault(struct hmm_range *range, unsigned int flags); |
| 233 | |
Jérôme Glisse | 55c0ece | 2019-05-13 17:20:28 -0700 | [diff] [blame] | 234 | long hmm_range_dma_map(struct hmm_range *range, |
| 235 | struct device *device, |
| 236 | dma_addr_t *daddrs, |
Christoph Hellwig | 9a4903e | 2019-07-25 17:56:46 -0700 | [diff] [blame] | 237 | unsigned int flags); |
Jérôme Glisse | 55c0ece | 2019-05-13 17:20:28 -0700 | [diff] [blame] | 238 | long hmm_range_dma_unmap(struct hmm_range *range, |
Jérôme Glisse | 55c0ece | 2019-05-13 17:20:28 -0700 | [diff] [blame] | 239 | struct device *device, |
| 240 | dma_addr_t *daddrs, |
| 241 | bool dirty); |
Jason Gunthorpe | 107e899 | 2019-11-12 16:22:21 -0400 | [diff] [blame] | 242 | #else |
Jason Gunthorpe | 107e899 | 2019-11-12 16:22:21 -0400 | [diff] [blame] | 243 | static inline long hmm_range_fault(struct hmm_range *range, unsigned int flags) |
| 244 | { |
| 245 | return -EOPNOTSUPP; |
| 246 | } |
| 247 | |
| 248 | static inline long hmm_range_dma_map(struct hmm_range *range, |
| 249 | struct device *device, dma_addr_t *daddrs, |
| 250 | unsigned int flags) |
| 251 | { |
| 252 | return -EOPNOTSUPP; |
| 253 | } |
| 254 | |
| 255 | static inline long hmm_range_dma_unmap(struct hmm_range *range, |
| 256 | struct device *device, |
| 257 | dma_addr_t *daddrs, bool dirty) |
| 258 | { |
| 259 | return -EOPNOTSUPP; |
| 260 | } |
| 261 | #endif |
Jérôme Glisse | 74eee18 | 2017-09-08 16:11:35 -0700 | [diff] [blame] | 262 | |
| 263 | /* |
Jérôme Glisse | a3e0d41 | 2019-05-13 17:20:01 -0700 | [diff] [blame] | 264 | * HMM_RANGE_DEFAULT_TIMEOUT - default timeout (ms) when waiting for a range |
Jérôme Glisse | 74eee18 | 2017-09-08 16:11:35 -0700 | [diff] [blame] | 265 | * |
Jérôme Glisse | a3e0d41 | 2019-05-13 17:20:01 -0700 | [diff] [blame] | 266 | * When waiting for mmu notifiers we need some kind of time out otherwise we |
| 267 | * could potentialy wait for ever, 1000ms ie 1s sounds like a long time to |
| 268 | * wait already. |
Jérôme Glisse | 74eee18 | 2017-09-08 16:11:35 -0700 | [diff] [blame] | 269 | */ |
Jérôme Glisse | a3e0d41 | 2019-05-13 17:20:01 -0700 | [diff] [blame] | 270 | #define HMM_RANGE_DEFAULT_TIMEOUT 1000 |
| 271 | |
Jérôme Glisse | 133ff0e | 2017-09-08 16:11:23 -0700 | [diff] [blame] | 272 | #endif /* LINUX_HMM_H */ |