the pgdat loops. example, this could be optimized for the 99% of userbase to:
do {
zonelist_t *zonelist = pgdat->node_zonelists + (GFP_USER & GFP_ZONEMASK);
zone_t **zonep = zonelist->zones;
zone_t *zone;
for (zone = *zonep++; zone; zone = *zonep++) {
unsigned long size = zone->size;
unsigned long high = zone->pages_high;
if (size > high)
sum += size - high;
}
#ifdef CONFIG_DISCONTIGMEM
pgdat = pgdat->node_next;
} while (pgdat);
#else
} while (0)
#endif
so allowing the compiler to remove a branch and a few instructions from
the asm, but it would be a microoptimization not visible in benchmarks,
I'm not actually suggesting that mostly for code clarity, branch
prediction should also take it right if it starts to be executed
frequently (hopefully the asm is large enough that it doesn't get
confused by the inner loop that is quite near).
Andrea
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/