[LU-10934] integrate statx() API with Lustre Created: 19/Apr/18 Updated: 14/Apr/22 Resolved: 27/May/20 |
|
| Status: | Resolved |
| Project: | Lustre |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | Lustre 2.14.0 |
| Type: | Improvement | Priority: | Minor |
| Reporter: | Andreas Dilger | Assignee: | Qian Yingjin |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | medium | ||
| Issue Links: |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Rank (Obsolete): | 9223372036854775807 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Description |
|
Kernels 4.10 and later (since commit a528d35e8b) have an enhanced statx() interface that can specify a bitmask to fetch specific attributes from a file (e.g. st_uid, st_gid, st_mode, and st_btime == file creation time), rather than fetching all of the normal stat() attributes (such as st_size and st_blocks). It also has a AT_STATX_DONT_SYNC mode which allows the kernel to return "lazy" stats without flushing all of the client data and fetching an accurate result from the server. This matches (not coincidentally) very well with the Lustre attribute mechanism, and could be advantageous for fetching attributes from ls --color (needs st_mode) without having to do a glimpse to fetch the size (which is just discarded anyway). The Lustre patch https://review.whamcloud.com/27715 "
|
| Comments |
| Comment by Andreas Dilger [ 20/Mar/19 ] |
|
The other question is whether ls uses statx() yet or not. Until that happens, there won't be any visible improvement to "ls --color" performance seen. |
| Comment by Aurelien Degremont (Inactive) [ 20/Mar/19 ] |
As far as I've seen, ls guys are not really eager to support statx |
| Comment by Andreas Dilger [ 20/Mar/19 ] |
|
I found that the stat command was patched to call statx() to fetch file creation time in coreutils 0.28, but unfortunately this is implemented by calling statx() again on the file, rather than calling statx() in the first place to fetch all of the required/available attributes. This means both stat() and statx() will be called on the file, increasing overhead rather than decreasing it |
| Comment by Aurelien Degremont (Inactive) [ 21/Mar/19 ] |
|
For Lustre the second call will likely just read data from cache. The performance impact should be low. But this is not good news. Maybe we should push coreutils in the right direction.
Having a proper full statx implementation in Lustre is still useful. Robinhood can clearly benefit from it. |
| Comment by Andreas Dilger [ 11/Sep/19 ] |
|
There is a very preliminary patch to add statx() support to ls at: https://github.com/jtlayton/coreutils/commits/statx |
| Comment by Andreas Dilger [ 11/Oct/19 ] |
|
The support for stat(1) and ls(1) to use statx(3) to fetch only the required attributes has landed to the upstream GNU coreutils package. |
| Comment by Aurelien Degremont (Inactive) [ 28/Oct/19 ] |
|
Nice Andreas! Do you have a pointer for this change? Does this mean this is optimized and only statx() is used when possible?
|
| Comment by Andreas Dilger [ 30/Oct/19 ] |
|
The coreutils commit is at: |
| Comment by Gerrit Updater [ 05/Nov/19 ] |
|
Yingjin Qian (qian@ddn.com) uploaded a new patch: https://review.whamcloud.com/36674 |
| Comment by Gerrit Updater [ 27/May/20 ] |
|
Oleg Drokin (green@whamcloud.com) merged in patch https://review.whamcloud.com/36674/ |
| Comment by Peter Jones [ 27/May/20 ] |
|
Landed for 2.14 |
| Comment by Alex Zhuravlev [ 04/Jun/20 ] |
|
tests sanityn/106* seem to be broken - even recent debugfs doesn't dump "btime". |
| Comment by Qian Yingjin [ 04/Jun/20 ] |
|
Thanks for your report, Alex. I will investigate it.
Regards, Qian |
| Comment by Gerrit Updater [ 16/Jun/20 ] |
|
Andreas Dilger (adilger@whamcloud.com) uploaded a new patch: https://review.whamcloud.com/38947 |
| Comment by Gerrit Updater [ 17/Jun/20 ] |
|
Neil Brown (neilb@suse.de) uploaded a new patch: https://review.whamcloud.com/38973 |
| Comment by Gerrit Updater [ 23/Jun/20 ] |
|
Oleg Drokin (green@whamcloud.com) merged in patch https://review.whamcloud.com/38973/ |
| Comment by Gerrit Updater [ 25/Aug/20 ] |
|
Oleg Drokin (green@whamcloud.com) merged in patch https://review.whamcloud.com/38947/ |
| Comment by Andreas Dilger [ 04/Nov/20 ] |
|
Support for ls with statx() is in coreutils-8.32-3.fc33 and later. It is disabled in coreutils-8.32-3.fc32 and earlier Fedora releases because of a bug in libseccomp2 (presumably explained and resolved in a private RH bug I don't have access to) that affects its use inside VMs running on RHEL7 and other hosts that do not have statx() system call). Using this statx-enabled-ls should avoid the need for the client to get any OST attributes for the majority of files (i.e. those that have LSOM enabled and store the size on the MDT inode). |