PERFORCE change 93380 for review
Peter Wemm
peter at FreeBSD.org
Wed Mar 15 23:43:38 UTC 2006
http://perforce.freebsd.org/chv.cgi?CH=93380
Change 93380 by peter at peter_melody on 2006/03/15 23:43:08
Slight optimization. If we're going to test the map for nonzero, use
that to terminate the loop. Use the loop termination condition to measure
success.
Affected files ...
.. //depot/projects/hammer/sys/amd64/amd64/pmap.c#143 edit
Differences ...
==== //depot/projects/hammer/sys/amd64/amd64/pmap.c#143 (text+ko) ====
@@ -1593,13 +1593,12 @@
pc = TAILQ_FIRST(&pmap->pm_pvchunk);
if (pc != NULL) {
for (field = 0; field < _NPCM; field++) {
- bit = -1;
- if (pc->pc_map[field])
+ if (pc->pc_map[field]) {
bit = bsfq(pc->pc_map[field]);
- if (bit >= 0)
break;
+ }
}
- if (bit >= 0) {
+ if (field < _NPCM) {
pv = &pc->pc_pventry[field * 64 + bit];
pc->pc_map[field] &= ~(1ul << bit);
/* If this was the last item, move it to tail */
More information about the p4-projects
mailing list