Page MenuHomeFreeBSD

vm_phys: Factor out some calls to vm_freelist_add()
ClosedPublic

Authored by markj on Jun 2 2023, 7:36 PM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Oct 29, 10:17 AM
Unknown Object (File)
Fri, Oct 18, 3:16 AM
Unknown Object (File)
Oct 6 2024, 12:35 PM
Unknown Object (File)
Oct 2 2024, 10:20 PM
Unknown Object (File)
Oct 2 2024, 4:26 AM
Unknown Object (File)
Oct 2 2024, 4:21 AM
Unknown Object (File)
Oct 2 2024, 2:43 AM
Unknown Object (File)
Oct 1 2024, 7:56 AM
Subscribers

Details

Summary

A subsequent patch will make this factoring more worthwhile.

No functional change intended.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

markj requested review of this revision.Jun 2 2023, 7:36 PM
This revision is now accepted and ready to land.Jun 2 2023, 8:09 PM
This revision now requires review to proceed.Aug 25 2023, 12:34 AM
markj retitled this revision from vm_phys: Factor out some duplicated code in vm_phys_enqueue_contig() to vm_phys: Factor out some calls to vm_freelist_add().Aug 25 2023, 12:35 AM

When I compile GENERIC-NODEBUG on amd64, I see that this change makes some functions grow larger. In particular, vm_phys_alloc_pages and vm_phys_enqueue_contig.

0000000000000930 <vm_phys_alloc_npages>:                        0000000000000930 <vm_phys_alloc_npages>:
0000000000000ea0 <vm_phys_alloc_pages>:                       | 0000000000000ec0 <vm_phys_alloc_pages>:
0000000000000f10 <vm_phys_alloc_freelist_pages>:              | 0000000000000f30 <vm_phys_alloc_freelist_pages>:
0000000000001180 <vm_phys_paddr_to_vm_page>:                  | 00000000000011a0 <vm_phys_paddr_to_vm_page>:
0000000000001200 <vm_phys_fictitious_to_vm_page>:             | 0000000000001220 <vm_phys_fictitious_to_vm_page>:
0000000000001270 <vm_phys_fictitious_reg_range>:              | 0000000000001290 <vm_phys_fictitious_reg_range>:
0000000000001780 <vm_phys_fictitious_unreg_range>:            | 00000000000017a0 <vm_phys_fictitious_unreg_range>:
0000000000001b40 <vm_phys_free_pages>:                        | 0000000000001b60 <vm_phys_free_pages>:
0000000000001cf0 <vm_phys_enqueue_contig>:                    | 0000000000001d10 <vm_phys_enqueue_contig>:
0000000000001e70 <vm_phys_free_contig>:                       | 0000000000001ea0 <vm_phys_free_contig>:

Tolerate some code duplication to avoid making vm_phys.o larger.

Fix handling of "tail".

sys/vm/vm_phys.c
686

What is the advantage of this new function over a change that just adds the KASSERT to vm_freelist_add?

sys/vm/vm_phys.c
686

The subsequent patch adds more callers and further extends the function.

This revision is now accepted and ready to land.Jan 27 2024, 8:35 PM
This revision was automatically updated to reflect the committed changes.
markj marked an inline comment as done.