1 .TH llapi_ladvise 3 "2015 Dec 15" "Lustre User API"
3 llapi_ladvise \- give IO advice/hints on a Lustre file to the server
6 .B #include <lustre/lustreapi.h>
8 .BI "int llapi_ladvise(int " fd ", unsigned long long " flags ,
9 .BI " int " num_advise ", struct llapi_ladvise *" ladvise ");"
17 I/O hints (up to a maximum of
21 for the file descriptor
23 from to an application to one or more Lustre servers. Optionally,
25 can modify how the advice will be processed via bitwise-or'd values:
28 Client return to userspace immediately after submitting ladvise RPCs, leaving
29 server threads to handle the advices asynchronously.
35 structure, which contains the following fields:
39 struct llapi_lu_ladvise {
40 __u16 lla_advice; /* advice type */
41 __u16 lla_value1; /* values for different advice types */
43 __u64 lla_start; /* first byte of extent for advice */
44 __u64 lla_end; /* last byte of extent for advice */
52 specifies the advice for the given file range, currently one of:
54 .B LU_LADVISE_WILLREAD
55 Prefetch data into server cache using optimum I/O size for the server.
57 .B LU_LADVISE_DONTNEED
58 Clean cached data for the specified file range(s) on the server.
61 is the offset in bytes for the start of this advice.
64 is the offset in bytes (non-inclusive) for the end of this advice.
66 .IR lla_value1 , " lla_value2" , " lla_value3" , " lla_value4"
67 additional arguments for future advice types and should be
68 set to zero if not explicitly required for a given advice type.
71 forwards the advice to Lustre servers without guaranteeing how and when
72 servers will react to the advice. Actions may or may not triggered when the
73 advices are recieved, depending on the type of the advice as well as the
74 real-time decision of the affected server-side components.
78 is to enable applications and users (via
79 .BR "lfs ladvise" (1))
80 with external knowledge about application I/O patterns to intervene in
81 server-side I/O handling. For example, if a group of different clients
82 are doing small random reads of a file, prefetching pages into OSS cache
83 with big linear reads before the random IO is a net benefit. Fetching
84 that data into each client cache with
86 may not be, due to much more data being sent to the clients.
88 While conceptually similar to the
92 system calls, the main difference of
95 .BR fadvise() / posix_fadvise()
96 are client side mechanisms that do not pass advice to the filesystem, while
98 sends advice or hints to one or more Lustre servers on which the file
99 is stored. In some cases it may be desirable to use both interfaces.
104 return 0 on success, or -1 if an error occurred (in which case, errno is set
109 Insufficient memory to complete operation.
112 One or more invalid arguments are given.
115 memory region pointed by
117 is not properly mapped.
120 Advice type is not supported.