Hi,
I observe long time of execution of ls for mount point i.e. /home ls /home takes about 86.80 sec while
ls /home/tom takes only 1.43 sec. Most time takes getdens64. Please see below
output of strace -r /home/tom
…]
0.000140 poll({fd=3, events=POLLIN|POLLERR|POLLHUP}], 1, 5000) = 1 ({fd=3, revents=POLLIN|POLLHUP}]) 0.000084 read(3, “\2\0\0\0\1\0\0\0\6\0\0\0\2\0\0\0d\0\0\0\0\0\0\0”, 24) = 24
0.000070 read(3, “users\0x\0”, 8) = 8
0.000070 close(3) = 0
0.000088 openat(AT_FDCWD, “/home/tom”, O_RDONLY|O_NONBLOCK|O_LARGEFILE|O_DIRECTORY|O_CLOEXEC) = 3
*0.000093 getdents64(3, / 144 entries */, 32768) = 4792
0.025209 lstat64("/home/tom/.themes", {st_mode=S_IFDIR|0755, st_size=4096, …}) = 0
**0.000092 lgetxattr("/home/tom/.themes", “security.selinux”, 0x9aaacf8, 255) = -1 ENODATA (No data available) 0.000088 lgetxattr("/home/tom/.themes", “system.posix_acl_access”, 0x0, 0) = -1 ENODATA (No data available)…]
output of strace -t /home
…]
0.000072 readv(3, {"\4\0\0\0", 4}, {“root\0x\0”, 7}], 2) = 11
0.000083 read(3, “tom\0”, 4) = 4
0.000069 close(3) = 0
0.000094 openat(AT_FDCWD, “/home”, O_RDONLY|O_NONBLOCK|O_LARGEFILE|O_DIRECTORY|O_CLOEXEC) = 3 0.000097 getdents64(3, / 6 entries /, 32768) = 168
80.419515 lstat64("/home/.", {st_mode=S_IFDIR|0755, st_size=46948352, …}) = 0
0.000114 lgetxattr("/home/.", “security.selinux”, 0x8ba1d00, 255) = -1 ENODATA (No data available)
0.000101 lgetxattr("/home/.", “system.posix_acl_access”, 0x0, 0) = -1 ENODATA (No data available)
0.000084 lgetxattr("/home/.", “system.posix_acl_default”, 0x0, 0) = -1 ENODATA (No data available)
…]
The exact command are
time (echo 3 > /proc/sys/vm/drop_caches ; strace -r ls /home/tom)
and
time (echo 3 > /proc/sys/vm/drop_caches ; strace -r ls /home/)
My questions are:
- is it standard desired behavior?
- is it possible to speed up this ls for mount point (in my case /home)?
Best Regards
Tomek