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.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Nov 15, 10:32 PM
Unknown Object (File)
Fri, Nov 15, 11:46 AM
Unknown Object (File)
Fri, Nov 15, 2:44 AM
Unknown Object (File)
Thu, Nov 14, 2:33 AM
Unknown Object (File)
Thu, Nov 14, 1:38 AM
Unknown Object (File)
Nov 10 2024, 4:12 AM
Unknown Object (File)
Apr 5 2024, 5:19 AM
Unknown Object (File)
Feb 11 2024, 4:33 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

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

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

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

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