[LU-16669] Add lock_no_expand tunable on the Lustre client Created: 27/Mar/23 Updated: 04/Jul/23 |
|
| Status: | Open |
| Project: | Lustre |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Improvement | Priority: | Minor |
| Reporter: | Qian Yingjin | Assignee: | Qian Yingjin |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | None | ||
| Issue Links: |
|
||||||||
| Rank (Obsolete): | 9223372036854775807 | ||||||||
| Description |
|
Lustre advise IOCTL interface can set the CEF_LOCK_NO_EXPAND flag, which tells the OSC (the per OST layer of the client) to set LDLM_FL_NO_EXPANSION on any lock requests. LDLM_FL_NO_EXPANSION is a new LDLM lock flag which tells the server not to expand the lock extent. To set this parameter much easier for benchmark or debug purpose, It would better to add a tunable "llite.*.lock_no_expand" to control whether to expand the lock extent for I/O. |
| Comments |
| Comment by Gerrit Updater [ 27/Mar/23 ] |
|
"Qian Yingjin <qian@ddn.com>" uploaded a new patch: https://review.whamcloud.com/c/fs/lustre-release/+/50432 |
| Comment by Andreas Dilger [ 01/Jul/23 ] |
|
Yingjin, could you please provide some background on what this is needed for? I don't see it linked to any other tickets, and there isn't enough explanation in the description to know what this would be used for. I'm wondering if we should add a new LF_INODE flag so that "lfs ladvise locknoexpand <file>" could be set persistently on an inode rather than just a file descriptor? Would that be more useful for applications or test scripts instead of adding a CFS_FAIL_CHECK() that affects all files on the node? |
| Comment by Qian Yingjin [ 03/Jul/23 ] |
|
Hi Andreas, There are two motivations for this work:
Of course we can add a new LF_INODE flag to be set persistently on an inode for "lfs ladies locknoexpand $file". But I am just worried about its narrow usage scope... |
| Comment by Andreas Dilger [ 04/Jul/23 ] |
|
I think in the second case, it makes sense for the client or OSS to detect the lock contention and avoid lock expansion. This already happens on the OSS today with 32+ clients writing to a single file, but it does not take into account disjoint writes with fewer clients. |
| Comment by Qian Yingjin [ 04/Jul/23 ] |
|
I just rebased Patrick's lock contention detection patch: https://review.whamcloud.com/#/c/fs/lustre-release/+/35287/. Both client and server can determine to whether avoid lock expansion under lock contention. Moreover, when the client was informed that the file is under contention, it can switch from default buffered I/O mode to direct I/O mode if the I/O size is large enough. |