Page MenuHomeFreeBSD

Summary: linuxkpi: Add some basic swap functions These are used by kms-drm to determine various heuristics related to low memory conditions.
ClosedPublic

Authored by bwidawsk on Nov 19 2018, 11:53 PM.

Details

Summary

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

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

Test Plan

None yet. While this replaces stubbed functions with some
implementation and in theory should be more useful simply by the nature of it
building, it should get testing.

Diff Detail

Lint
Lint OK
Unit
No Unit Test Coverage
Build Status
Buildable 20901
Build 20269: arc lint + arc unit

Event Timeline

+1 I was just observing the need for this last night.

I think in general we need to do a better job of shrinker emulation.

This revision is now accepted and ready to land.Nov 19 2018, 11:56 PM
This revision was automatically updated to reflect the committed changes.
juan.molina_club.fr added inline comments.
head/sys/compat/linuxkpi/common/include/linux/swap.h
52 ↗(On Diff #50649)

I may be wrong, but the following lines seem to be an exact duplicate of the previous ones.

juan.molina_club.fr added inline comments.
head/sys/compat/linuxkpi/common/include/linux/swap.h
52 ↗(On Diff #50649)

Sorry, I see this has been corrected in a following patch.