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

Refactor ptlrpc_nrs_request structure to remove union of policy-specific request structures

    XMLWordPrintable

Details

    • Improvement
    • Resolution: Unresolved
    • Minor
    • None
    • None
    • None
    • 17746

    Description

      The ptlrpc_nrs_request structure currently has, as a member, a union of policy specific request structures. This creates a dependency on the policy-specific headers. It would be nice to remove this dependency.

      In a review of http://review.whamcloud.com/#/c/13966 Andreas Dilger stated:

      In the long run, it would be nicer to avoid the need to have a union of all the structures here, and instead just dynamically size this area based on the registered NRS policies. That would avoid the need to even include the lustre_nrs_*.h headers into this file, and they could be internal to each NRS policy.
      Since none of the code is allocating struct ptlrpc_request directly, but rather going through __ptlrpc_request_alloc() in some way or another, this should be possible. The fact that struct ptlrpc is allocated from a slab makes it a bit more difficult but not impossible.
      Options include having some fixed-size buffer that is enough for known policies, or determining how much free space there is for packing each struct into the slab, and allowing larger NRS buffers if there is room (this would require putting struct ptlrpc_nrs_request at the end of struct ptlrpc. The other option is to dynamically allocate the NRS portion for each request, since it only works out to be about 80 bytes.

      I'm opening this ticket to track this enhancement work.

      Attachments

        Issue Links

          Activity

            People

              wc-triage WC Triage
              hornc Chris Horn
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated: