Page MenuHomeFreeBSD

LinuxKPI: mm.h: implement virt_to_head_page()
ClosedPublic

Authored by bz on Jan 28 2023, 4:03 PM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Jan 14, 5:04 PM
Unknown Object (File)
Fri, Jan 10, 6:22 AM
Unknown Object (File)
Wed, Jan 8, 5:12 PM
Unknown Object (File)
Wed, Jan 8, 5:12 PM
Unknown Object (File)
Wed, Jan 8, 5:11 PM
Unknown Object (File)
Tue, Jan 7, 7:48 PM
Unknown Object (File)
Tue, Jan 7, 7:11 PM
Unknown Object (File)
Tue, Dec 31, 3:54 AM
Subscribers

Details

Summary

Implement virt_to_head_page(). We will have to improve this if we
start to allocate sub-page fragments.

Sponsored by: The FreeBSD Foundation
MFC after: 3 days

Diff Detail

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

Event Timeline

bz requested review of this revision.Jan 28 2023, 4:03 PM

This seems ok, but I don't understand the reference to sub-page fragments. The purpose of this function is to return the "head" of a "compound" page. A compound page is an aligned, power-of-2-sized run of contiguous physical pages, and the head page is the first page of that run. So for instance the first 4KB page of a superpage. We don't maintain any notion of compound pages in the LinuxKPI, so your implementation is right IMO, but I can't see the connection to page_frag_cache etc.

sys/compat/linuxkpi/common/include/linux/mm.h
160

Or just return (virt_to_page(p));

This revision is now accepted and ready to land.Jan 30 2023, 2:29 PM
This revision now requires review to proceed.Jan 30 2023, 2:34 PM
This revision is now accepted and ready to land.Jan 30 2023, 2:36 PM
This revision was automatically updated to reflect the committed changes.