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

fld: use an interval tree for the FLD cache

XMLWordPrintable

    • Icon: Improvement Improvement
    • Resolution: Unresolved
    • Icon: Medium Medium
    • None
    • None
    • None
    • 3
    • 9223372036854775807

      fld_cache_lookup() is a linear scan of the sorted fci_entries_head list under the global fci_lock, called on hot paths such as cross-MDT lock and getattr for every FLD resolution once patch https://review.whamcloud.com/69555 ("LU-20923 mdt: refuse new objects with non-MDT FIDs") is landed. The cache holds sequence ranges [lsr_start, lsr_end) mapped to a target, so lookup is an interval (range-containing) query.

      Replace the sorted linked list with a kernel interval tree (INTERVAL_TREE_DEFINE from <linux/interval_tree_generic.h>, as lustre/obdclass/range_lock.c and lustre/ptlrpc/nodemap_range.c already use) for O(log n) lookup, insert and delete while keeping the merge/split-on-overlap semantics and the LRU shrink list. A hash table is not suitable because the ranges are variable width (adjacent same-target ranges are merged) so there is no fixed key to hash.

            adilger Andreas Dilger
            adilger Andreas Dilger
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: