[LU-908] multi-block xattr support Created: 11/Dec/11 Updated: 11/Apr/18 Resolved: 11/Apr/18 |
|
| Status: | Resolved |
| Project: | Lustre |
| Component/s: | None |
| Affects Version/s: | Lustre 2.2.0 |
| Fix Version/s: | None |
| Type: | Improvement | Priority: | Minor |
| Reporter: | Jian Yu | Assignee: | Jian Yu |
| Resolution: | Incomplete | Votes: | 0 |
| Labels: | None | ||
| Issue Links: |
|
||||||||||||||||||||
| Rank (Obsolete): | 10287 | ||||||||||||||||||||
| Description |
|
The existing large xattr patch for ext4 in http://review.whamcloud.com/1708 saves the xattr value in an external inode if the size of the value is larger than the blocksize. This would introduce performance degradation for operating large xattrs due to the need to create an extra inode for any xattr over 4kB. To improve the performance, we would implement "mid-sized" xattrs (up to 64kB) by referencing them directly from the xattr block pointer. This was requested by the upstream ext4 maintainer before accepting the large xattr patches into mainline Linux. |
| Comments |
| Comment by Jian Yu [ 11/Dec/11 ] |
|
There are some comments and discussions for this feature in Comment from Yu Jian on 09/Nov/11: As per bug 4424 comment #112 and comment #272, the following improvements need to be made on the existing large EA patch for ext4 and e2fsprogs so as to get the patch and changes accepted and included into the upstream kernel ext4 and e2fsprogs: 1) EA value will be stored in an external inode if value_size > blocksize instead of 1/2 blocksize. 2) Increase EA space by allocating a single chunk of up to 64kB/blocksize contiguous xattr blocks and storing the block count in ext4_xattr_header->h_blocks. The change to the xattr blocks should be completely transparent to Lustre. ldiskfs can still continue to advertise the maximum xattr size larger than the 64kB which will fit into the external block range, but for most of our uses we will not need more than 64kB. Even the wide striping patch will currently only need 32kB for the 1350-stripe limit. Avoiding the use of the external inode will likely improve performance significantly. As for testing, the normal way to handle this is to add support to ext4 and create a small test filesystem with a multi-block xattr by mounting it with ext4/ldiskfs (nojournal to save space) and using setfattr with a large xattr, use getfattr to verify it works. 3) Then, add support to e2fsprogs and e2fsck in order to check that the multi-block xattr is correct, and then save the image to the e2fsprogs (something like tests/f_xattr_blocks/image.gz) subdirectory and running the e2fsprogs e2fsck test script on it. The e2fsprogs "f_xattrs_blocks" image should include several different inodes:
There is already a test case for the external xattr inode, that should stay. Comment from Yu Jian on 21/Nov/11:
Threads on the linux-ext4 list: The solution is to support handling xattr data among non-contiguous block buffers. |
| Comment by Andreas Dilger [ 22/Oct/15 ] |
|
Note: limiting the individual xattr size to < 4KB would make this enhancement totally useless for Lustre, so that is not an acceptable solution for us. |
| Comment by Andreas Dilger [ 17/Apr/16 ] |
|
Note: the xattr_inode feature has been around long enough in Listre that adding multi-block 64KB xattrs will likely need new feature flag. |
| Comment by Andreas Dilger [ 16/Sep/17 ] |
|
The xattr_inode feature has been included upstream in e2fsprogs-1.44 and kernel 4.14. That said, there are a few changes to the on-disk format (made in a forward compatible way) that should be included into our patches, so that filesystems are maximally compatible when we start using those newer kernels. |
| Comment by Andreas Dilger [ 11/Apr/18 ] |
|
The ea_inode feature is now available in e2fsprogs-1.44 and later. The on-disk format is largely the same as the feature implemented for Lustre, and there are compatibility hooks in the ext4 and e2fsprogs code to handle files using the Lustre-formatted xattr inode. As such, there is currently not much need for this enhancement to be implemented. |