get_empty_inode (2.0.30p9)

Michael O'Reilly (michael@metal.iinet.net.au)
11 Sep 1997 13:24:30 +0800


[ don't know if this is applicable to 2.1 as well. ]

There's an optimization here that makes a fairly large difference.

In get_empty_inode(), just before 'return best', it needs a call to
put_last_free(). i.e.

....
put_last_free(best);
return best;
}

The issue here is that if an inode is returned by get_empty_inode(),
it's (almost) certain to be used by something. This makes it a very
poor fit for an empty inode search, so we should move it to the back
of the list.

Note that __iget() has a call to put_last_free() that's now
redundant.

This change only affects machines doing large amounts of connect()'s,
accept()'s, pipe()'s, and socketpairs()'s. (currently the only calls
to get_empty_inode that didn't call put_last_free). i.e. web servers,
proxy servers, and mail servers.

Michael.