Page MenuHomeFreeBSD

LinuxKPI: replace vtophys+PHYS_TO_VM_PAGE with virt_to_page
ClosedPublic

Authored by bz on Jul 31 2023, 8:59 PM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Nov 22, 6:16 AM
Unknown Object (File)
Thu, Nov 21, 10:49 AM
Unknown Object (File)
Tue, Nov 19, 5:48 PM
Unknown Object (File)
Sun, Nov 17, 9:45 PM
Unknown Object (File)
Sun, Nov 17, 7:40 PM
Unknown Object (File)
Oct 12 2024, 2:36 PM
Unknown Object (File)
Oct 12 2024, 2:36 PM
Unknown Object (File)
Oct 12 2024, 12:37 PM

Details

Summary

Rather than using the FreeBSD internal calls vtophys() and
PHYS_TO_VM_PAGE() use the already existing LinuxKPI abstraction for
this called virt_to_page(). This reduces the amount of compat code
to maintain and will allow further work on struct [vm_]page.

This should be a NOP.

Sponsored by: The FreeBSD Foundation
MFC after: 2 weeks

Diff Detail

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

Event Timeline

bz requested review of this revision.Jul 31 2023, 8:59 PM

I have no objection to this and it looks ok, but I don't really understand it. Why is it useful to use Linux interfaces in these internal routines which deal with vm_page_t's and FreeBSD VM interfaces?

I have no objection to this and it looks ok, but I don't really understand it. Why is it useful to use Linux interfaces in these internal routines which deal with vm_page_t's and FreeBSD VM interfaces?

Because after D41255 linux_alloc_pages and linux_free_pages properly return/take a 'struct page *'. For as long as they are aliased by the #define page vm_page that's fine; once that alias goes away a struct page will be a struct page and a struct vm_page will be a struct vm_page and the less places we'll have to deal with to get from one to the other for internal handling the better this will be.

This revision is now accepted and ready to land.Aug 2 2023, 1:16 PM