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
F168008464: D38240.id116529.diff
Tue, Aug 25, 9:35 PM
F168000811: D38240.id116041.diff
Tue, Aug 25, 8:44 PM
F167935472: D38240.id.diff
Tue, Aug 25, 12:30 PM
F167928674: D38240.diff
Tue, Aug 25, 11:43 AM
Unknown Object (File)
Tue, Aug 25, 12:58 AM
Unknown Object (File)
Sat, Aug 22, 10:54 AM
Unknown Object (File)
Sun, Aug 16, 4:28 AM
Unknown Object (File)
Sun, Aug 16, 4:28 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 Not Applicable
Unit
Tests Not Applicable

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
162

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.