Details
-
Improvement
-
Resolution: Unresolved
-
Minor
-
None
-
Lustre 2.12.0
-
9223372036854775807
Description
Shrinking directories in ldiskfs would be desirable for cases where a directory had a large number of files created, but the files are deleted and the directory is empty and could be deallocated.
There is a patch submitted to upstream ext4 that is the start of the support for this functionality, but it is not very aggressive about removing directory blocks: https://patchwork.ozlabs.org/project/linux-ext4/list/?series=168937
There is intended to be additional work in this area to improve the directory shrinking functionality.
In addition to the directory shrinking, removal of old OST object directory trees (O/*/d*) is also useful, and could potentially be a substitute for having online directory shrink once the directories are completely empty.
Attachments
Issue Links
Activity
Labels | Original: ldiskfs | New: ldiskfs scalability |
Description |
Original:
Shrinking directories in ldiskfs would be desirable for cases where a directory had a large number of files created, but the files are deleted and the directory is empty and could be deallocated.
There is a patch submitted to upstream ext4 that is the start of the support for this functionality, but it is not very aggressive about removing directory blocks: https://patchwork.ozlabs.org/patch/1048658/ There is intended to be additional work in this area to improve the directory shrinking functionality. In addition to the directory shrinking, removal of old OST object directory trees ({{O/\*/d\*}}) is also useful, and could potentially be a substitute for having online directory shrink once the directories are completely empty. |
New:
Shrinking directories in ldiskfs would be desirable for cases where a directory had a large number of files created, but the files are deleted and the directory is empty and could be deallocated.
There is a patch submitted to upstream ext4 that is the start of the support for this functionality, but it is not very aggressive about removing directory blocks: https://patchwork.ozlabs.org/project/linux-ext4/list/?series=168937 There is intended to be additional work in this area to improve the directory shrinking functionality. In addition to the directory shrinking, removal of old OST object directory trees ({{O/\*/d\*}}) is also useful, and could potentially be a substitute for having online directory shrink once the directories are completely empty. |
Description |
Original:
Shrinking directories in ldiskfs would be desirable for cases where a directory had a large number of files created, but the files are deleted and the directory is empty and could be deallocated.
There is a patch submitted to upstream ext4 that is the start of the support for this functionality, but it is not very aggressive about removing directory blocks: https://patchwork.ozlabs.org/patch/1048658/ There is intended to be additional work in this area to improve the directory shrinking functionality. |
New:
Shrinking directories in ldiskfs would be desirable for cases where a directory had a large number of files created, but the files are deleted and the directory is empty and could be deallocated.
There is a patch submitted to upstream ext4 that is the start of the support for this functionality, but it is not very aggressive about removing directory blocks: https://patchwork.ozlabs.org/patch/1048658/ There is intended to be additional work in this area to improve the directory shrinking functionality. In addition to the directory shrinking, removal of old OST object directory trees ({{O/\*/d\*}}) is also useful, and could potentially be a substitute for having online directory shrink once the directories are completely empty. |
Link | New: This issue is related to EX-5894 [ EX-5894 ] |
Link | Original: This issue is related to EX-5894 [ EX-5894 ] |
Link | New: This issue is related to DDN-1422 [ DDN-1422 ] |
Link | New: This issue is related to DDN-645 [ DDN-645 ] |
The upstream ext4 directory shrink patches have been refreshed:
The most complexity will be around integration of the "shrink directories on dentry delete" patches with the ext4-pdirop.patch patch, especially related to locking order as levels of the htree are removed. We will also need to disable the htree dx_root removal in make_unindexed() in the same way we do for ext4_update_dx_flag() because this would break htree locking and is of marginal benefit. At the point where all objects in a {SEQ}/d*/ directory tree have been removed on an OST, we can just delete the whole sequence directory tree rather than worry about the few remaining blocks for dx_root.
These will mostly only shrink the directory when it is almost completely empty, but for
LU-11912this would still help reduce space usage as old objects are removed. There still needs to be a patch that merges adjacent htree blocks when they are nearly empty. My proposal for a possible implementation for htree leaf block merging was in this linux-ext4 thread on an earlier version of the patch: