Details
-
Improvement
-
Resolution: Unresolved
-
Major
-
None
-
Lustre 2.13.0
-
None
-
9223372036854775807
Description
Currently when openlock cahe is used we distinguish 3 kinds of opens: WRITE, READ and EXEC. the O_RDWR mode is counted as WRITE.
READ mode is compatible with either EXEC or WRITE, but EXEC and WRITE are incompatible between themselves.
Give that there's a relatively common workload of open file for write ; write into file ; close ; open file for read.; read ; close is typical - it's an interesting idea to combine WRITE and READ handles at least somewhat.
In absence of EXEC mode they are pretty much the same (when obtained in WRITE ; READ order). Exec of course makes it somewhat tricky since as long as we hold the write lock, we cannot do open for exec.
Possible idea to tackle this:
When we have the WRITE openlock (and handle) and we want to open it for READ we can just detect the CW lock (guaranteeing the file did not get anywhere as well - important from correctness perspective!) and reuse the handle.
Should we get a blocking ast on the CW lock (or perhaps even before? or as a lock/mode convert downgrade op (obviously it's a protocol change so more involved)?) - we would first send and acquire a read handle (and lock) and then release the CW lock and WRITE handle allowing us continuity in operations.
Oleg Drokin (green@whamcloud.com) uploaded a new patch: https://review.whamcloud.com/35147
Subject: LU-12380 llite: WIP Allow open lock converting.
Project: fs/lustre-release
Branch: master
Current Patch Set: 1
Commit: c0f1e5bb557ed07e0c7a3d49e8026eba127591fe