migrate_pages on x64
move all pages in a process to another set of nodes
sys_migrate_pages(pid_t pid, unsigned long maxnode, const unsigned long *from, const unsigned long *to)
| number | 256 (0x100) |
|---|---|
| abi | common |
| entry point | sys_migrate_pages |
| since | Linux 3.3 or earlier (3.3 is the first release scanned for x64) |
| man page | migrate_pages(2) |
| source | elixir.bootlin.com |
Registers
| register | value |
|---|---|
rax | 256, the syscall number |
rdi | pid_t pid |
rsi | unsigned long maxnode |
rdx | const unsigned long *from |
r10 | const unsigned long *to |
rax | the return value |
Then run syscall to enter the kernel.
The syscall instruction clobbers rcx (the return address lands in rcx) and r11 (the flags land in r11).
Since Linux 5.14 the kernel reads the syscall number from eax and ignores the upper 32 bits of rax. Older kernels fail with ENOSYS when those bits are not zero, and mov eax, N clears them, so it works on both.
Same syscall on other architectures
- x86 294
- arm64 238
- arm 400
- riscv64 238
- ia32 294
- x32 1073742080
- loongarch64 238
- ppc64 258
- ppc 258
- s390x 287
- mips64 5246
- mipsn32 6250
- mipso32 4287
- alpha 449
- arc 238
- cris 294, removed in 4.17
- csky 238
- frv 294, removed in 4.17
- hexagon 238
- ia64 1280, removed in 6.7
- m32r 294, removed in 4.17
- m68k 287
- metag 238, removed in 4.17
- mn10300 295, removed in 4.17
- nds32 238, removed in 5.18
- nios2 238
- openrisc 238
- parisc 272
- score 238, removed in 4.17
- sh 294
- sparc 302
- sparc64 302
- tilegx 238, removed in 4.17
- tilepro 238, removed in 4.17
- xtensa 262
Get this as JSON: https://api.syscall.sh/v2/syscalls/x64/migrate_pages