diff options
| author | Andrew Morton <akpm@digeo.com> | 2003-06-17 18:26:42 -0700 |
|---|---|---|
| committer | Linus Torvalds <torvalds@home.transmeta.com> | 2003-06-17 18:26:42 -0700 |
| commit | c12b9866ea52183ad5f2d87ca01c09b3a7508f5a (patch) | |
| tree | 14c7df6b50aed0a4c41a18110113b6442d9642de /include/linux/ext3_fs_sb.h | |
| parent | 78f2f471204076997e5360dd7ffe807b9eb1e5ce (diff) | |
[PATCH] ext3: concurrent block/inode allocation
From: Alex Tomas <bzzz@tmi.comex.ru>
This patch weans ext3 off lock_super()-based protection for the inode and
block allocators.
It's basically the same as the ext2 changes.
1) each group has own spinlock, which is used for group counter
modifications
2) sb->s_free_blocks_count isn't used any more. ext2_statfs() and
find_group_orlov() loop over groups to count free blocks
3) sb->s_free_blocks_count is recalculated at mount/umount/sync_super time
in order to check consistency and to avoid fsck warnings
4) reserved blocks are distributed over last groups
5) ext3_new_block() tries to use non-reserved blocks and if it fails then
tries to use reserved blocks
6) ext3_new_block() and ext3_free_blocks do not modify sb->s_free_blocks,
therefore they do not call mark_buffer_dirty() for superblock's
buffer_head. this should reduce I/O a bit
Also fix orlov allocator boundary case:
In the interests of SMP scalability the ext2 free blocks and free inodes
counters are "approximate". But there is a piece of code in the Orlov
allocator which fails due to boundary conditions on really small
filesystems.
Fix that up via a final allocation pass which simply uses first-fit for
allocatiopn of a directory inode.
Diffstat (limited to 'include/linux/ext3_fs_sb.h')
| -rw-r--r-- | include/linux/ext3_fs_sb.h | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/include/linux/ext3_fs_sb.h b/include/linux/ext3_fs_sb.h index 19bf2e132343..6d53e5cac0ac 100644 --- a/include/linux/ext3_fs_sb.h +++ b/include/linux/ext3_fs_sb.h @@ -21,6 +21,13 @@ #include <linux/wait.h> #endif +struct ext3_bg_info { + u8 bg_debts; + spinlock_t bg_balloc_lock; + spinlock_t bg_ialloc_lock; + unsigned long bg_reserved; +} ____cacheline_aligned_in_smp; + /* * third extended-fs super-block data in memory */ @@ -50,8 +57,7 @@ struct ext3_sb_info { u32 s_next_generation; u32 s_hash_seed[4]; int s_def_hash_version; - unsigned long s_dir_count; - u8 *s_debts; + struct ext3_bg_info *s_bgi; /* Journaling */ struct inode * s_journal_inode; |
