Initializing the eflags field of the map->header entry to a value with a unique new bit set makes a few comparisons to &map->header unnecessary.
Details
- Reviewers
alc kib markj pho - Commits
- rS340064: Initialize the eflags field of vm_map headers.
I hope that Peter Holm will test this change and that, once it passes that test, one of the folks who approved it will check it in.
Diff Detail
- Repository
- rS FreeBSD src repository - subversion
- Lint
Lint Not Applicable - Unit
Tests Not Applicable
Event Timeline
sys/vm/vm_map.c | ||
---|---|---|
799 ↗ | (On Diff #38271) | I think that it would be wise to define a MAP_ENTRY_HEADER flag that is only set on map header entries. Then, you could exploit the map header as a sentinel more generally. For example, vm_map_insert() and vm_map_simplify_entry() would no longer need != &map->header tests. |
Set an MAP_ENTRY_HEADER bit in the eflags for the map header, and in several places, rely on eflags mismatches to replace the need for an explicit &map->header comparison check.
Replace space with tab. Add KASSERT to ensure that map header has IS_SUB_MAP flag cleared.
sys/kern/sys_process.c | ||
---|---|---|
391 ↗ | (On Diff #49735) | Continuation lines should be indented by four spaces. |
I would also suggest mentioning the use of this new flag in the comment at the top of the struct vm_map definition where we talk about min and max offset.
sys/vm/vm_map.h | ||
---|---|---|
195–198 ↗ | (On Diff #49737) | I think that this comment is redundant. This information is clearly spelled out above. |
I only used one host for the amd64 tests, so it took a while.
I ran all of the stress2 tests on amd64. I ran tests on i386 for a few hours. I did a buildworld / installworld.
No problems seen.