Re: [RFC] Rearranging struct dentry for cache affinity

From: Paul Menage (pmenage@ensim.com)
Date: Fri Jul 12 2002 - 16:21:04 EST


>On Fri, Jul 12, 2002 at 01:38:35PM -0700, Paul Menage wrote:
>
> > - dentry->d_vfs_flags |= DCACHE_REFERENCED;
> > +#ifdef CONFIG_SMP
> > + if(!(dentry->d_vfs_flags & DCACHE_REFERENCED))
> > +#endif
> > + dentry->d_vfs_flags |= DCACHE_REFERENCED;
>
>Yuck. Is doing this conditional on UP really a measurable effect?

I'm don't know yet - I did some brief tests on x86 UP to see how much
positive/negative effect the branch misses versus the cache dirtying
had, and (using an exponentially decaying distribution of entries being
tested/set) the if() statement did show an improvement for sufficiently
skewed distributions. But I've no idea yet how that matches up to the
distributions that we'd see in the dcache in actual use.

As I said in an earlier email, it might be nice to have an
__ensure_bit_set() function that uses architecture-specific knowledge to
make sure a particular bit is set as efficiently as possible. (e.g.
taking advantage of predicated writes, etc).

>If you must microoptimise
>to this level, at least try and keep the code clean.

Sure - this is just a quick [RFC] hack.

Paul

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



This archive was generated by hypermail 2b29 : Mon Jul 15 2002 - 22:00:24 EST