Re: Horrible L2 cache effects from kernel compile

Linus Torvalds (torvalds@transmeta.com)
Mon, 3 Mar 2003 11:13:31 -0800 (PST)


On Mon, 3 Mar 2003, Benjamin LaHaise wrote:
>
> Part of it is that some of the dentry is simply just too bloated. At
> 160 bytes, there must be something we can prune:

The thing is, the size of it doesn't really matter. The bad effects come
not from the size, but from the bad behaviour of the lookup algorithm,
which would be exactly the same even if the dentry was _half_ the size it
is now.

In other words, the size of the dentry only matters from a memory usage
standpoint, and I don't think we have any cause to believe that dentries
really hurt our global memory usage (we've _often_ had the bug that we
don't shrink the dentry cache quickly enough, which is a different
problem, though - keeping too many of them around. That should be largely
fixed in current kernels).

So I don't think there is any real reason to worry about the size of the
dentry itself. Yes, you could make it smaller (you could remove the inline
string from it, for example, and you could avoid allocating it at
cacheline boundaries - both of which makes it a _lot_ smaller than just
trying to save few bits), but both of those bigger decisions look like
they are worthwhile tradeoffs.

Linus

-
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/