One document in the background material mentions mapping_set_unevictable(). It says it was used in two cases:
By ramfs to mark the address spaces of its inodes when they are created, and this mark remains for the life of the inode.
By SYSV SHM to mark SHM_LOCK'd address spaces until SHM_UNLOCK is called.
Note that SHM_LOCK is not required to page in the locked pages if they're swapped out; the application must touch the pages manually if it wants to ensure they're in memory.
It is now used in a third case. It is applied to i915 graphics buffers, if they are mapped by the GPU:
https://elixir.bootlin.com/linux/v5.0.17/ident/mapping_set_unevictable
Referenced in 4 files:
- drivers/gpu/drm/i915/i915_gem.c, line 2589 [in i915_gem_object_get_pages_gtt()]