Re: [Bug 417] New: htree much slower than regular ext3

From: Alex Tomas (bzzz@tmi.comex.ru)
Date: Sun Mar 09 2003 - 02:08:34 EST


>>>>> Daniel Phillips (DP) writes:

 DP> On Fri 07 Mar 03 16:46, Alex Tomas wrote:
 DP> The problem I see with your approach is that the traversal is no
 DP> longer in hash order, so a leaf split in the middle of a
 DP> directory traversal could result in a lot of duplicate dirents.
 DP> I'm not sure there's a way around that.

1) As far as I understand, duplicates are possible even in classic ext2
   w/o sortdir/index. See the diagram:

                    Process 1 Process 2

                    getdents(2) returns
                    dentry1 (file1 -> Inode1)
                    dentry2 (file2 -> Inode2)

context switch -->
                                               unlink(file1), empty dentry1
                                               creat(file3), Inode3, use dentry1
                                               creat(file1), Inode1, use dentry3

context switch -->

                    getdents(2) returns
                    dentry3(file1 -> Inode1)

Am I right?

2) Why do not use hash order for traversal like ext3_dx_readdir() does?
   Upon reading several dentries within some hash set readdir() sorts them
   in inode order and returns to an user.

with best regards, Alex

-
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 : Sat Mar 15 2003 - 22:00:17 EST