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

Enable tiny write append for singly striped non-composite file

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • Minor
    • None
    • None
    • None
    • 3
    • 9223372036854775807

    Description

      Append and tiny writes are incompatible in general (see LU-10681) without doing a lot of expensive LDLM lock requests, which defeat the point of tiny writes, but there is one exception.

      Singly striped files with simple (non-composite) layouts can use it safely.

      Tiny writes depend on finding an already dirty page and using its existence as a guarantee that various conditions have been met. Unfortunately, a page can be created without locks appropriate for protecting file size as required by append, so we cannot append safely in general.

      However, a singly striped file presents a special case. When appending to a singly striped file, we must take an LDLM lock on the whole file. If a partial page is created as part of this, we could mark such a page as "created by append". This page is protected by an append-appropriate LDLM lock, and as long as it exists, we know the LDLM lock still exists, so size is "owned" by this client.

      This requires knowing that the file meets the criteria. For this purpose, a flag can be set in the inode indicating that it meets the striping criteria and that the most recent i/o should have created an appropriate page. This flag is only advisory - If it is present, we will attempt to find an appropriate page, if it is not, we won't bother. Correctness depends on checking the inode flag to confirm the layout is simple, and then checking the page level flag to verify the page was indeed created by an append operation.

      I believe it is not possible to convert a simple layout to a composite one without removing the inode, but if that's not the case, then it should be a simple matter of clearing the inode flag. This will require some locking that is not done in the current version of the patch.

      Attachments

        Issue Links

          Activity

            People

              wc-triage WC Triage
              paf Patrick Farrell
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated: