RFC ext4: Block allocation restriction and inode preferred range of blocks for ext4
Get series with b4
b4 am [email protected]Versions newest first
- v1 RFC Latest7 patches 10 repliesIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/7 | ext4: Add EXT4_IOC_ADD_GLOBAL_ALLOC_RULE restricts block allocationfs/ fs/ fs/ +2 more | +512 | 8 replies | |
| 2/7 | ext4: Add EXT4_IOC_CLR_GLOBAL_ALLOC_RULE clears block allocation restrictionfs/ fs/ fs/ | +205 | 2 replies | |
| 3/7 | ext4: Add EXT4_IOC_ADD_INODE_ALLOC_RULE sets inode preferred range of blocksfs/ fs/ fs/ +3 more | +75 | 0 replies | |
| 4/7 | ext4: Implement the block allocation with restricted blocksfs/ fs/ | +306 | 0 replies | |
| 5/7 | ext4: Implement the block allocation with preferred allocation rangefs/ fs/ fs/ | +43 | 0 replies | |
| 6/7 | ext4: Add EXT4_IOC_PRINT_GLOBAL_ARULE for debug block allocation restrictionfs/ fs/ fs/ | +52 | 0 replies | |
| 7/7 | ext4: Add EXT4_IOC_PRINT_INODE_ARULE for debug inode preferred range of blocksfs/ fs/ fs/ | +27 | 0 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.
Cover letter [RFC][PATCH 0/7]ext4: Block allocation restriction and inode preferred range of blocks for ext4
Hi,
These are trial patches to add block allocation restriction and inode preferred range of blocks for ext4
(http://marc.info/?l=linux-ext4&m=123615213508332&w=2).
This change will help ext4 online defrag to re-implement force defrag (-f) and relevant defrag (-r) features which defrag had implemented in the past version.
Summary of this function:
a. Block allocation restriction (EXT4_IOC_ADD_GLOBAL_ALLOC_RULE)
This is the ioctl interface which allows a privileged program to specify one or more range of blocks which the filesystem's block allocator must not allocate from.
This allows the ext4 online defrag to solve free space fragmentation; it has to do with force defragmentation mode.
This feature may be useful for online shrink; at first, we restrict the allocation from the tail of a filesystem, then move data away from there, and shorten the size of it.
b. Preferred blocks allocation (EXT4_IOC_ADD_INODE_ALLOC_RULE)
This is ioctl interface which associates an inode with preferred range of blocks which the block allocator will try using first.
It gives the two following features to ext4 online defrag.
1. Defragment files and re-allocate them closely each other (Relevant file defragmentation mode needs this one).
2. After solving free space fragmentation, re-allocate a file to the contiguous free space (Force defragmentation mode needs this one).
It is also possible to allocate particular blocks to a file with fallocate in advance.
This patch set consists of following 7 patches (6/7 and 7/7 are for debugging). And can be applied to the ext4 patch queue (2.6.30-git14).
[1/7] Add EXT4_IOC_ADD_GLOBAL_ALLOC_RULE restricts block allocation [2/7] Add EXT4_IOC_CLR_GLOBAL_ALLOC_RULE clears block allocation restriction [3/7] Add EXT4_IOC_ADD_INODE_ALLOC_RULE sets inode preferred range of blocks [4/7] Implement the block allocation with restricted blocks [5/7] Implement the block allocation with preferred allocation range [6/7] (For debugging) Add EXT4_IOC_PRINT_GLOBAL_ARULE prints
block allocation restriction
[7/7] (For debugging) Add EXT4_IOC_PRINT_INODE_ARULE prints
preferred block allocation
ToDos:
1. Support indirect blocks (Current implementation is just for extent based file).
2. Inspect for the lock order of block group and allocation rule.
Any comments are very welcome.
Best regards,
Akira Fujita