Page MenuHomeFreeBSD

Avoid unneeded initializations in vm_phys_init_page().
ClosedPublic

Authored by markj on Nov 25 2017, 10:37 PM.
Tags
None
Referenced Files
Unknown Object (File)
Wed, Oct 1, 1:50 AM
Unknown Object (File)
Tue, Sep 30, 6:29 PM
Unknown Object (File)
Tue, Sep 30, 6:09 AM
Unknown Object (File)
Tue, Sep 30, 3:10 AM
Unknown Object (File)
Mon, Sep 29, 10:40 PM
Unknown Object (File)
Mon, Sep 29, 10:33 AM
Unknown Object (File)
Aug 19 2025, 9:33 PM
Unknown Object (File)
Aug 8 2025, 4:38 AM
Subscribers
None

Details

Summary

The aflags and oflags fields are always initialized by the vm_page.c
allocators.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

This revision is now accepted and ready to land.Nov 26 2017, 5:03 AM

You mean that the allocators vm_page_alloc(), vm_page_alloc_contig(), and vm_page_alloc_freelist() overwrite the fields anyway.

What is the point of keeping the function in vm_phys.c ? If moved to vm_page.c, compiler most likely inlines its only use.

In D13242#276188, @kib wrote:

You mean that the allocators vm_page_alloc(), vm_page_alloc_contig(), and vm_page_alloc_freelist() overwrite the fields anyway.

What is the point of keeping the function in vm_phys.c ? If moved to vm_page.c, compiler most likely inlines its only use.

For that, vm_phys_paddr_to_segind() needs to be changed from static to extern. I would be fine with that too.

This revision was automatically updated to reflect the committed changes.