Page MenuHomeFreeBSD

LinuxKPI: Add PAGE_IS_LKPI_PAGE for Linux struct page instead of vm_page
Needs ReviewPublic

Authored by bz on Sat, Jul 18, 11:45 AM.
Tags
None
Referenced Files
F163452488: D58320.diff
Thu, Jul 23, 7:59 AM
F163442347: D58320.diff
Thu, Jul 23, 6:04 AM
Unknown Object (File)
Wed, Jul 22, 6:52 AM
Unknown Object (File)
Wed, Jul 22, 3:36 AM
Unknown Object (File)
Wed, Jul 22, 12:59 AM
Unknown Object (File)
Wed, Jul 22, 12:50 AM
Unknown Object (File)
Tue, Jul 21, 5:14 PM
Unknown Object (File)
Mon, Jul 20, 7:41 PM

Details

Reviewers
olce
Summary

Historically Linux 'page' was aliased to 'vm_page' which meant that all
"page accesses" went directly to our FreeBSD native system.
This was (any likely is) the most efficient way of doing this but it
means that we cannot (or do not want to) extend vm_page for LinuxKPI
specific fields leaving us in a limbo.

drm-kmod in the past has worked around this by changing code with
FreeBSD specific workarounds.
With the mt76 wireless drivers using page pools we are at a stage
that rather than re-writing the code we bite the bullet and rework
the entire LinuxKPI code to deal with a Linux struct page instead
building a 'shadow table' for mapping vm_page to page and back
in order to still have access to the 'backing store'.

In order to allow for a smoother transition until the initial code
can be reviewed, allow both the old alias and the new struct page
world to be compiled. That way the majority of people will not
be affected by the change at first, and people who want to try mt76
can define PAGE_IS_LKPI_PAGE in page.h (and manually re-compile drm-kmod
if needed).

The first cut of code is likely neither as efficient nor as memory
saving as it could be as we upfront allocate a full 'shadow table'
rather than having a (way) smaller pool and using a mapping or
allocating on demand. First try to make this work, then someone
with a lot more VM knowledge can try to make this work fast and
efficient.

Sponsored by: The FreeBSD Foundation
MFC after: 3 weeks

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 74910
Build 71793: arc lint + arc unit