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

remove use of small variables from *_thread_info

    XMLWordPrintable

Details

    • Improvement
    • Resolution: Unresolved
    • Minor
    • None
    • None
    • 9223372036854775807

    Description

      The use of variables like "osd_thread_info->oti_id" is pointless. This is an 8-byte variable that is reused across multiple RPCs, but then an on-stack 8-byte pointer "struct osd_id *id" is used to access it, so there is no stack savings at all. I would rather just declare:

              struct ost_id id = { 0 };
      

      on the stack and remove the use of oti_id completely.

      We need a separate series of patches that remove the use of "oti_id/2/3", "oti_fid/2/3", "oti_time", and any other 8- or 16-byte variables from osd_thread_info, mdd_thread_info, mdt_thread_info, etc.

      The use of the *_thread_info was meant to avoid repeated large memory allocations and large on-stack allocations, when there was a crazy kernel push to have 4KB stacks, but these small variables were also added for maximal stack savings. Now that 64-bit kernels have 16KB stacks we don't need them.

      These *_thread_info variables should not be used for passing hidden values between functions, but if they are it is something that we should also know about, and fix the functions to pass the variables directly as arguments.

      Attachments

        Issue Links

          Activity

            People

              hongchao.zhang Hongchao Zhang
              adilger Andreas Dilger
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated: