Whamcloud - gitweb
LU-15833 llapi: don't use realpath in llapi_search_fsname()
This patch use st_dev value to dertermine the fsname in
llapi_search_fsname().
The main purpose of this is to limit the number of lstat()
(realpath()) in this function.
get_root_path() is modified to search a mountpoint by dev.
And the last results of get_root_path() is cached to avoid reading
/proc/mount for each call.
A new api function llapi_search_rootpath_by_dev() is added to get
the path of Lustre mountpoint using the specified device value.
**Testing:**
*Environement:*
VMs: 1 client, 1 MDS (2MDT), 1 OSS (2 OST)
Lustre tree: test{001..100}/test{001..100}/test{01..10}/file{01..05}
(500000 files + 110100 folders)
OS: Centos 7 (no statx)
Lustre: 2.15.50_15_g1116739
*Tests*
cd <rootfs>
strace lfs getstripe -r .
echo 3 > /proc/sys/vm/drop_caches
/usr/bin/time lfs getstripe -r . (2 iterations)
*Results*
times (s):
______________________________
| user | system | real | real% |
_______________|______|________|______|_______|
|without patch: | 6.18 | 57.3 | 427 | 0% |
|_______________|______|________|______|_______|
|with patch: | 2.88 | 47.3 | 404 |-5.45% |
|_______________|______|________|______|_______|
strace (only significant changes are displayed):
(*stat = lstat + stat + fstat)
_____________________________________________
| *stat | mmap | open | read | all |
_______________|________|________|________|________|_________|
|without patch: | 760545 | 110142 | 330379 | 330325 | 4742658 |
|_______________|________|________|________|________|_________|
|with patch: | 440484 | 0 | 220277 | 19 | 3541739 |
|_______________|________|________|________|________|_________|
-25.32% syscalls after patching.
Signed-off-by: Etienne AUJAMES <etienne.aujames@cea.fr>
Change-Id: I3812d922d5b1d194d52132cba95d11820424c5d7
Reviewed-on: https://review.whamcloud.com/47258
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Reviewed-by: James Simmons <jsimmons@infradead.org>
Reviewed-by: Oleg Drokin <green@whamcloud.com>