Page MenuHomeFreeBSD

LinuxKPI: Add work-in-pgroess PAGE_IS_LKPI_PAGE
Needs ReviewPublic

Authored by bz on Oct 29 2025, 4:08 PM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Dec 10, 3:04 AM
Unknown Object (File)
Mon, Dec 1, 2:44 AM
Unknown Object (File)
Sat, Nov 29, 7:26 AM
Unknown Object (File)
Sun, Nov 23, 5:25 PM
Unknown Object (File)
Tue, Nov 18, 7:54 AM
Unknown Object (File)
Nov 14 2025, 6:10 AM
Unknown Object (File)
Nov 8 2025, 12:23 AM
Unknown Object (File)
Nov 5 2025, 5:22 PM
Subscribers

Details

Reviewers
olce
emaste
jrm
Summary

PAGE_IS_LKPI_PAGE is not yet defined and thus a Linux "page" is still
a native FreeBSD vm_page.

With this defined 'struct page' becomes a collection-struct for Linux
code which handles its members itself. We keep the native FreeBSD page
as first argument.

Further work is needed to finish the implementation.

The pre-processor check allows us to test the new implementation (once
done; including drm-kmod which also worked around this problem in a
place before) before finally flipping the default.

In addition to drm-kmod also mt76 (page-pools) will benefit from this.

Test Plan

I litterally rebased this from sitting in the car on the road
and resolved two conflicts; this may or may not be the latest
revision of the work but at least is updated. I'll go and have
a look from inside or next week.

Diff Detail

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

Event Timeline

bz requested review of this revision.Oct 29 2025, 4:08 PM

There's a few XXX cases in there still etc. mm.h and highmem.h got conflict resolution from the street. If I got it right a kernel w/o drm-kmod at least would compile which was all the bits I needed for the moment; will need this + page_ppols working for mt76 and drm-kmod still compiling and working despite having vm_age_t embedded somewhere which probably should not be native code but LinuxKPI code which then can handle any of that.

sys/compat/linuxkpi/common/src/linux_page.c
633

This is the logic (with or without optimization) that needs to work for all three cases.

688

This is/was debugging for me to see how big vm_page_array_size is.

sys/compat/linuxkpi/common/include/linux/page.h
51

Here's the one line that needs changing to compile this in or out.