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)
Feb 11 2024, 4:33 PM
Unknown Object (File)
Dec 25 2023, 8:54 PM
Unknown Object (File)
Dec 12 2023, 3:12 PM
Unknown Object (File)
Nov 15 2023, 5:21 AM
Unknown Object (File)
Oct 11 2023, 9:14 PM
Unknown Object (File)
Oct 11 2023, 11:05 AM
Unknown Object (File)
Sep 12 2023, 7:59 AM
Unknown Object (File)
Aug 13 2023, 9:01 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.