[lkml]   [2012]   [Mar]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: 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->, dentry2->

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"-> (e.g.

dentry1-> == { 0x12, 0x56, 0x34, 0x78, 'n', 'a', 'm', 'e', '1' }
dentry2-> == { 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-> == * (u32 *) dentry2->

) before starting comparison of char array (e.g.

memcmp(dentry1-> + 4, dentry2-> + 4, len)


 \ /
  Last update: 2012-03-04 03:29    [W:0.129 / U:1.916 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site