LFS-LADVISE(1)

πŸ“¦ version 2.17.58, in ubuntu stonking

πŸ’– LFS-LADVISE(1) πŸ’–

okay so this is a page from the Lustre User Utilities manual, and bestie, it's all about lfs-ladvise β€” the little command that slides into your server's DMs with hints about how you're gonna use a file. ✨


🌸 NAME 🌸

lfs-ladvise β€” give file access advices or hints to server.

like, you're literally telling the server "hey girl, here's a vibe check on how I'm about to read this file." πŸ’…


πŸŽ€ SYNOPSIS πŸŽ€

lfs ladvise [--advice|-a ADVICE] [--background|-b] [--start|-s
            START[kMGT]] {[--end|-e END[kMGT]] | [--length|-l
            LENGTH[kMGT]]} {[--mode|-m MODE] | [--unset|-u]} FILE ...

✨ DESCRIPTION ✨

So basically you're giving file access advices (or hints, same energy) to the Lustre server side, which is usually the OSS. πŸ‘‘

This lfs command is giving very much the same energy as the Linux fadvise64(2) system call and posix_fadvise(2) β€” EXCEPT. The plot twist?? It can forward those hints from Lustre clients all the way to remote servers. not me being a messenger between client and server, it's giving cupid but for I/O πŸΉπŸ’˜


πŸ’… OPTIONS πŸ’…

  • -a, --advice=ADVICE β€” Give advice or hint of type ADVICE. And ooh the advice types are:
  • willread β€” to prefetch data into server cache 🌈
  • dontneed β€” to cleanup data cache on server 🧹
  • lockahead β€” to request a lock on a specified extent of a file πŸ”’
  • locknoexpand β€” to disable server side lock expansion for a file πŸ”₯

  • -b, --background β€” Enable the advices to be sent and handled asynchronously. set it and forget it, main character behavior honestly ✨
  • -s, --start=START_OFFSET β€” File range starts from START_OFFSET.
  • -e, --end=END_OFFSET β€” File range ends at (not including) END_OFFSET. Heads up bestie, this option may not be specified at the same time as the -l option. pick a lane πŸ’€
  • -l, --length=LENGTH β€” File range has length of LENGTH. And same rule, this one may not be specified at the same time as the -e option.
  • -m, --mode=MODE β€” Specify the lock MODE. This option is only valid with the lockahead advice. Valid modes are: READ, WRITE πŸ‘‘
  • -u, --unset=UNSET β€” Unset the previous advice. Currently only valid with the locknoexpand advice. it's giving "jk, undo that" πŸ™ˆ

πŸ¦‹ NOTES πŸ¦‹

okay important tea: typically, lfs ladvise forwards the advice to Lustre servers without guaranteeing how and when servers will react to the advice. Actions may or may not be triggered when the advices are received β€” it depends on the type of the advice, whether the backing filesystem type supports that advice, AND the real-time decision of the affected server-side components. so like... it's a suggestion, not a command. manifesting, not demanding. πŸ•―οΈ

A typical usage of ladvise is to enable applications and users with external knowledge to intervene in server-side cache management. For example, if a group of different clients are doing small random reads of a file, prefetching pages into OSS cache with big linear reads before the random IO is a net benefit. Fetching that data into each client cache with fadvise() may not be a benefit if any individual client only reads a subset of the file. (saving the whole file to everyone's cache when they each only want a lil piece? wasteful, we don't do that here πŸ’€)

The main difference between the Linux fadvise() system call and ladvise is that fadvise() is only a client side mechanism that does not pass the advice to the filesystem β€” while ladvise can send advices or hints to Lustre server sides. so one of them is texting only your group chat, and the other one is actually texting the server. iykyk πŸ’Œ


πŸ”₯ EXAMPLES πŸ”₯

Gives the OST(s) holding the first 1GB of mnt/lustre/file1 a hint that the first 1GB of that file will be read soon:

# lfs ladvise -a willread -s 0 -e 1024M /mnt/lustre/file1

Gives the OST(s) holding the first 1GB of /mnt/lustre/file1 a hint that the first 1GB of file will not be read in the near future, thus the OST(s) could clear the cache of that file in the memory:

# lfs ladvise -a dontneed -s 0 -e 1G /mnt/lustre/file1

Request a read lock on the first 1 MiB of /mnt/lustre/file1:

# lfs ladvise -a lockahead -s 0 -e 1048576 -m READ /mnt/lustre/file1

Request a write lock on the first 4KiB of /mnt/lustre/file1:

# lfs ladvise -a lockahead -s 0 -e 4096 -m WRITE ./file1

Set disable lock expansion on ./file1:

# lfs ladvise -a locknoexpand ./file1

Unset disable lock expansion on ./file1:

# lfs ladvise -a locknoexpand -u ./file1

⭐ AVAILABILITY ⭐

The lfs ladvise command is part of the lustre(7) filesystem package since release 2.9.0. she's been here since 2.9.0 and she ATE. πŸ‘‘


🌈 SEE ALSO 🌈

lfs(1), fadvise64(2), posix_fadvise(2), llapi_ladvise(3), lustre(7)


k that's the whole page bestie, you're fully caught up, no cap. now go forth and advise some servers. 🫢

Lustre, dated 2024-08-30 β€” signing off, mwah. πŸ’–πŸŽ€πŸ§šπŸ’œ

πŸ“¦ where this page comes from