Thread (19 messages) 19 messages, 4 authors, 2011-02-24

Re: [PATCH 4/4 v2] ext4: Speed up FITRIM by recording flags in ext4_group_info.

From: Andreas Dilger <hidden>
Date: 2011-02-11 06:01:38

On 2011-02-09, at 23:33, Tao Ma [off-list ref] wrote:
After I delete some big image files and re-run the trim,
it is still much faster than iterating the whole disk.
/dev/sdb2             108G   25G   78G  24% /mnt/ext4

[root@boyu-tm test]# time ./ftrim /mnt/ext4/a
real    0m0.513s
user    0m0.000s
sys    0m0.069s
Excellent results. 
+#define EXT4_GROUP_INFO_NEED_INIT_BIT        0
+#define EXT4_GROUP_INFO_WAS_TRIMMED_BIT        1

#define EXT4_MB_GRP_NEED_INIT(grp)    \
   (test_bit(EXT4_GROUP_INFO_NEED_INIT_BIT, &((grp)->bb_state)))
+#define EXT4_MB_GRP_HAS_BEEN_TRIMMED(grp)    \
For consistency, it would be better to call this:

EXT4_MB_GRP_WAS_TRIMMED(grp)

And also add and use:

EXT4_MB_GRP_SET_TRIMMED(grp)

And 

EXT4_MB_GRP_CLEAR_TRIMMED(grp)
In the code. Then you can add Reviewed-by: on this patch. 

Cheers, Andreas
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help