Copy On Write, Get User Pages, and Mysterious Counters
summary
Introduces a kernel flag called page on exclusive that prevents anonymous pages from being pinned while shared, so get_user_pages operations either trigger an unsharing (create a read-only private copy) or reuse a page only when folio map count is one. Uses a multi-page pin count (not available for single base pages) and a refcount heuristic (>1024) for pinned single pages. Works upstream but still breaks for THP, get_user_pages_fast races, and needs io_uring pin API changes and more selftests.
AI-written summary · about
chapters (9)
- 0:00Introduction to talk
- 0:44Background on Copy On Write
- 3:13Why share anonymous pages
- 6:24Mysterious counters in memory
- 8:54Copy On Write issues with get_user_pages
- 12:26Problems with existing solutions
- 13:49Introducing page_is_exclusive
- 17:21Current limitations and fixes
- 19:31Open discussion and questions
related talks
14mDecoupling Large Folios from Transparent Huge Pages
44mLarge Pages in Linux
43mHybrid THP Mechanism. Selective Use of Huge Pages by Hot Applications
12mEvery Mapping Counts in Large Amounts: Folio Accounting
22mIntroducing PAGEMAP_SCAN IOCTL for Windows syscalls translation...
11mAdvanced Parallel Memory Virtualization
47mLinux's Leap Beyond Fixed Pages
32mIs Your Kernel Being Honest? Understanding & measuring low level bottlenecks
