Uploaded image for project: 'Lustre'
  1. Lustre
  2. LU-12380

Allow reusing of write openhandle for reads

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.

      Attachments

        Activity

          [LU-12380] Allow reusing of write openhandle for reads

          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

          gerrit Gerrit Updater added a comment - 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

          Oleg Drokin (green@whamcloud.com) uploaded a new patch: https://review.whamcloud.com/35146
          Subject: LU-12380 llite/mds: WIP! piggy back open handle on DoM PW lock
          Project: fs/lustre-release
          Branch: master
          Current Patch Set: 1
          Commit: fccf51448389b5db202adf184dafa34579c7b358

          gerrit Gerrit Updater added a comment - Oleg Drokin (green@whamcloud.com) uploaded a new patch: https://review.whamcloud.com/35146 Subject: LU-12380 llite/mds: WIP! piggy back open handle on DoM PW lock Project: fs/lustre-release Branch: master Current Patch Set: 1 Commit: fccf51448389b5db202adf184dafa34579c7b358
          green Oleg Drokin added a comment -

          I've noticed there's a fairly low hanging fruit for DoM possible wrt open locks.

          If we issue a PW DoM lock already and piggy back open bit on that - the above description works even better with less possible breakage.

          This is esp. nice in conjunction with LU-12325 where initial open only happens for PR lock but only if we have writes - we get a separate DoM PW lock only when we write to the file. We then can avoid the read open MDS roundtrip and get all reads fully locally under the same PW lock.

          Shows real nice results in testing.

          green Oleg Drokin added a comment - I've noticed there's a fairly low hanging fruit for DoM possible wrt open locks. If we issue a PW DoM lock already and piggy back open bit on that - the above description works even better with less possible breakage. This is esp. nice in conjunction with LU-12325 where initial open only happens for PR lock but only if we have writes - we get a separate DoM PW lock only when we write to the file. We then can avoid the read open MDS roundtrip and get all reads fully locally under the same PW lock. Shows real nice results in testing.

          Oleg Drokin (green@whamcloud.com) uploaded a new patch: https://review.whamcloud.com/35054
          Subject: LU-12380 llite: Allow reusing write openhandle for reads from same node
          Project: fs/lustre-release
          Branch: master
          Current Patch Set: 1
          Commit: aa731640ed6f780a284e2626874c7c910a1a0de6

          gerrit Gerrit Updater added a comment - Oleg Drokin (green@whamcloud.com) uploaded a new patch: https://review.whamcloud.com/35054 Subject: LU-12380 llite: Allow reusing write openhandle for reads from same node Project: fs/lustre-release Branch: master Current Patch Set: 1 Commit: aa731640ed6f780a284e2626874c7c910a1a0de6

          People

            wc-triage WC Triage
            green Oleg Drokin
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated: