[LU-17239] statahead to detect and fetch xattrs Created: 28/Oct/23  Updated: 28/Oct/23

Status: Open
Project: Lustre
Component/s: None
Affects Version/s: Lustre 2.14.0
Fix Version/s: None

Type: Improvement Priority: Minor
Reporter: Andreas Dilger Assignee: WC Triage
Resolution: Unresolved Votes: 0
Labels: None

Issue Links:
Related
is related to LU-17238 negative xattr cache on client Open
Severity: 3
Rank (Obsolete): 9223372036854775807

 Description   

I was running "ls" on a directory and checked "{{mds.
*.job_stats}}" and saw that while all of the getattr RPCs were being sent to the MDS by a statahead thread, the main "ls" process was still sending an equal number of "getxattr" RPCs to the MDS, which is almost certainly losing a lot of the benefit from the statahead operations since the "ls" s.

- job_id:   ls.0
  snapshot_time:   1698469885
  close:    { samples:     1, unit: usecs, min: 69, max:  69, sum:     69, sumsq:     4761 }
  getattr:  { samples:     1, unit: usecs, min:  9, max:   9, sum:      9, sumsq:       81 }
  getxattr: { samples: 24199, unit: usecs, min:  3, max:  31, sum: 121306, sumsq:   639108 }
- job_id:   ll_sa_350160.0
  snapshot_time:   1698469885
  getattr:  { samples: 24199, unit: usecs, min:  4, max: 969, sum: 218406, sumsq: 24834274 }

The "ls" was calling getxattr() and lgetxattr() on each of the files:

statx(AT_FDCWD, "/myth/tv/2005_20171130055700.mpg.png", AT_STATX_SYNC_AS_STAT|AT_SYMLINK_NOFOLLOW|AT_NO_AUTOMOUNT, STATX_MODE|STATX_NLINK|STATX_UID|STATX_GID|STATX_MTIME|STATX_SIZE, {stx_mask=STATX_MODE|STATX_NLINK|STATX_UID|STATX_GID|STATX_MTIME|STATX_SIZE, stx_attributes=0, stx_mode=S_IFREG|0666, stx_size=270222, ...}) = 0
lgetxattr("/myth/tv/2005_20171130055700.mpg.png", "security.selinux", "system_u:object_r:httpd_sys_cont"..., 255) = 41
getxattr("/myth/tv/2005_20171130055700.mpg.png", "system.posix_acl_access", NULL, 0) = -1 ENODATA (No data available)

In some cases, the xattrs will be fetched along with the inode attributes, but if there are a lot of MDS_GETXATTR RPCs being sent for cache misses, then the statahead threads should also prefetch these xattrs to the client.


Generated at Sat Feb 10 03:33:47 UTC 2024 using Jira 9.4.14#940014-sha1:734e6822bbf0d45eff9af51f82432957f73aa32c.