Page MenuHomeFreeBSD

Use helper functions to reduce code duplication in merging vm_entry neighbors
ClosedPublic

Authored by dougm on Oct 18 2018, 3:36 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Nov 16, 10:02 AM
Unknown Object (File)
Tue, Nov 5, 2:25 PM
Unknown Object (File)
Sat, Nov 2, 2:16 AM
Unknown Object (File)
Oct 22 2024, 7:38 PM
Unknown Object (File)
Oct 3 2024, 8:14 PM
Unknown Object (File)
Oct 2 2024, 7:00 AM
Unknown Object (File)
Oct 2 2024, 5:03 AM
Unknown Object (File)
Oct 1 2024, 7:59 PM
Subscribers

Details

Summary

Use helper functions to reduce code duplication in merging vm_entry neighbors.

Diff Detail

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

Event Timeline

dougm added a reviewer: kib.
kib added inline comments.
sys/vm/vm_map.c
1654 ↗(On Diff #49288)

prev->object.vm_object == NULL

1655 ↗(On Diff #49288)

No need to indent.

This revision is now accepted and ready to land.Oct 18 2018, 7:11 PM

Accept reviewer style suggestions.

This revision now requires review to proceed.Oct 18 2018, 7:39 PM
This revision is now accepted and ready to land.Oct 18 2018, 10:11 PM
This revision was automatically updated to reflect the committed changes.
head/sys/vm/vm_map.c
1648

This function does not by itself prove that two entries are mergeable. Hence, its name is misleading. It's necessary that, for example, the entry is not a submap or in transition. I would like to see those conditions asserted here.

Alternatively, and contradicting my initial comment, giving this function a name like vm_map_simplify_test() would discourage the reuse of this function elsewhere, where the necessary conditions on eflags have not been established.

1651

Now that this code is deindented, this variable is pointless. It's is used once, and computing this value before we know that end == start and the objects match is wasted effort.

1665

vm_map_simplify_deallocate(). Historically, "dispose" functions were simple free operations.

1669–1680

Now that this comment is deindented, the text should be "reflowed".

dougm added inline comments.
head/sys/vm/vm_map.c
1648

I'll rename to vm_map_neighbor_test, since 'neighbor' is a term introduced in the comment that describes the 'simplify_entry' function, and 'simplify_test' sounds like we're simplifying some sort of test, which sounds pretty generic.

1665

vm_map_neighbor_deallocate().