[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <201203041127.IDI56216.FHOQMOVLtOFSJF@I-love.SAKURA.ne.jp>
Date: Sun, 4 Mar 2012 11:27:01 +0900
From: Tetsuo Handa <penguin-kernel@...ove.SAKURA.ne.jp>
To: torvalds@...ux-foundation.org, andi@...stfloor.org, hpa@...or.com
Cc: linux-kernel@...r.kernel.org, linux-fsdevel@...r.kernel.org,
viro@...iv.linux.org.uk
Subject: Re: Word-at-a-time dcache name accesses (was Re: .. anybody know ofany filesystems that depend on the exact VFS 'namehash' implementation?)
A passer-by's mumble.
We are discussing about systems with huge "struct dentry" instances where
selecting a hash list based on "struct qstr"->hash cannot effectively narrow
down candidates to compare, aren't we?
Then, I thought we can reconstruct candidates in a hash list.
For example, sort "struct dentry" based on return value of
strcmp(dentry1->d_name.name, dentry2->d_name.name).
For another example, embed another hash value (calculated using some algorithm
that is different from the one used for "struct qstr"->hash) into the leading 1
or 2 or 4 bytes of "struct dentry"->d_name.name (e.g.
dentry1->d_name.name == { 0x12, 0x56, 0x34, 0x78, 'n', 'a', 'm', 'e', '1' }
dentry2->d_name.name == { 0xab, 0xcd, 0xef, 0x01, 'n', 'a', 'm', 'e', '2' }
for 32 bits hash case, where 0x12563478 is hash value for name1 and 0xabcdef01
is hash value for name2) and compare the embedded hash (e.g.
* (u32 *) dentry1->d_name.name == * (u32 *) dentry2->d_name.name
) before starting comparison of char array (e.g.
memcmp(dentry1->d_name.name + 4, dentry2->d_name.name + 4, len)
).
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists