MIGRATEPAGES(8)

๐Ÿ“ฆ
version 2.0.19.14.g690a72c ยท 3 versions
  • 2.0.19.14.g690a72c ยท alpine 3.22, alpine 3.23, alpine 3.24, arch rolling, centos-stream 10, centos-stream 9, debian trixie, fedora 43, fedora 44, nixpkgs unstable, opensuse-leap 16.0, ubuntu noble, ubuntu questing, ubuntu resolute, ubuntu stonking (latest)
  • 2.0.14 ยท ubuntu jammy
  • 2.0.16 ยท debian bookworm
, in alpine 3.22, alpine 3.23, alpine 3.24, arch rolling, centos-stream 10, centos-stream 9, debian trixie, fedora 43, fedora 44, nixpkgs unstable, opensuse-leap 16.0, ubuntu noble, ubuntu questing, ubuntu resolute, ubuntu stonking

โœจ NAME โœจ

okay so bestie, the manual name here is migratepages, from the Linux Administrator's Manual, section 8 ๐ŸŽ€ It's the tool that migrates the physical location of a process's pages ๐Ÿงš


๐Ÿ’– SYNOPSIS ๐Ÿ’–

migratepages pid from-nodes to-nodes

๐ŸŒธ DESCRIPTION ๐ŸŒธ

okay so migratepages moves the physical location of a process's pages, and the process's virtual address space stays exactly the same ๐Ÿ˜ญ The pages just get shuffled around in memory. This lets you change how far a process is from its memory, which is lowkey iconic. Performance can get a glow-up by moving a process's pages to the node where it's currently running โœจ

If you give multiple nodes for from-nodes or to-nodes, it tries to keep the relative location of each page within each nodeset ๐Ÿฆ‹ For example, if you move from nodes 2-5 to 7,9,12-13, the preferred result is 2->7, 3->9, 4->12, and 5->13. Honestly the plan is only doable if there's enough memory free, so keep that in mind ๐Ÿ’…

๐Ÿ“ Valid node specifiers ๐Ÿ“

  • all โ€” every node ๐ŸŒˆ
  • number โ€” one specific node number ๐Ÿซถ
  • number1{,number2} โ€” node number1 and node number2 ๐Ÿ’œ
  • number1-number2 โ€” every node from number1 up to number2 โœจ
  • ! nodes โ€” flips the selection, so you get the opposite of whatever the following specification picks ๐Ÿ™ˆ

๐Ÿ’… NOTES ๐Ÿ’…

You need a NUMA policy aware kernel that supports page migration, which means Linux 2.6.16 or later ๐Ÿ”ฅ

Heads up bestie: if you call migratepages as a regular user without admin privileges (but you still have the right to modify the process), it will only move pages that are NOT shared with other processes ๐Ÿ˜ญ
If you call it as root, or as a user with administrative privileges, it moves ALL the pages ๐Ÿ’€

๐Ÿงš FILES ๐Ÿงš

  • /proc/<pid>/numa_maps โ€” this is where you can find info about the NUMA memory use of a process ๐Ÿ‘‘

Copyright 2005-2006 Christoph Lameter, Silicon Graphics, Inc. ๐Ÿ’– migratepages is under the GNU General Public License, v.2 ๐ŸŽ€


โญ SEE ALSO โญ

numactl(8), set_mempolicy(2), get_mempolicy(2), mbind(2), sched_setaffinity(2), sched_getaffinity(2), proc(5), ftok(3), shmat(2), taskset(1) ๐Ÿซถ


Okay bestie, that's the whole vibe โœจ This page came from SGI, dated Jan 2005, and it's MIGRATEPAGES(8) forever ๐Ÿ’…๐ŸŒˆ