Here's version 3 of the patch, incorporating comments from Andrew Morton. Andrew Morton wrote: > We have an opportunity to make this loop less baroque. That seems reasonable. gcc's optimiser should be able to render them the same. > whereas in other places you _have_ made the definition of __init functions > include the "__init". I'm not sure which is best, really, but it seems > better to include the __init in the declaration. You're probably right. This should probably apply to vfs_caches_init() and inode_init() too. > What's the attribute((pure)) for? It tells gcc that the function's result only depends on its arguments... it makes no references at all to external data. It's like __attribute__((const)) but stronger. This means that gcc can generate code that caches the result. See the gcc manual. > It generates a warning on older gcc - please use __attribute_pure__. We still support gcc's that old? > The other four or five implementations of log2() use ffx(~n). Yes... but ffs() and ffz() take int args, not long args. I suspect that shouldn't matter (that would require the hash table to be calculated at 4Gig buckets in size or greater to be a problem), but why take the chance when we can avoid it easily? David