It has previously been discussed to remove the BLK for much (all?) of the
VFS and push the locking into the filesystems. This would require that
lock_super() actually be an SMP safe locking mechanism. At this point it
would also be possible to have separate locks for each ext2 group, which
may greatly reduce locking contention as we searched for free blocks/inodes
(really depends on allocation patterns).
With per-group (or maybe per-bitmap) locking, files could be created in
parallel with only a small amount of global locking if they are in different
groups. The CPU-intensive work (bitmap searching) could be done with
only a bitmap lock. It may even be desirable to do the bitmap searching
without any locks. We would depend on the atomic test_and_set() to tell
us if our newfound "free" block was allocated from underneath us, and use
find_next_free_bit() to continue our search in the bitmap.
The group lock would be needed for updating the group descriptor counts,
and a superblock lock for doing the superblock counts. It may also be
possible to have lazy updating of the superblock counts, and depend on
e2fsck to update the superblock counts on a crash. I'm thinking something
like updating a "delta count" for each ext2 group (blocks, inodes, dirs)
while we hold the group lock, and only moving the deltas from the groups
to the superblock on sync or similar. This would reduce lock contention
on the superblock lock a great deal.
Cheers, Andreas
-- Andreas Dilger \ "If a man ate a pound of pasta and a pound of antipasto, \ would they cancel out, leaving him still hungry?" http://www-mddsp.enel.ucalgary.ca/People/adilger/ -- Dogbert - 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/