]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
linuxkpi: Add some basic swap functions
authorBen Widawsky <bwidawsk@FreeBSD.org>
Tue, 20 Nov 2018 22:49:19 +0000 (22:49 +0000)
committerBen Widawsky <bwidawsk@FreeBSD.org>
Tue, 20 Nov 2018 22:49:19 +0000 (22:49 +0000)
commitc3f4f28c63dad06d16f1b42e90cd91a90036bc36
tree3021b35ccb872c5f555eef9223605358694dddcd
parentedce78c2c444528c5d3044518e6b1db83f0ff71c
linuxkpi: Add some basic swap functions

These are used by kms-drm to determine various heuristics relate
memory conditions.

The number of free swap pages is just a variable, and it can be
much cheaper by either adding a new getter, or simply extern'ing
swap_total. However, this patch opts to use the more expensive,
existing interface - since this isn't an operation in a high per
path.

This allows us to remove some more gpl linuxkpi and do the follo
kms-drm:
git rm linuxkpi/gplv2/include/linux/swap.h

Reviewed by:    mmacy, Johannes Lundberg <johalun0@gmail.com>
Approved by:    emaste (mentor)
Differential Revision:  https://reviews.freebsd.org/D18052
sys/compat/linuxkpi/common/include/linux/swap.h [new file with mode: 0644]
sys/vm/vm_pageout.h
sys/vm/vm_swapout.c