FromOne document in the linked background material mentions mapping_set_unevictable().  It says it was used in two cases:
MARKING ADDRESS SPACES UNEVICTABLE
For facilities such as ramfs none of the pages attached to the address space may be evicted. To prevent eviction of any such pages, the AS_UNEVICTABLE address space flag is provided, and this can be manipulated by a filesystem using a number of wrapper functions:
void mapping_set_unevictable(struct address_space *mapping);
Mark the address space as being completely unevictable.
void mapping_clear_unevictable(struct address_space *mapping);
Mark the address space as being evictable.
int mapping_unevictable(struct address_space *mapping);
Query the address space, and return true if it is completely unevictable.
These are currently used in two places in the kernel:
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.
...and this It is now used byin a third callercase. 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()]