The possible demise of remap_file_pages()
Please consider subscribing to LWNThe remap_file_pages() system call is a bit of a strange beast; it allows a process to create a complicated, non-linear mapping between its address space and an underlying file. Such mappings can also be created with multiple mmap() calls, but the in-kernel cost is higher: each mmap() call creates a separate virtual memory area (VMA) in the kernel, while remap_file_pages() can get by with just one. If the mapping has a large number of discontinuities, the difference on the kernel side can be significant.Subscriptions are the lifeblood of LWN.net. If you appreciate this content and would like to see more of it, your subscription will help to ensure that LWN continues to thrive. Please visit this page to join up and keep LWN on the net.
That said, there are few users of remap_file_pages() out there.
So few that Kirill Shutemov has posted a patch
set to remove it entirely, saying "Nonlinear mappings are pain to
support and it seems there's no legitimate use-cases nowadays since 64-bit
systems are widely available.
" The patch is not something he is
proposing for merging yet; it's more of a proof of concept at this point.
It is easy to see the appeal of this change; it removes 600+ lines of
tricky code from the kernel. But that removal will go nowhere if it
constitutes an ABI break. Some kernel developers clearly believe that no
users will notice if remap_file_pages() goes away, but going from
that belief to potentially breaking applications is a big step. So there
is talk of adding a warning to the kernel; Peter Zijlstra suggested going a step further and require
setting a sysctl knob to make the system call active. But it would also
help if current users of remap_file_pages() would make themselves
known; speaking now could save some trouble in the future.
| Index entries for this article | |
|---|---|
| Kernel | remap_file_pages() |
The LWN site is currently under high scraper load, so comment display has been suppressed for anonymous users. If you are a human, you may read the comments by clicking the button below:
Note: you can avoid this step in the future by logging into your LWN account.
