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)
Apr 30 2024, 3:48 PM
Unknown Object (File)
Apr 30 2024, 3:48 PM
Unknown Object (File)
Apr 30 2024, 3:47 PM
Unknown Object (File)
Apr 30 2024, 3:47 PM
Unknown Object (File)
Apr 30 2024, 8:31 AM
Unknown Object (File)
Mar 15 2024, 4:11 PM
Unknown Object (File)
Feb 5 2024, 12:31 AM
Unknown Object (File)
Jan 14 2024, 1:38 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.