Assign map->header values to avoid boundary checks
Needs ReviewPublic

Authored by dougm_rice.edu on Tue, Jan 2, 6:48 AM.

Details

Reviewers
alc
markj
kib
Summary

In several places, entry start and end field are checked, after excluding the possibility that the entry is map->header. By assigning max and min values to the start and end fields of map->header in vm_map_init, the explicit map->header checks become unnecessary.

Diff Detail

Lint
Lint Skipped
Unit
Unit Tests Skipped
dougm_rice.edu created this revision.Tue, Jan 2, 6:48 AM

Associate min_offset and max_offset with header.end and header.start, respectively.

Eliminate unneeded &map->header checks in vm_mmap.c.

Peter Holm, can you please stress test this patch at your convenience?

pho added a comment.Sun, Jan 14, 11:34 AM

Peter Holm, can you please stress test this patch at your convenience?

I ran all of the stress2 tests. Half on amd64 and half on i386. No problems seen.

kib accepted this revision.Tue, Jan 16, 11:20 AM
This revision is now accepted and ready to land.Tue, Jan 16, 11:20 AM
markj accepted this revision.Tue, Jan 16, 3:01 PM
markj added inline comments.
sys/vm/vm_map.c
2270

While you're here, perhaps fix style and move the closing paren and opening brace to the end of the previous line? Ditto below.

Make recommended formatting changes to a couple of loops.

This revision now requires review to proceed.Tue, Jan 16, 6:02 PM