Greg Kroah-Hartman | b244131 | 2017-11-01 15:07:57 +0100 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0 */ |
Andrew Morton | 6536e31 | 2012-01-20 14:33:53 -0800 | [diff] [blame] | 2 | #ifndef MIGRATE_MODE_H_INCLUDED |
| 3 | #define MIGRATE_MODE_H_INCLUDED |
| 4 | /* |
| 5 | * MIGRATE_ASYNC means never block |
| 6 | * MIGRATE_SYNC_LIGHT in the current implementation means to allow blocking |
| 7 | * on most operations but not ->writepage as the potential stall time |
| 8 | * is too significant |
| 9 | * MIGRATE_SYNC will block when migrating pages |
Jérôme Glisse | 2916ecc | 2017-09-08 16:12:06 -0700 | [diff] [blame] | 10 | * MIGRATE_SYNC_NO_COPY will block when migrating pages but will not copy pages |
| 11 | * with the CPU. Instead, page copy happens outside the migratepage() |
| 12 | * callback and is likely using a DMA engine. See migrate_vma() and HMM |
| 13 | * (mm/hmm.c) for users of this mode. |
Andrew Morton | 6536e31 | 2012-01-20 14:33:53 -0800 | [diff] [blame] | 14 | */ |
| 15 | enum migrate_mode { |
| 16 | MIGRATE_ASYNC, |
| 17 | MIGRATE_SYNC_LIGHT, |
| 18 | MIGRATE_SYNC, |
Jérôme Glisse | 2916ecc | 2017-09-08 16:12:06 -0700 | [diff] [blame] | 19 | MIGRATE_SYNC_NO_COPY, |
Andrew Morton | 6536e31 | 2012-01-20 14:33:53 -0800 | [diff] [blame] | 20 | }; |
| 21 | |
John Hubbard | 8eb42be | 2021-11-05 13:43:32 -0700 | [diff] [blame] | 22 | enum migrate_reason { |
| 23 | MR_COMPACTION, |
| 24 | MR_MEMORY_FAILURE, |
| 25 | MR_MEMORY_HOTPLUG, |
| 26 | MR_SYSCALL, /* also applies to cpusets */ |
| 27 | MR_MEMPOLICY_MBIND, |
| 28 | MR_NUMA_MISPLACED, |
| 29 | MR_CONTIG_RANGE, |
| 30 | MR_LONGTERM_PIN, |
| 31 | MR_DEMOTION, |
| 32 | MR_TYPES |
| 33 | }; |
| 34 | |
Andrew Morton | 6536e31 | 2012-01-20 14:33:53 -0800 | [diff] [blame] | 35 | #endif /* MIGRATE_MODE_H_INCLUDED */ |