On Thu, Dec 16, 2010 at 1:53 AM, Boaz Harrosh <bharrosh@panasas.com> wrote:
Sadly, right now we don't know that the string is necessarily even aligned.
Yes, it's always aligned in a dentry, because it's either the inline
short string, or it's the longer string we explicitly allocated to the
dentry.
But when we do name compares in __d_lookup, only one part of that is a
dentry. The other is a qstr, and the name there is not aligned. In
fact, it's not even NUL-terminated. It's the data directly from the
path itself.
So we can certainly do compares a "long" at a time, but it's not
entirely trivial. And just making the dentries be aligned and
null-padded is not enough. Most likely, you'd have to make the dentry
name compare function do an unaligned load from the qstr part, and
then do the masking.
Which is likely still the best performance on something like x86 where
unaligned loads are cheap, but on other architectures it might be less
so.
Linus
--